c721de0576af7d8bda4e8e2abaf0c91fdb4ff755
[fltk_mvc_template.git] / _template / packages / libsndfile / 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
14
15 .PHONY: unpack
16 unpack:
17         tar xvzf libsndfile-1.0.28.tar.gz
18
19 .PHONY: windows
20 windows:
21         cd $(WORKDIR)/libsndfile-1.0.28; \
22         make clean; \
23         autoreconf -vfi; \
24         ./configure CFLAGS="-m32 -mconsole" CXXFLAGS="-m32 -mconsole" LDFLAGS="-m32 -static-libgcc -static-libstdc++ -lpthread" --host=i686-w64-mingw32; \
25         make -j4
26         mkdir -p $(WORKDIR)/../../include
27         mkdir -p $(WORKDIR)/../../lib/mingw32
28         cp -rf $(WORKDIR)/libsndfile-1.0.28/src/sndfile.h $(WORKDIR)/../../include
29         cp -rf $(WORKDIR)/libsndfile-1.0.28/src/.libs/libsndfile.a $(WORKDIR)/../../lib/mingw32
30         cp -rf $(WORKDIR)/libsndfile-1.0.28/src/.libs/libcommon.a $(WORKDIR)/../../lib/mingw32
31
32 .PHONY: linux32
33 linux32:
34         cd $(WORKDIR)/libsndfile-1.0.28; \
35         make clean; \
36         autoreconf -vfi; \
37         ./configure CFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32 -static -static-libgcc -static-libstdc++"; \
38         make -j4
39         mkdir -p $(WORKDIR)/../../include
40         mkdir -p $(WORKDIR)/../../lib/linux32
41         cp -rf $(WORKDIR)/libsndfile-1.0.28/src/sndfile.h $(WORKDIR)/../../include
42         cp -rf $(WORKDIR)/libsndfile-1.0.28/src/.libs/libsndfile.a $(WORKDIR)/../../lib/linux32
43         cp -rf $(WORKDIR)/libsndfile-1.0.28/src/.libs/libcommon.a $(WORKDIR)/../../lib/linux32
44
45 .PHONY: linux_arm
46 linux_arm:
47         cd $(WORKDIR)/libsndfile-1.0.28; \
48         make clean; \
49         autoreconf -vfi; \
50         ./configure CFLAGS="" CXXFLAGS="" LDFLAGS="-static-libgcc -static-libstdc++" --host=arm-linux-gnueabihf; \
51         make -j4
52         mkdir -p $(WORKDIR)/../../include
53         mkdir -p $(WORKDIR)/../../lib/linux_arm
54         cp -rf $(WORKDIR)/libsndfile-1.0.28/src/sndfile.h $(WORKDIR)/../../include
55         cp -rf $(WORKDIR)/libsndfile-1.0.28/src/.libs/libsndfile.a $(WORKDIR)/../../lib/linux_arm
56         cp -rf $(WORKDIR)/libsndfile-1.0.28/src/.libs/libcommon.a $(WORKDIR)/../../lib/linux_arm
57
58 .PHONY: android_arm
59 android_arm:
60         cd $(WORKDIR)/libsndfile-1.0.28; \
61         make clean; \
62         autoreconf -vfi; \
63         ./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; \
64         make -j4
65         mkdir -p $(WORKDIR)/../../include
66         mkdir -p $(WORKDIR)/../../lib/android_arm
67         cp -rf $(WORKDIR)/libsndfile-1.0.28/src/sndfile.h $(WORKDIR)/../../include
68         cp -rf $(WORKDIR)/libsndfile-1.0.28/src/.libs/libsndfile.a $(WORKDIR)/../../lib/android_arm
69         cp -rf $(WORKDIR)/libsndfile-1.0.28/src/.libs/libcommon.a $(WORKDIR)/../../lib/android_arm
70
71 .PHONY: clean
72 clean:
73         rm -rf $(WORKDIR)/libsndfile-1.0.28