#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
-WOLFDIR := $(XTDIR)/wolfssl
+WOLFDIR := $(MLSRCDIR)/wolfssl
WOLFSO := $(WOLFDIR)/src/.libs/libwolfssl.so
-WOLFTARG := $(XTLIBDIR)/libwolfssl.so
+WOLFTARG := $(MLLIBDIR)/libwolfssl.so
CONFCL := --enable-singlethreaded=yes
CONFCL += --enable-static=yes
CONFCL += --enable-fastmath=no
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