Added android/linux arm targets for gtest and libsndfile (android not working on...
authorDaniel G <giri@nwrk.biz>
Wed, 30 Jan 2019 01:49:12 +0000 (02:49 +0100)
committerDaniel G <giri@nwrk.biz>
Wed, 30 Jan 2019 01:49:12 +0000 (02:49 +0100)
_template/packages/googletest/Makefile
_template/packages/libsndfile/Makefile

index 6878b7c..506115d 100644 (file)
@@ -6,13 +6,20 @@
 ############################################################################
 WORKDIR = $(shell pwd)
 
-all: unpack linux clean windows
+# 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
+
+.PHONY: unpack
 unpack:
        unzip -o googletest-release-1.8.1.zip
 
-windows: unpack
+.PHONY: windows
+windows:
        cd $(WORKDIR)/googletest-release-1.8.1; \
+       make clean; \
        autoreconf -vfi; \
        ./configure CFLAGS="-m32 -mwindows" CXXFLAGS="-m32 -mwindows" LDFLAGS="-m32 -static-libgcc -static-libstdc++" --host=i686-w64-mingw32 --disable-pthreads --with-pthreads=no; \
        make -j4
@@ -23,8 +30,10 @@ windows: unpack
        cp $(WORKDIR)/googletest-release-1.8.1/googletest/lib/.libs/libgtest.a $(WORKDIR)/../../lib/mingw32
        cp $(WORKDIR)/googletest-release-1.8.1/googlemock/lib/.libs/libgmock.a $(WORKDIR)/../../lib/mingw32
 
-linux: unpack
+.PHONY: linux32
+linux32:
        cd $(WORKDIR)/googletest-release-1.8.1; \
+       make clean; \
        autoreconf -vfi; \
        ./configure CFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32 -static-libgcc -static-libstdc++"; \
        make -j4
@@ -35,6 +44,37 @@ linux: unpack
        cp $(WORKDIR)/googletest-release-1.8.1/googletest/lib/.libs/libgtest.a $(WORKDIR)/../../lib/linux32
        cp $(WORKDIR)/googletest-release-1.8.1/googlemock/lib/.libs/libgmock.a $(WORKDIR)/../../lib/linux32
 
-clean:
+.PHONY: linux_arm
+linux_arm:
+       cd $(WORKDIR)/googletest-release-1.8.1; \
+       make clean; \
+       autoreconf -vfi; \
+       ./configure CFLAGS="" CXXFLAGS="" LDFLAGS="-static-libgcc -static-libstdc++" --host=arm-linux-gnueabihf; \
+       make -j4
+       mkdir -p $(WORKDIR)/../../include
+       mkdir -p $(WORKDIR)/../../lib/linux_arm
+       cp -rf $(WORKDIR)/googletest-release-1.8.1/googletest/include/gtest $(WORKDIR)/../../include
+       cp -rf $(WORKDIR)/googletest-release-1.8.1/googlemock/include/gmock $(WORKDIR)/../../include
+       cp $(WORKDIR)/googletest-release-1.8.1/googletest/lib/.libs/libgtest.a $(WORKDIR)/../../lib/linux_arm
+       cp $(WORKDIR)/googletest-release-1.8.1/googlemock/lib/.libs/libgmock.a $(WORKDIR)/../../lib/linux_arm
+
+## not working...
+.PHONY: android_arm
+android_arm:
        cd $(WORKDIR)/googletest-release-1.8.1; \
-       make clean
+       make clean; \
+       autoreconf -vfi; \
+       ./configure --host=arm-linux-androideabi CFLAGS="--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 -I$(ANDROID_NDK_HOME)/sources/cxx-stl/llvm-libc++abi/libcxxabi/include" LDFLAGS="--sysroot=$(ANDROID_NDK_HOME)/platforms/android-23/arch-arm -static-libgcc -static-libstdc++"; \
+       make -j4
+       mkdir -p $(WORKDIR)/../../include
+       mkdir -p $(WORKDIR)/../../lib/android_arm
+       cp -rf $(WORKDIR)/googletest-release-1.8.1/googletest/include/gtest $(WORKDIR)/../../include
+       cp -rf $(WORKDIR)/googletest-release-1.8.1/googlemock/include/gmock $(WORKDIR)/../../include
+       cp $(WORKDIR)/googletest-release-1.8.1/googletest/lib/.libs/libgtest.a $(WORKDIR)/../../lib/android_arm
+       cp $(WORKDIR)/googletest-release-1.8.1/googlemock/lib/.libs/libgmock.a $(WORKDIR)/../../lib/android_arm
+
+
+.PHONY: clean
+clean:
+       rm -rf $(WORKDIR)/googletest-release-1.8.1
+
index 3ca7bdb..c721de0 100644 (file)
@@ -10,7 +10,7 @@ WORKDIR = $(shell pwd)
 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
+all: unpack windows linux32 linux_arm
 
 .PHONY: unpack
 unpack:
@@ -60,7 +60,7 @@ android_arm:
        cd $(WORKDIR)/libsndfile-1.0.28; \
        make clean; \
        autoreconf -vfi; \
-       ./configure CFLAGS="" CXXFLAGS="--sysroot=$(ANDROID_NDK_HOME)/platforms/android-23/arch-arm -I$(ANDROID_NDK_HOME)/sources/cxx-stl/llvm-libc++/libcxx/include" LDFLAGS="-static-libgcc -static-libstdc++" --host=arm-linux-androideabi; \
+       ./configure CFLAGS="" CXXFLAGS="--sysroot=$(ANDROID_NDK_HOME)/platforms/android-23/arch-arm -I$(ANDROID_NDK_HOME)/sources/cxx-stl/llvm-libc++/libcxx/include" LDFLAGS="--sysroot=$(ANDROID_NDK_HOME)/platforms/android-23/arch-arm -static-libgcc -static-libstdc++" --host=arm-linux-gnueabihf; \
        make -j4
        mkdir -p $(WORKDIR)/../../include
        mkdir -p $(WORKDIR)/../../lib/android_arm