Fix boost Makefile (build for right android architecture).
[fltk_mvc_template.git] / _template / packages / boost1.68.0 / Makefile
1 ############################################################################
2 # Workfile: Makefile
3 # Author: Daniel Giritzer, S1810567004 (daniel@giritzer.eu)
4 # Date: 03.12.2018
5 # Description: Universal Makefile for Unix based Operating Systems
6 ############################################################################
7 WORKDIR = $(shell pwd)
8
9 MODULES=--with-system --with-date_time --with-regex --with-thread
10
11 # Avaiable Modules
12 # atomic, chrono, container, context, contract, coroutine, date_time, exception, fiber, filesystem, graph, graph_parallel, iostreams, locale
13 # log, math, mpi, program_options, python, random, regex, serialization, signals, stacktrace, system, test, thread, timer, type_erasure, wave
14
15 # Add android ndk toolchain
16 ANDROID_NDK_HOME=/usr/lib/android-ndk
17 export PATH := $(ANDROID_NDK_HOME)/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/:$(PATH)
18
19 all: unpack linux32 linux_arm windows android_arm
20
21 unpack:
22         unzip -o boost_1_68_0.zip
23
24 windows:
25         echo "using gcc : mingw : i686-w64-mingw32-g++ : <rc>/usr/bin/x86_64-w64-mingw32-windres ;" > $(WORKDIR)/boost_1_68_0/user-config.jam
26         cd $(WORKDIR)/boost_1_68_0; \
27         ./bootstrap.sh; \
28         ./b2 --clean; \
29         ./b2 --user-config="user-config.jam" cflags="-m32 -mwindows" cxxflags="-m32 -mwindows" linkflags="-m32 -static-libgcc -static-libstdc++"  address-model=32 toolset=gcc-mingw link=static target-os=windows runtime-link=static variant=release $(MODULES)
30         mkdir -p $(WORKDIR)/../../lib_include/mingw32
31         mkdir -p $(WORKDIR)/../../lib/mingw32
32         cp -rf $(WORKDIR)/boost_1_68_0/boost $(WORKDIR)/../../lib_include/mingw32
33         cp -r  $(WORKDIR)/boost_1_68_0/stage/lib/* ../../lib/mingw32
34
35 linux32:
36         cd $(WORKDIR)/boost_1_68_0; \
37         ./bootstrap.sh; \
38         ./b2 --clean; \
39         ./b2 cflags="-m32" cxxflags="-m32" linkflags="-m32 -static-libgcc -static-libstdc++" address-model=32 link=static runtime-link=static variant=release $(MODULES)
40         mkdir -p $(WORKDIR)/../../lib_include/linux32
41         mkdir -p $(WORKDIR)/../../lib/linux32
42         cp -rf $(WORKDIR)/boost_1_68_0/boost $(WORKDIR)/../../lib_include/linux32
43         cp -r  $(WORKDIR)/boost_1_68_0/stage/lib/* ../../lib/linux32
44
45 linux_arm:
46         echo "using gcc : arm : arm-linux-gnueabihf-g++ ;" > $(WORKDIR)/boost_1_68_0/user-config.jam
47         cd $(WORKDIR)/boost_1_68_0; \
48         ./bootstrap.sh; \
49         ./b2 --clean; \
50         ./b2 --user-config="user-config.jam" linkflags="-static-libgcc -static-libstdc++" address-model=32 toolset=gcc-arm link=static runtime-link=static variant=release $(MODULES)
51         mkdir -p $(WORKDIR)/../../lib_include/linux_arm
52         mkdir -p $(WORKDIR)/../../lib/linux_arm
53         cp -rf $(WORKDIR)/boost_1_68_0/boost $(WORKDIR)/../../lib_include/linux_arm
54         cp -r  $(WORKDIR)/boost_1_68_0/stage/lib/* ../../lib/linux_arm
55
56 android_arm:
57         echo "using gcc : arm : arm-linux-androideabi-g++ ;" > $(WORKDIR)/boost_1_68_0/user-config.jam
58         cd $(WORKDIR)/boost_1_68_0; \
59         ./bootstrap.sh; \
60         ./b2 --clean; \
61         ./b2 --user-config="user-config.jam" cflags="--sysroot=$(ANDROID_NDK_HOME)/platforms/android-23/arch-arm -I$(ANDROID_NDK_HOME)/sources/cxx-stl/llvm-libc++/libcxx/include" \
62         cxxflags="-std=c++11 --sysroot=$(ANDROID_NDK_HOME)/platforms/android-23/arch-arm -I$(ANDROID_NDK_HOME)/sources/cxx-stl/llvm-libc++/libcxx/include -I$(ANDROID_NDK_HOME)/sources/android/support/include -march=armv7-a" \
63         linkflags="-std=c++11 --sysroot=$(ANDROID_NDK_HOME)/platforms/android-23/arch-arm -static-libgcc -static-libstdc++ -march=armv7-a" \
64         address-model=32 toolset=gcc-arm link=static runtime-link=static variant=release $(MODULES)
65         mkdir -p $(WORKDIR)/../../lib_include/android_arm
66         mkdir -p $(WORKDIR)/../../lib/android_arm
67         cp -rf $(WORKDIR)/boost_1_68_0/boost $(WORKDIR)/../../lib_include/android_arm
68         cp -r  $(WORKDIR)/boost_1_68_0/stage/lib/* ../../lib/android_arm
69
70 clean:
71         rm -rf $(WORKDIR)/boost_1_68_0