X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=Makefile;h=830d5e79d259f13921d93afd5a7d416de0900463;hb=e9d58dce0a1eca2c78aec260406e1605ae29fff7;hp=57abdad406c1e7b32247567ef4b6bda16b0709ed;hpb=3a571bf2d55c87a3d08641f7df7681c923717eb1;p=avr-crypto-lib.git diff --git a/Makefile b/Makefile index 57abdad..830d5e7 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# Makefile for the micro-crypt project +# Makefile for the AVR-Crypto-Lib project # author: Daniel Otte BLOCK_CIPHERS := @@ -14,15 +14,18 @@ include mkfiles/*.mk ALGORITHMS = $(BLOCK_CIPHERS) $(STREAM_CIPHERS) $(HASHES) $(PRNGS) $(MACS) ALGORITHMS_OBJ = $(patsubst %,%_OBJ, $(ALGORITHMS)) +ALGORITHMS_TEST_BIN = $(patsubst %,%_TEST_BIN, $(ALGORITHMS)) + define OBJinBINDIR_TEMPLATE $(1) = $(2) endef + $(foreach a, $(ALGORITHMS_OBJ), $(eval $(call OBJinBINDIR_TEMPLATE, $(a), $(patsubst %.o,$(BIN_DIR)%.o,$($(a)))))) -ALGORITHMS_TEST_BIN = $(patsubst %,%_TEST_BIN, $(ALGORITHMS)) + $(foreach a, $(ALGORITHMS_TEST_BIN), $(eval $(call OBJinBINDIR_TEMPLATE, $(a), $(patsubst %.o,$(TESTBIN_DIR)%.o,$($(a)))))) -ALGORITHMS_TEST_BIN_IMM = $(foreach a, $(ALGORITHMS_TEST_BIN), $($(a))) +#ALGORITHMS_TEST_BIN_IMM = $(foreach a, $(ALGORITHMS_TEST_BIN), $($(a))) ALGORITHMS_NESSIE_TEST = $(patsubst %,%_NESSIE_TEST, $(ALGORITHMS)) ALGORITHMS_PERFORMANCE_TEST = $(patsubst %,%_PERORMANCE_TEST, $(ALGORITHMS)) @@ -62,7 +65,7 @@ $(foreach algo, $(ALGORITHMS), $(eval $(call MAIN_OBJ_TEMPLATE, \ help: info info: - @echo "infos on micro-crypt:" + @echo "infos on AVR-Crypto-lib:" @echo " block ciphers:" @echo " $(BLOCK_CIPHERS)" @echo " stream ciphers:" @@ -73,10 +76,30 @@ info: @echo " $(MACS)" @echo " PRNG functions:" @echo " $(PRNGS)" -# @echo " ALGORITHMS_TEST_BIN" +# @echo " ALGORITHMS_TEST_BIN:" # @echo " $(ALGORITHMS_TEST_BIN)" # @echo " ALGORITHMS_TEST_TARGET_ELF:" # @echo " $(ALGORITHMS_TEST_TARGET_ELF)" + @echo " targets:" + @echo " all - all algorithm cores" + @echo " cores - all algorithm cores" + @echo " listings - all algorithm core listings" + @echo " tests - all algorithm test programs" + @echo " stats - all algorithm size statistics" + @echo " blockciphers - all blockcipher cores" + @echo " streamciphers - all streamcipher cores" + @echo " hashes - all hash cores" + @echo " macs - all MAC cores" + @echo " prngs - all PRNG cores" + @echo " all_testrun - testrun all algorithms" + @echo " docu - build doxygen documentation" + @echo " clean - remove a lot of builded files" + @echo " xclean - also remove dependency files" + @echo " *_TEST_BIN - build test program" + @echo " *_TESTRUN - run nessie test" + @echo " *_OBJ - build algorithm core" + @echo " *_FLASH - flash test program" + @echo " *_LIST - build assembler listing" #------------------------------------------------------------------------------- @@ -116,6 +139,15 @@ endef $(foreach algo, $(ALGORITHMS), $(eval $(call OBJ_TEMPLATE, $(algo), $($(algo)_OBJ)))) + +#------------------------------------------------------------------------------- + +define TESTBIN_TEMPLATE +$(1)_TEST_BIN: $(2) +endef + +$(foreach algo, $(ALGORITHMS), $(eval $(call TESTBIN_TEMPLATE, $(algo), $($(algo)_TEST_BIN)))) + #------------------------------------------------------------------------------- $(BLOCK_CIPHERS_OBJ): $(patsubst %,%_OBJ, $(BLOCK_CIPHERS)) @@ -124,8 +156,6 @@ $(HASHES_OBJ): $(patsubst %,%_OBJ, $(HASHES)) $(PRNGS_OBJ): $(patsubst %,%_OBJ, $(PRNGS)) $(MACS_OBJ): $(patsubst %,%_OBJ, $(MACS)) -$(ALGORITHMS_TEST_BIN): $(ALGORITHMS_TEST_BIN_IMM) - #------------------------------------------------------------------------------- define SIZE_TEMPLATE @@ -151,12 +181,12 @@ $(foreach algo, $(ALGORITHMS),$(eval $(call FLASH_TEMPLATE, $(algo), $(TESTBIN_D define TESTRUN_TEMPLATE $(1)_TESTRUN: $(1)_FLASH @echo "[test]: $(1)" - $(RUBY) get_test.rb $(TESTPORT) $(TESTPORTBAUDR) 8 1 nessie $(TESTLOG_DIR)$(TESTPREFIX) $(2) + $(RUBY) $(GET_TEST) $(TESTPORT) $(TESTPORTBAUDR) 8 1 nessie $(TESTLOG_DIR)$(TESTPREFIX) $(2) endef $(foreach algo, $(ALGORITHMS),$(eval $(call TESTRUN_TEMPLATE, $(algo), $(call lc,$(algo)) ))) -ALL_TESTRUN: $(foreach algo, $(ALGORITHMS), $(algo)_TESTRUN) +all_testrun: $(foreach algo, $(ALGORITHMS), $(algo)_TESTRUN) #------------------------------------------------------------------------------- @@ -226,6 +256,20 @@ xclean: clean docu: doxygen +make.dump: Makefile + $(MAKE) -p -B -n -f $^ > $@ + +make.dot: make.dump + $(MAKE2GRAPH) $^ > $@ + +make.png: make.dot + $(TWOPI) -Tpng -o $@ $^ + +make.svg: make.dot + $(TWOPI) -Tsvg -o $@ $^ + +.PHONY: make-info +make-info: make.png make.svg # Rules for building the .text rom images