TinyXML -> all targets.
authorDaniel G <giri@nwrk.biz>
Tue, 29 Jan 2019 21:33:18 +0000 (22:33 +0100)
committerDaniel G <giri@nwrk.biz>
Tue, 29 Jan 2019 21:33:18 +0000 (22:33 +0100)
_template/packages/tinyxml/Makefile

index d63cbc6..25bb77e 100644 (file)
@@ -6,7 +6,11 @@
 ############################################################################
 WORKDIR = $(shell pwd)
 
-all: unpack windows linux
+# Add android ndk toolchain
+ANDROID_NDK_HOME=/usr/lib/android-ndk
+export PATH := $(ANDROID_NDK_HOME)/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/:$(PATH)
+
+all: unpack windows linux32 linux_arm android_arm
 
 .PHONY: unpack
 unpack:
@@ -22,8 +26,8 @@ windows:
        cp -rf $(WORKDIR)/tinyxml2-master/libtinyxml2.a $(WORKDIR)/../../lib/mingw32
        cp -rf $(WORKDIR)/tinyxml2-master/tinyxml2.h $(WORKDIR)/../../include
 
-.PHONY: linux
-linux:
+.PHONY: linux32
+linux32:
        cd $(WORKDIR)/tinyxml2-master; \
        g++ -m32 -c -o tinyxml2.o tinyxml2.cpp; \
        ar rvs libtinyxml2.a tinyxml2.o
@@ -32,6 +36,26 @@ linux:
        cp -rf $(WORKDIR)/tinyxml2-master/libtinyxml2.a $(WORKDIR)/../../lib/linux32
        cp -rf $(WORKDIR)/tinyxml2-master/tinyxml2.h $(WORKDIR)/../../include
 
+.PHONY: linux_arm
+linux_arm:
+       cd $(WORKDIR)/tinyxml2-master; \
+       arm-linux-gnueabihf-g++ -c -o tinyxml2.o tinyxml2.cpp; \
+       arm-linux-gnueabihf-ar rvs libtinyxml2.a tinyxml2.o
+       mkdir -p $(WORKDIR)/../../include
+       mkdir -p $(WORKDIR)/../../lib/linux_arm
+       cp -rf $(WORKDIR)/tinyxml2-master/libtinyxml2.a $(WORKDIR)/../../lib/linux_arm
+       cp -rf $(WORKDIR)/tinyxml2-master/tinyxml2.h $(WORKDIR)/../../include
+
+.PHONY: android_arm
+android_arm:
+       cd $(WORKDIR)/tinyxml2-master; \
+       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; \
+       arm-linux-androideabi-ar rvs libtinyxml2.a tinyxml2.o
+       mkdir -p $(WORKDIR)/../../include
+       mkdir -p $(WORKDIR)/../../lib/android_arm
+       cp -rf $(WORKDIR)/tinyxml2-master/libtinyxml2.a $(WORKDIR)/../../lib/android_arm
+       cp -rf $(WORKDIR)/tinyxml2-master/tinyxml2.h $(WORKDIR)/../../include
+
 .PHONY: clean
 clean:
        rm -rf $(WORKDIR)/tinyxml2-master