Build System +Tool specific compilers and targets
authorksg <ken@mihrtec.com>
Tue, 30 Aug 2016 18:43:51 +0000 (11:43 -0700)
committerksg <ken@mihrtec.com>
Tue, 30 Aug 2016 18:43:51 +0000 (11:43 -0700)
src/.make/buildtools.mk
src/Makefile

index d4cdc1d..feb2f5f 100644 (file)
@@ -13,5 +13,4 @@ apcCL  := -r /usr/local/the_march -o $(DISTDIR)/file.asspack
 
 TOOLSUP := $(shell echo '$(TOOLS)' | tr '[:lower:]' '[:upper:]')
 TOOLSRC := $(foreach tool,$(TOOLS),$($(tool)SRC))
-TOOLDEP := $(TOOLSRC:.c=.d)
 TOOLOBJ := $(TOOLSRC:.c=.o)
index 89aba0e..64a42a1 100644 (file)
@@ -15,7 +15,7 @@ APPFLAGS  :=
 APPOBJ    :=
 #Dependencies which must be built before the executable
 APPDEPS   :=
-#Directories containing independent tools
+#Directories containing independent tools for GNU
 TOOLS     := apc
 ##################################################
 #Emscripten Info
@@ -77,9 +77,16 @@ TOOLTARGS := $(foreach tool,$(TOOLS),$(tool)/$(tool))
 $(TOOLS): $(TOOLTARGS)
 
 T = $(notdir $@)
+B = $(basename $T)
 $(TOOLTARGS): $(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): %.c
+       $($BCC) $(BFLG) $< -c -o $@
+
 #Put our toolsrc on the ctarg list for generating deps
 CTARG := $(CTARG) $(TOOLOBJ)
 endif