Handle some stuff a little bit neater. (i.e. setting android target version)
[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 -DCMAKE_BUILD_TYPE=Release -DANDROID_TARGET=android-$(ANDROID_TARGET_VER) -DARM_TARGETS=armeabi-v7a -DSHARED=true -DWANT_MONOLITH=ON -DWANT_EXAMPLES=false -DWANT_DEMO=false  -DWANT_TESTS=false; \
25         make -j4 -i
26         mkdir -p $(WORKDIR)/../../include
27         mkdir -p $(WORKDIR)/../../lib/android_arm
28         mkdir -p $(WORKDIR)/../../lib/android_arm/liballeg
29         cp -rf $(WORKDIR)/allegro-5.1.13.1/include/* $(WORKDIR)/../../include
30         cp -rf $(WORKDIR)/allegro-5.1.13.1/android/allegro_activity/src/* $(WORKDIR)/../../lib/android_arm/liballeg
31         cp -rf $(WORKDIR)/allegro-5.1.13.1/buildandroid/include/* $(WORKDIR)/../../include
32         rename "s/_monolith-debug//g" $(WORKDIR)/allegro-5.1.13.1/buildandroid/lib/*.so
33         cp -rf $(WORKDIR)/allegro-5.1.13.1/buildandroid/lib/*.so $(WORKDIR)/../../lib/android_arm
34
35 .PHONY: clean
36 clean:
37         rm -rf allegro-5.1.13.1