X-Git-Url: https://www.kengrimes.com/gitweb/?p=henge%2Fwebcc.git;a=blobdiff_plain;f=src%2FMakefile;h=89aba0e59efb9ccb3a12e50ac5b5b85eb78ccc5f;hp=894514adab6ae0692f6c13ccccca60032fce337a;hb=8f6cd444a2508bf0160e14cbc456c7dd6658494a;hpb=6d5141829211936ecaed3d9d13a239a75ecae712 diff --git a/src/Makefile b/src/Makefile index 894514a..89aba0e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -15,6 +15,8 @@ APPFLAGS := APPOBJ := #Dependencies which must be built before the executable APPDEPS := +#Directories containing independent tools +TOOLS := apc ################################################## #Emscripten Info ################################################## @@ -68,6 +70,20 @@ scrub: | clean #cancel default %.o behavior for %.d dependency %.o : %.c +#construct list of make rules for tools +ifdef TOOLS +TOOLTARGS := $(foreach tool,$(TOOLS),$(tool)/$(tool)) +.phony: $(TOOLS) +$(TOOLS): $(TOOLTARGS) + +T = $(notdir $@) +$(TOOLTARGS): $(TOOLOBJ) + $($TCC) $($TFLG) $($TSRC:.c=.o) -o $@ + +#Put our toolsrc on the ctarg list for generating deps +CTARG := $(CTARG) $(TOOLOBJ) +endif + #Generate and evaluate C dependencies $(foreach base,$(basename $(sort $(strip $(CTARG)))),\ $(eval $(strip $(base)$(COBJSUF): $(shell $(subst $BASE,$(base),$(CDEPSCOMMAND)))) $(CDEPS)))