blob: 3c73db80f83589a426c1b63bf9d53f71e1618fec (
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
32
33
34
35
|
tests = test-tweakey
.PHONY: clean $(tests)
nist_flags = -std=c99 -Wall -Wextra -Wshadow -fsanitize=address,undefined -O2
clean:
-rm -r results
results:
mkdir -p $@
# TODO: should add order-only prerequisite to remove mkdir from this target
results/%.o: %.c
@mkdir -p $(dir $@)
gcc -c -I. $< $(nist_flags) -Werror -o $@
results/test-%: results/test/test-%.o
gcc $^ $(nist_flags) -Werror -o $@
$(tests): %: results/%
mkdir -p results/$@-output
./results/$@ results/$@-output
diff -ru test/$*-ref results/$@-output
results/test-tweakey: results/tweakey.o results/constants.o | results
results/test-tweakey.o: tweakey.h
results/tweakey.o: tweakey.h constants.h
results/constants.o: constants.h
# TODO: add valgrind
|