Buildsys1.1
authorksg <ken@mihrtec.com>
Thu, 7 Jul 2016 03:05:50 +0000 (20:05 -0700)
committerksg <ken@mihrtec.com>
Thu, 7 Jul 2016 03:05:50 +0000 (20:05 -0700)
src/.make/build.mk
src/.make/buildc_emcc.mk
src/.make/libwolfssl.mk

index c2c5562..86e518d 100644 (file)
@@ -22,7 +22,7 @@ DISTDIR  := $(REPOROOT)/dist
 BINDIR   := $(DISTDIR)/bin
 EXEDIR   := $(BINDIR)/$(shell uname -m)
 XTDIR    := $(REPOROOT)/extern
-XTLIBDIR := $(XTDIR)/lib
+XTLIBDIR := /usr/local/lib/mihrtec
 
 #Build rules for each source type
 include .make/buildc.mk
@@ -32,3 +32,4 @@ APPDEPS  := $(CTARG) $(APPDEPS)
 APPTARG  := $(EXEDIR)/$(APPNAME)$(APPSUFFIX)
 APPFLAGS := $(CXXFLAGS) $(CFLAGS) $(APPFLAGS)
 APPDIRS  := $(sort $(dir $(APPTARG) $(WEBTARG)))
+
index 364c707..800722c 100644 (file)
@@ -7,15 +7,18 @@
 ##################################################
 #redefine EXE directory for web platform
 EXEDIR    := $(BINDIR)/web/js
+#EMCC targets .js "executables"
 APPSUFFIX := .js
-#Override targets to make .bc files
+#EMCC provides ports of each of these, so remove them
+#and recalculate CLIBS
 LIBS     := $(filter-out SDL2 SDL2_image SDL2_ttf, $(LIBS))
 CLIBS    := $(patsubst %,-l%,$(LIBS))
+#Override targets to make .bc files
 CTARG    := $(CTARG:.o=.bc)
 #Expand the list of plain-text functions into what emcc expects
 EXPORT_FUNCS := $(patsubst %,'_%',$(EXPORT_FUNCS))
 EXPORT_LIST := $(shell echo "$(EXPORT_FUNCS)" | sed -e 's@ @, @g')
-#Mark all libs "missing" since they need to be built for emcc
+#Mark all remaining libs "missing" since they need to be built for emcc
 MISSINGLIBS := $(LIBS)
 #Set XTLibDir to one for bytecodes
 XTLIBDIR := $(XTLIBDIR)/bc
index ae1bcf2..d9b77e4 100644 (file)
@@ -4,8 +4,8 @@
 #Date:   2016
 ##################################################
 #Included from Makefile
-#Defines rules for automatically making and
-#linking the external wolfssl library
+#Defines rules for automatically downloading,
+#compiling, and linking the wolfssl library
 ##################################################
 
 #wolfssl module compilation rules
@@ -19,8 +19,17 @@ CONFCL   += --enable-cryptonly=yes
 CONFCL   += CFLAGS=-w
 GITADDR  := git@github.com:wolfSSL/wolfssl.git
 
+#Remove the WOLFSO after compile since it is
+#compiler-dependent, and we copy it to WOLFTARG
+#which is a compiler-dependent location
 .INTERMEDIATE: $(WOLFSO)
+
+#WOLFTARG is the target file to generate for the
+#missing library.  It depends on WOLFSO, an
+#intermediate file generated only when we need
+#to copy it to WOLFTARG
 $(WOLFTARG): $(WOLFSO)
+       @mkdir -p $(dir $(WOLFTARG))
        @cp -H $(WOLFSO) $(WOLFTARG)
        @echo "WolfSSL library created"
 
@@ -33,8 +42,6 @@ $(WOLFSO): $(WOLFDIR)
 $(WOLFDIR):
        @mkdir -p $(WOLFDIR)
        @git clone $(GITADDR) $(WOLFDIR)
-       @mkdir -p $(dir $(WOLFTARG))
-
 
-scrub:
+clean_wolfssl:
        cd $(WOLFDIR) && make clean