libwolfssl ported
[henge/webcc.git] / src / core / _rules.mk
1 #Core module compilation rules
2 APP_RULES += wolfssl
3 SCRUB_RULES += scrub_wolfssl
4
5 .PHONY: wolfssl scrub_wolfssl
6 wolfssl: ../extern/lib/libwolfssl.so
7 @echo "WolfSSL installed"
8
9 ../extern/lib/libwolfssl.so:
10 @echo "Downloading WolfSSL"
11 @mkdir -p tmp
12 @mkdir -p ../extern/include
13 @mkdir -p ../extern/lib
14 git clone git@github.com:wolfSSL/wolfssl.git tmp
15 @echo "Genearting WolfSSL Config" && cd tmp && emconfigure ./autogen.sh
16 @echo "Configuring WorlfSSL" && cd tmp && emconfigure ./configure --enable-singlethreaded=yes --enable-static=yes --enable-fastmath=no
17 sed -i 's/SIZEOF_LONG 0/SIZEOF_LONG 4/' tmp/config.h
18 sed -i 's/SIZEOF_LONG_LONG 0/SIZEOF_LONG_LONG 8/' tmp/config.h
19 cd tmp && emmake src/libwolfssl.la
20 cp -H tmp/src/.libs/libwolfssl.so ../extern/lib/libwolfssl.so
21 cp -r tmp/wolfssl ../extern/include
22 @rm -Rf tmp
23
24 scrub_wolfssl:
25 @echo "Scrubbing WolfSSL"
26 @rm -Rf ../extern/include/wolfssl
27 @rm -f ../extern/lib/libwolfssl.so