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