Added linux arm target for freetype.
[fltk_mvc_template.git] / _template / packages / libsndfile / Makefile
index 460fdb8..3ca7bdb 100644 (file)
@@ -6,7 +6,11 @@
 ############################################################################
 WORKDIR = $(shell pwd)
 
-all: unpack windows clean 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:
@@ -15,6 +19,7 @@ unpack:
 .PHONY: windows
 windows:
        cd $(WORKDIR)/libsndfile-1.0.28; \
+       make clean; \
        autoreconf -vfi; \
        ./configure CFLAGS="-m32 -mconsole" CXXFLAGS="-m32 -mconsole" LDFLAGS="-m32 -static-libgcc -static-libstdc++ -lpthread" --host=i686-w64-mingw32; \
        make -j4
@@ -24,9 +29,10 @@ windows:
        cp -rf $(WORKDIR)/libsndfile-1.0.28/src/.libs/libsndfile.a $(WORKDIR)/../../lib/mingw32
        cp -rf $(WORKDIR)/libsndfile-1.0.28/src/.libs/libcommon.a $(WORKDIR)/../../lib/mingw32
 
-.PHONY: linux
-linux:
+.PHONY: linux32
+linux32:
        cd $(WORKDIR)/libsndfile-1.0.28; \
+       make clean; \
        autoreconf -vfi; \
        ./configure CFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32 -static -static-libgcc -static-libstdc++"; \
        make -j4
@@ -36,7 +42,32 @@ linux:
        cp -rf $(WORKDIR)/libsndfile-1.0.28/src/.libs/libsndfile.a $(WORKDIR)/../../lib/linux32
        cp -rf $(WORKDIR)/libsndfile-1.0.28/src/.libs/libcommon.a $(WORKDIR)/../../lib/linux32
 
+.PHONY: linux_arm
+linux_arm:
+       cd $(WORKDIR)/libsndfile-1.0.28; \
+       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)/libsndfile-1.0.28/src/sndfile.h $(WORKDIR)/../../include
+       cp -rf $(WORKDIR)/libsndfile-1.0.28/src/.libs/libsndfile.a $(WORKDIR)/../../lib/linux_arm
+       cp -rf $(WORKDIR)/libsndfile-1.0.28/src/.libs/libcommon.a $(WORKDIR)/../../lib/linux_arm
+
+.PHONY: android_arm
+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; \
+       make -j4
+       mkdir -p $(WORKDIR)/../../include
+       mkdir -p $(WORKDIR)/../../lib/android_arm
+       cp -rf $(WORKDIR)/libsndfile-1.0.28/src/sndfile.h $(WORKDIR)/../../include
+       cp -rf $(WORKDIR)/libsndfile-1.0.28/src/.libs/libsndfile.a $(WORKDIR)/../../lib/android_arm
+       cp -rf $(WORKDIR)/libsndfile-1.0.28/src/.libs/libcommon.a $(WORKDIR)/../../lib/android_arm
+
 .PHONY: clean
 clean:
-       cd $(WORKDIR)/libsndfile-1.0.28; \
-       make clean
+       rm -rf $(WORKDIR)/libsndfile-1.0.28