prototype IR and parser
[henge/webcc.git] / src / .make / libwolfssl.mk
1 ##################################################
2 #Desc: Wolf SSL lib generator
3 #Author: Mihrtec LLC
4 #Date: 2016
5 ##################################################
6 #Included from Makefile
7 #Defines rules for automatically downloading,
8 #compiling, and linking the wolfssl library
9 ##################################################
10
11 #wolfssl module compilation rules
12 WOLFDIR := $(MLSRCDIR)/wolfssl
13 WOLFSO := $(WOLFDIR)/src/.libs/libwolfssl.so
14 WOLFTARG := $(MLLIBDIR)/libwolfssl.so
15 CONFCL := --enable-singlethreaded=yes
16 CONFCL += --enable-static=yes
17 CONFCL += --enable-fastmath=no
18 CONFCL += --enable-cryptonly=yes
19 CONFCL += CFLAGS=-w
20 GITADDR := git@github.com:wolfSSL/wolfssl.git
21
22 #Remove the WOLFSO after compile since it is
23 #compiler-dependent, and we copy it to WOLFTARG
24 #which is a compiler-dependent location
25 .INTERMEDIATE: $(WOLFSO)
26
27 #WOLFTARG is the target file to generate for the
28 #missing library. It depends on WOLFSO, an
29 #intermediate file generated only when we need
30 #to copy it to WOLFTARG
31 $(WOLFTARG): $(WOLFSO)
32 @mkdir -p $(dir $(WOLFTARG))
33 @cp -H $(WOLFSO) $(WOLFTARG)
34 @echo "WolfSSL library created"
35
36 $(WOLFSO): $(WOLFDIR)
37 @cd $(WOLFDIR) && $(AMGEN) && $(AMCONF) $(CONFCL)
38 @sed -i 's@SIZEOF_LONG 0@SIZEOF_LONG 4@' $(WOLFDIR)/config.h
39 @sed -i 's@SIZEOF_LONG_LONG 0@SIZEOF_LONG_LONG 8@' $(WOLFDIR)/config.h
40 @cd $(WOLFDIR) && export CFLAGS=-w && $(AMMAKE) src/libwolfssl.la
41
42 $(WOLFDIR):
43 @mkdir -p $(WOLFDIR)
44 @git clone $(GITADDR) $(WOLFDIR)
45
46 clean_wolfssl:
47 cd $(WOLFDIR) && make clean