prototype IR and parser
[henge/webcc.git] / src / .make / build.mk
index 86e518d..eb98325 100644 (file)
@@ -3,7 +3,7 @@
 #Author: Mihrtec LLC
 #Date:   2016
 ##################################################
-#Included from ./build.mk
+#Included from Makefile
 #Defines variables used in the make process to
 #compile C files either to
 #native asm through gcc, or web through
 ##################################################
 #Environment Setup
 ##################################################
-#Extra modules to build (core is built by default)
-MODULES  :=
-#Libraries to include
-LIBS     := wolfssl SDL2 SDL2_image SDL2_ttf
-
-#Build system directory management
-REPOROOT := ..
-DISTDIR  := $(REPOROOT)/dist
-BINDIR   := $(DISTDIR)/bin
-EXEDIR   := $(BINDIR)/$(shell uname -m)
-XTDIR    := $(REPOROOT)/extern
-XTLIBDIR := /usr/local/lib/mihrtec
-
+#Project root
+PROJDIR  := ..
+#Output directories for distributables
+DISTDIR  := $(PROJDIR)/dist
 #Build rules for each source type
 include .make/buildc.mk
+include .make/buildhtml.mk
+
+#Build rules for tools
+ifdef TOOLS
+include .make/buildtools.mk
+endif
 
 #Set the final target, flags, and objects for app compile
-APPDEPS  := $(CTARG) $(APPDEPS)
-APPTARG  := $(EXEDIR)/$(APPNAME)$(APPSUFFIX)
-APPFLAGS := $(CXXFLAGS) $(CFLAGS) $(APPFLAGS)
-APPDIRS  := $(sort $(dir $(APPTARG) $(WEBTARG)))
+APPC     := $(CC)
+APPDEPS  := $(strip $(CDEPS) $(CTARG) $(APPDEPS))
+APPSRC   := $(filter %$(COBJSUF),$(APPDEPS))
+APPTARG  := $(CBINDIR)/$(APPNAME)$(APPSUF)
+APPFLAGS := $(strip $(CXXFLAGS) $(CFLAGS) $(APPFLAGS))
+APPDIRS  := $(sort $(dir $(APPTARG) $(APPDEPS)))