460fdb83476fcbf5a0cbf5eaf74a17409b653e87
[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 all: unpack windows clean linux
10
11 .PHONY: unpack
12 unpack:
13         tar xvzf libsndfile-1.0.28.tar.gz
14
15 .PHONY: windows
16 windows:
17         cd $(WORKDIR)/libsndfile-1.0.28; \
18         autoreconf -vfi; \
19         ./configure CFLAGS="-m32 -mconsole" CXXFLAGS="-m32 -mconsole" LDFLAGS="-m32 -static-libgcc -static-libstdc++ -lpthread" --host=i686-w64-mingw32; \
20         make -j4
21         mkdir -p $(WORKDIR)/../../include
22         mkdir -p $(WORKDIR)/../../lib/mingw32
23         cp -rf $(WORKDIR)/libsndfile-1.0.28/src/sndfile.h $(WORKDIR)/../../include
24         cp -rf $(WORKDIR)/libsndfile-1.0.28/src/.libs/libsndfile.a $(WORKDIR)/../../lib/mingw32
25         cp -rf $(WORKDIR)/libsndfile-1.0.28/src/.libs/libcommon.a $(WORKDIR)/../../lib/mingw32
26
27 .PHONY: linux
28 linux:
29         cd $(WORKDIR)/libsndfile-1.0.28; \
30         autoreconf -vfi; \
31         ./configure CFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32 -static -static-libgcc -static-libstdc++"; \
32         make -j4
33         mkdir -p $(WORKDIR)/../../include
34         mkdir -p $(WORKDIR)/../../lib/linux32
35         cp -rf $(WORKDIR)/libsndfile-1.0.28/src/sndfile.h $(WORKDIR)/../../include
36         cp -rf $(WORKDIR)/libsndfile-1.0.28/src/.libs/libsndfile.a $(WORKDIR)/../../lib/linux32
37         cp -rf $(WORKDIR)/libsndfile-1.0.28/src/.libs/libcommon.a $(WORKDIR)/../../lib/linux32
38
39 .PHONY: clean
40 clean:
41         cd $(WORKDIR)/libsndfile-1.0.28; \
42         make clean