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
APPTARG := $(EXEDIR)/$(APPNAME)$(APPSUFFIX)
APPFLAGS := $(CXXFLAGS) $(CFLAGS) $(APPFLAGS)
APPDIRS := $(sort $(dir $(APPTARG) $(WEBTARG)))
+
##################################################
#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
#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
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"
$(WOLFDIR):
@mkdir -p $(WOLFDIR)
@git clone $(GITADDR) $(WOLFDIR)
- @mkdir -p $(dir $(WOLFTARG))
-
-scrub:
+clean_wolfssl:
cd $(WOLFDIR) && make clean