summaryrefslogtreecommitdiff
path: root/crypto_aead/lilliputaei128v1/ref/Makefile
blob: 7befdd2684fe762958efbfa885aaab0cbc283149 (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
39
40
41
42
43
44
tests = test-tweakey test-tbc-encrypt test-tbc-decrypt

.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


results/test-tbc-decrypt: results/cipher.o results/tweakey.o results/constants.o | results
results/test-tbc-encrypt: results/cipher.o results/tweakey.o results/constants.o | results
results/test-tweakey: results/tweakey.o results/constants.o | results

results/test-*.o: test/helpers.h parameters.h
results/test-tbc-decrypt.o: cipher.h
results/test-tbc-encrypt.o: cipher.h
results/test-tweakey.o: tweakey.h

results/cipher.o: cipher.h tweakey.h constants.h parameters.h debug.h
results/tweakey.o: tweakey.h constants.h parameters.h debug.h
results/constants.o: constants.h

# TODO: should add order-only prerequisites to remove mkdirs inside recipes
# TODO: add valgrind, although it does not seem to play well with ASAN
# TODO: should use gcc -M... to generate .o -> .h dependencies