APPOBJ :=
#Dependencies which must be built before the executable
APPDEPS :=
+#Directories containing independent tools for GNU
+TOOLS := apc
##################################################
#Emscripten Info
##################################################
dox doc:
doxygen dox.conf
-#clean up intermediate dependency files and binaries
-clean:
- @echo "Cleaning build targets"
- rm -f $(APPTARG) $(WEBTARG) $(CTARG)
-
-#Scrub down to minimal distribution
-scrub: | clean
-
################## DEFAULTS #####################
#cancel default %.o behavior for %.d dependency
%.o : %.c
+#construct list of make rules for tools
+ifdef TOOLS
+TOOLTRG := $(foreach tool,$(TOOLS),$(tool)/$(tool))
+.phony: $(TOOLS)
+$(TOOLS): $(TOOLTRG)
+
+T = $(notdir $@)
+D = $(dir $@)
+B = $(basename $D)
+$(TOOLTRG): $(TOOLOBJ)
+ $($TCC) $($TFLG) $($TSRC:.c=.o) -o $@
+
+#Tools only work on whatever system they're designed for
+#(typically GNU), so their creation rules are dependent
+#on each tool (define in .make/.buildtools.mk)
+$(foreach tool,$(TOOLS),$(tool)/%.o): $(dir $@)%.c
+ $($BCC) $(BFLG) $< -c -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)))
include $(foreach lib,$(MISSINGLIBS),.make/lib$(lib).mk)
endif
+#include rules for making each app
+ifdef APPTARGS
+include $(foreach app,$(APPTARGS),.make/app$(app).mk)
+endif
+
+#clean up intermediate dependency files and binaries
+clean:
+ @echo "Cleaning build targets"
+ rm -f $(APPTARG) $(WEBTARG) $(CTARG)
+
+#Scrub down to minimal distribution
+scrub: | clean
+