diff options
| author | Kévin Le Gouguec <kevin.legouguec@airbus.com> | 2018-11-28 10:48:11 +0100 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@airbus.com> | 2018-11-28 10:48:11 +0100 |
| commit | 7bbd4e2aeb37430aa17e99e1f9acd2d31c2fc034 (patch) | |
| tree | 7c5303f9dd091e2feab08a1bba81b208fe3b96a7 /src | |
| parent | b69bd933b2f7f54a1b8943cd834ea0777a2e32d7 (diff) | |
| download | lilliput-ae-implem-7bbd4e2aeb37430aa17e99e1f9acd2d31c2fc034.tar.xz | |
Ajout d'un Makefile commun à toutes les implémentations de référence
Diffstat (limited to 'src')
| -rw-r--r-- | src/common.mk | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/common.mk b/src/common.mk new file mode 100644 index 0000000..ec56102 --- /dev/null +++ b/src/common.mk @@ -0,0 +1,46 @@ +nist_flags = -std=c99 -Wall -Wextra -Wshadow -fsanitize=address,undefined -O2 +CFLAGS += -I. -Isrc $(nist_flags) -Werror +LDFLAGS += $(nist_flags) + +# use "make VERBOSE=1" to have full commands printed out. +VERBOSE = 0 +ifeq ($(VERBOSE),1) +Q = +else +Q = @ +endif + + +.PHONY: clean test $(tests) + + +clean: + -rm -r results + +results: + @ mkdir -p $@ + +results/%.o: %.c + @ mkdir -p $(dir $@) + @ echo "CC $@" + $(Q) gcc -c $< $(CFLAGS) -o $@ + +results/test-%: results/test/test-%.o + @ echo "LD $@" + $(Q) gcc $^ $(LDFLAGS) -o $@ + +test: $(tests) + +$(tests): %: results/% + @ echo "TEST $@" + $(Q) ./results/$@ + + +results/src/cipher.o: src/cipher.h src/tweakey.h src/constants.h parameters.h +results/src/constants.o: src/constants.h +results/src/lilliput-ae-i.o: src/lilliput-ae.h src/cipher.h src/constants.h +results/src/tweakey.o: src/tweakey.h src/constants.h parameters.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 |
