From 745c7147f006a757c4f4387604c6525ef3768abc Mon Sep 17 00:00:00 2001 From: ksg Date: Wed, 6 Jul 2016 20:05:50 -0700 Subject: [PATCH] Buildsys1.1 --- src/.make/build.mk | 3 ++- src/.make/buildc_emcc.mk | 7 +++++-- src/.make/libwolfssl.mk | 17 ++++++++++++----- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/.make/build.mk b/src/.make/build.mk index c2c5562..86e518d 100644 --- a/src/.make/build.mk +++ b/src/.make/build.mk @@ -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))) + diff --git a/src/.make/buildc_emcc.mk b/src/.make/buildc_emcc.mk index 364c707..800722c 100644 --- a/src/.make/buildc_emcc.mk +++ b/src/.make/buildc_emcc.mk @@ -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 diff --git a/src/.make/libwolfssl.mk b/src/.make/libwolfssl.mk index ae1bcf2..d9b77e4 100644 --- a/src/.make/libwolfssl.mk +++ b/src/.make/libwolfssl.mk @@ -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 -- 2.18.0