Makefile (904B)
1 all: tools 2 .PHONY: all 3 4 miniroon_tool_names:=read verify 5 6 tools:=$(patsubst %,build/miniroon-%,$(miniroon_tool_names)) 7 tools: $(tools) 8 .PHONY: tools 9 10 define miniroon_autolink = 11 include build/cmd_$(1).c.deps.mk 12 build/miniroon-$(1): $$(LINKDEP_cmd_$(1)__c) ../link build/cmd_$(1).c.deps.mk 13 ../link -o '$$@' $$(LINKDEP_cmd_$(1)__c) 14 endef 15 $(foreach var,$(miniroon_tool_names),$(eval $(call miniroon_autolink,$(var)))) 16 17 clean: 18 rm -r $(tools) build 19 .PHONY: clean 20 21 ## pattern rules: 22 23 %_perfhash.c %_perfhash.h: %_perfhash.txt ../genhash 24 ../genhash '$*_perfhash' '$<' 25 26 build/%.c.i: %.c ../cc build/.exists 27 ../cc -E -C -o '$@' '$*.c' 28 29 build/%.o: build/%.c.i ../cc 30 ../cc -fpreprocessed -c -o '$@' 'build/$*.c.i' 31 32 build/%.c.deps.mk: build/%.c.i ../codedeps.awk 33 awk -v srcname='$*.c' -v target='build/$*.c.i' -f ../codedeps.awk 'build/$*.c.i' >'$@.new' 34 mv '$@.new' '$@' 35 36 %/.exists: 37 mkdir -p '$*' 38 touch '$@'