4a5f1ba89bbf447a88d7812b354d5d7a9e2a52e6
[fltk_mvc_template.git] / _template / packages / allegro5.1.13 / 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 ANDROID_TARGET_VER=23
9
10 all: unpack android_arm
11
12 .PHONY: unpack
13 unpack:
14         tar xvzf allegro-5.1.13.1.tar.gz
15         sed -i -e 's/if(NOT ANDROID_TOOL)/if(ANDROID_TOOL)/g' $(WORKDIR)/allegro-5.1.13.1/cmake/AndroidApp.cmake
16
17 .PHONY: android_arm
18 android_arm:
19         cd $(WORKDIR)/allegro-5.1.13.1; \
20         set -e; \
21         . $(WORKDIR)/setenv.sh $(ANDROID_TARGET_VER) ; \
22         mkdir -p ./buildandroid; \
23         cd ./buildandroid; \
24         cmake ..  -DANDROID_NDK_TOOLCHAIN_ROOT=../android_toolchain -DWANT_ANDROID=on \
25         -DWANT_TTF=ON -DFREETYPE_INCLUDE_DIRS=$(WORKDIR)/../../include/ -DFREETYPE_LIBRARY=$(WORKDIR)/../../lib/android_arm/libfreetype.a \
26         -DCMAKE_BUILD_TYPE=Release -DANDROID_TARGET=android-$(ANDROID_TARGET_VER) -DARM_TARGETS=armeabi-v7a \
27         -DSHARED=true -DWANT_MONOLITH=ON -DWANT_EXAMPLES=false -DWANT_DEMO=false  -DWANT_TESTS=false; \
28         make -j4 -i
29         mkdir -p $(WORKDIR)/../../include
30         mkdir -p $(WORKDIR)/../../lib/android_arm
31         mkdir -p $(WORKDIR)/../../lib/android_arm/liballeg
32         cp -rf $(WORKDIR)/allegro-5.1.13.1/include/* $(WORKDIR)/../../include
33         cp -rf $(WORKDIR)/allegro-5.1.13.1/android/allegro_activity/src/* $(WORKDIR)/../../lib/android_arm/liballeg
34         cp -rf $(WORKDIR)/allegro-5.1.13.1/buildandroid/include/* $(WORKDIR)/../../include
35         rename "s/_monolith//g" $(WORKDIR)/allegro-5.1.13.1/buildandroid/lib/*.so
36         cp -rf $(WORKDIR)/allegro-5.1.13.1/buildandroid/lib/*.so $(WORKDIR)/../../lib/android_arm
37
38 .PHONY: clean
39 clean:
40         rm -rf allegro-5.1.13.1