Added version number to package folder (allow different versions of a package)
[fltk_mvc_template.git] / _template / packages / tinyxml2 / 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 ANDROID_NDK_HOME=/usr/lib/android-ndk
11 export PATH := $(ANDROID_NDK_HOME)/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/:$(PATH)
12
13 all: unpack windows linux32 linux_arm android_arm
14
15 .PHONY: unpack
16 unpack:
17         unzip -o  tinyxml-2.src.zip
18
19 .PHONY: windows
20 windows:
21         cd $(WORKDIR)/tinyxml2-master; \
22         i686-w64-mingw32-g++ -c -o tinyxml2.o tinyxml2.cpp; \
23         i686-w64-mingw32-ar rvs libtinyxml2.a tinyxml2.o
24         mkdir -p $(WORKDIR)/../../include
25         mkdir -p $(WORKDIR)/../../lib/mingw32
26         cp -rf $(WORKDIR)/tinyxml2-master/libtinyxml2.a $(WORKDIR)/../../lib/mingw32
27         cp -rf $(WORKDIR)/tinyxml2-master/tinyxml2.h $(WORKDIR)/../../include
28
29 .PHONY: linux32
30 linux32:
31         cd $(WORKDIR)/tinyxml2-master; \
32         g++ -m32 -c -o tinyxml2.o tinyxml2.cpp; \
33         ar rvs libtinyxml2.a tinyxml2.o
34         mkdir -p $(WORKDIR)/../../include
35         mkdir -p $(WORKDIR)/../../lib/linux32
36         cp -rf $(WORKDIR)/tinyxml2-master/libtinyxml2.a $(WORKDIR)/../../lib/linux32
37         cp -rf $(WORKDIR)/tinyxml2-master/tinyxml2.h $(WORKDIR)/../../include
38
39 .PHONY: linux_arm
40 linux_arm:
41         cd $(WORKDIR)/tinyxml2-master; \
42         arm-linux-gnueabihf-g++ -c -o tinyxml2.o tinyxml2.cpp; \
43         arm-linux-gnueabihf-ar rvs libtinyxml2.a tinyxml2.o
44         mkdir -p $(WORKDIR)/../../include
45         mkdir -p $(WORKDIR)/../../lib/linux_arm
46         cp -rf $(WORKDIR)/tinyxml2-master/libtinyxml2.a $(WORKDIR)/../../lib/linux_arm
47         cp -rf $(WORKDIR)/tinyxml2-master/tinyxml2.h $(WORKDIR)/../../include
48
49 .PHONY: android_arm
50 android_arm:
51         cd $(WORKDIR)/tinyxml2-master; \
52         arm-linux-androideabi-g++ --sysroot=$(ANDROID_NDK_HOME)/platforms/android-23/arch-arm -I$(ANDROID_NDK_HOME)/sources/cxx-stl/llvm-libc++/libcxx/include -c -o tinyxml2.o tinyxml2.cpp; \
53         arm-linux-androideabi-ar rvs libtinyxml2.a tinyxml2.o
54         mkdir -p $(WORKDIR)/../../include
55         mkdir -p $(WORKDIR)/../../lib/android_arm
56         cp -rf $(WORKDIR)/tinyxml2-master/libtinyxml2.a $(WORKDIR)/../../lib/android_arm
57         cp -rf $(WORKDIR)/tinyxml2-master/tinyxml2.h $(WORKDIR)/../../include
58
59 .PHONY: clean
60 clean:
61         rm -rf $(WORKDIR)/tinyxml2-master