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