X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=Makefile_main.inc;h=1edb6601f601c719bf59330314f0948a054de713;hb=7715ef86b09869014eb5afd319e4acc2ce157b00;hp=9a3f05f080a9ba7095e40698f46da25513d0c1c8;hpb=997bf1010de28a0a7246b792254a1ec6a59d5d4d;p=avr-crypto-lib.git diff --git a/Makefile_main.inc b/Makefile_main.inc index 9a3f05f..1edb660 100644 --- a/Makefile_main.inc +++ b/Makefile_main.inc @@ -34,8 +34,9 @@ GLOBAL_INCDIR := ./ $(TESTSRC_DIR) #------------------------------------------------------------------------------- # inclusion of make stubs -include mkfiles/0*.mk -include mkfiles/*.mk +include $(sort $(wildcard mkfiles/*.mk)) + +default: info #------------------------------------------------------------------------------- ALGORITHMS = $(BLOCK_CIPHERS) $(STREAM_CIPHERS) $(HASHES) $(PRNGS) $(MACS) \ @@ -63,7 +64,9 @@ $(foreach a, $(ALGORITHMS), $(eval $(call Assert_Template, \ #------------------------------------------------------------------------------- - +define GenericTarget_Template +$(1): $(2) +endef define TargetSource_Template $(1): $(2) @@ -174,7 +177,7 @@ $(1): @mkdir -p $(1) endef -$(foreach d, DEP_DIR BIN_DIR TESTSRC_DIR TESTLOG_DIR SPEEDLOG_DIR SIZE_DIR LIST_DIR STAT_DIR AUTOASM_DIR, $(eval $(call MakeDir_TEMPLATE, \ +$(foreach d, DEP_DIR BIN_DIR TESTSRC_DIR TESTLOG_DIR SPEEDLOG_DIR SIZE_DIR LIST_DIR STAT_DIR, $(eval $(call MakeDir_TEMPLATE, \ $($(d)) \ ))) @@ -239,15 +242,26 @@ hash_speed: $(foreach algo, $(HASHES), $(algo)_SPEED) blockcipher_speed: $(foreach algo, $(BLOCK_CIPHERS), $(algo)_SPEED) #------------------------------------------------------------------------------- +define Size_Template +$(1): $(2) + @echo "[size] $(3)" + @mkdir -p $(dir $(1)) + @$(SIZE) $(2) > $(1) +endef + +$(foreach algo, $(ALGORITHMS), $(eval $(call Size_Template, \ + $(strip $(SIZE_DIR))$(strip $(call lc, $(algo))).size,$($(algo)_BINOBJ),$(algo) \ +))) define Size_Template $(1)_SIZE: $(2) @echo "[size] $(1)" - $(SIZE) $(2) > $(strip $(SIZE_DIR))$(strip $(call lc, $(1))).size + @mkdir -p $(dir $(strip $(SIZE_DIR))$(strip $(call lc, $(1))).size) + @$(SIZE) $(2) > $(strip $(SIZE_DIR))$(strip $(call lc, $(1))).size endef -$(foreach algo, $(ALGORITHMS), $(eval $(call Size_Template, \ - $(strip $(algo)), $($(algo)_BINOBJ) \ +$(foreach algo, $(ALGORITHMS), $(eval $(call GenericTarget_Template, \ + $(strip $(algo))_SIZE,$(strip $(SIZE_DIR))$(strip $(call lc, $(algo))).size \ ))) .PHONY: hash_size @@ -256,6 +270,13 @@ hash_size: $(foreach algo, $(HASHES), $(algo)_SIZE) .PHONY: blockcipher_size blockcipher_size: $(foreach algo, $(BLOCK_CIPHERS), $(algo)_SIZE) +.PHONY: size +size: $(foreach algo, $(ALGORITHMS), $(algo)_SIZE) + +.PHONY: size_clean +size_clean: + rm -vf $(strip $(SIZE_DIR))*.size + #------------------------------------------------------------------------------- .PHONY: tests @@ -353,7 +374,7 @@ info: @echo " cores - all algorithm cores" @echo " listings - all algorithm core listings" @echo " tests - all algorithm test programs" - @echo " stats - all algorithm size statistics" + @echo " size - all algorithm size statistics" @echo " blockciphers - all blockcipher cores" @echo " streamciphers - all streamcipher cores" @echo " hashes - all hash cores"