summaryrefslogtreecommitdiff
path: root/crypto_aead/lilliputaei128v1/ref/Makefile
blob: 8379bb9220020a94b5b001d7591890ed0d98bbaa (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
36
37
38
# TODO: should add order-only prerequisites to remove mkdirs inside recipes

tests = test-tweakey test-cipher

.PHONY: clean test $(tests)


nist_flags = -std=c99 -Wall -Wextra -Wshadow -fsanitize=address,undefined -O2


clean:
	-rm -r results

results:
	mkdir -p $@

results/%.o: %.c
	@mkdir -p $(dir $@)
	gcc -c -I. $< $(nist_flags) -Werror -o $@

results/test-%: results/test/test-%.o
	gcc $^ $(nist_flags) -Werror -o $@

test: $(tests)

$(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 parameters.h
results/tweakey.o: tweakey.h constants.h parameters.h
results/constants.o: constants.h

# TODO: add valgrind, although it does not seem to play well with ASAN