summaryrefslogtreecommitdiff
path: root/Makefile
blob: 10adf286f4fb7b947bed3541479f8a856804766c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
TESTS = graph/test/binary_lifting.test graph/test/LCA_sparse.test

pdf:
	latexmk -pdf tcr

all: pdf test

test: $(TESTS:.test=.ok)

clean: cleanpdf cleantest

cleanpdf:
	latexmk -c tcr
	rm -f *.thm

cleantest:
	rm -f $(TESTS) $(TESTS:.test=.ok)

%.ok: %.test
	timeout -v 1 ./$<
	@touch $@
%.test: %.cpp test.h
	g++ -include test.h -std=gnu++20 -Wall -Wextra -Wpedantic -Werror \
		-fsanitize=address,undefined -g -o $@ $<

graph/test/binary_lifting.test: graph/test/binary_lifting.cpp \
	graph/binary_lifting.cpp graph/test/util.cpp
graph/test/LCA_sparse.test: graph/test/LCA_sparse.cpp \
	graph/LCA_sparse.cpp datastructures/sparseTable.cpp graph/test/util.cpp

.PHONY: all pdf test clean cleanpdf cleantest