Added linux arm target for freetype.
[fltk_mvc_template.git] / _template / packages / freetype2 / 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 # Add android ndk toolchain
10 export PATH := /usr/lib/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/:$(PATH)
11
12 all: unpack windows linux32 linux_arm android_arm
13
14 .PHONY: unpack
15 unpack:
16         tar xvzf freetype-2.9.1.tar.gz
17         cd $(WORKDIR)/freetype-2.9.1
18         
19 .PHONY: windows
20 windows:
21         cd $(WORKDIR)/freetype-2.9.1; \
22         make clean; \
23         ./configure CFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32 -static-libgcc -static-libstdc++" --host=i686-w64-mingw32 --disable-shared --enable-static --without-png --without-zlib --without-harfbuzz; \
24         make -j4
25         mkdir -p $(WORKDIR)/../../include/
26         mkdir -p $(WORKDIR)/../../lib/mingw32
27         cp -rf $(WORKDIR)/freetype-2.9.1/include $(WORKDIR)/../../include
28         cp -rf $(WORKDIR)/freetype-2.9.1/objs/.libs/libfreetype.a $(WORKDIR)/../../lib/mingw32
29
30 .PHONY: linux32
31 linux32:
32         cd $(WORKDIR)/freetype-2.9.1; \
33         make clean; \
34         ./configure CFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32 -static-libgcc -static-libstdc++" --disable-shared --enable-static --without-png --without-zlib --without-harfbuzz; \
35         make -j4
36         mkdir -p $(WORKDIR)/../../include
37         mkdir -p $(WORKDIR)/../../lib/linux32
38         cp -rf $(WORKDIR)/freetype-2.9.1/include/* $(WORKDIR)/../../include
39         cp -rf $(WORKDIR)/freetype-2.9.1/objs/.libs/libfreetype.a $(WORKDIR)/../../lib/linux32
40
41 .PHONY: linux_arm
42 linux_arm:
43         cd $(WORKDIR)/freetype-2.9.1; \
44         make clean; \
45         ./configure CFLAGS="" CXXFLAGS="" LDFLAGS="-static-libgcc -static-libstdc++" --host=arm-linux-gnueabihf  --disable-shared --enable-static --without-png --without-zlib --without-harfbuzz; \
46         make -i -j4
47         mkdir -p $(WORKDIR)/../../include
48         mkdir -p $(WORKDIR)/../../lib/linux_arm
49         cp -rf $(WORKDIR)/freetype-2.9.1/include/* $(WORKDIR)/../../include
50         cp -rf $(WORKDIR)/freetype-2.9.1/objs/.libs/libfreetype.a $(WORKDIR)/../../lib/linux_arm
51
52 .PHONY: android_arm
53 android_arm:
54         cd $(WORKDIR)/freetype-2.9.1; \
55         make clean; \
56         ./configure CFLAGS="--sysroot=/usr/lib/android-ndk/platforms/android-23/arch-arm" CXXFLAGS="--sysroot=/usr/lib/android-ndk/platforms/android-23/arch-arm" LDFLAGS="-static-libgcc -static-libstdc++ --sysroot=/usr/lib/android-ndk/platforms/android-23/arch-arm" --host=arm-linux-androideabi  --disable-shared --enable-static --without-png --without-zlib --without-harfbuzz; \
57         make -i -j4
58         mkdir -p $(WORKDIR)/../../include
59         mkdir -p $(WORKDIR)/../../lib/android_arm
60         cp -rf $(WORKDIR)/freetype-2.9.1/include/* $(WORKDIR)/../../include
61         cp -rf $(WORKDIR)/freetype-2.9.1/objs/.libs/libfreetype.a $(WORKDIR)/../../lib/android_arm
62
63 .PHONY: clean
64 clean:
65         cd $(WORKDIR)/freetype-2.9.1; \
66         make clean