Fix build of allegro by ignoring failing allegro.aar target.
[fltk_mvc_template.git] / _template / packages / allegro5.2.4 / 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.2.4.0.tar.gz
15         find $(WORKDIR)/allegro-5.2.4.0 -name build.gradle -exec sed -i -e '/compileSdkVersion.*/a buildToolsVersion "24.0.0"' {} \;
16         find $(WORKDIR)/allegro-5.2.4.0 -name build.gradle -exec sed -i -e 's/compileSdkVersion.*/compileSdkVersion $(ANDROID_TARGET_VER)/g' {} \;
17         find $(WORKDIR)/allegro-5.2.4.0 -name build.gradle -exec sed -i -e 's/targetSdkVersion.*/targetSdkVersion $(ANDROID_TARGET_VER)/g' {} \;
18         sed -i -e 's/classpath "com.android.tools.build:gradle:.*/classpath "com.android.tools.build:gradle:debian"/g' $(WORKDIR)/allegro-5.2.4.0/android/gradle_project/build.gradle
19         sed -i -e '/google()/a maven { url "file:\/\/\/usr\/share\/maven-repo" }' $(WORKDIR)/allegro-5.2.4.0/android/gradle_project/build.gradle
20
21 .PHONY: android_arm
22 android_arm:
23         cd $(WORKDIR)/allegro-5.2.4.0; \
24         set -e; \
25         . $(WORKDIR)/setenv.sh && \
26         mkdir -p ./buildandroid; \
27         cd ./buildandroid; \
28         cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-android.cmake \
29         -DANDROID_NDK_TOOLCHAIN_ROOT=../android_toolchain -DWANT_ANDROID=on \
30         -DWANT_TTF=ON -DFREETYPE_INCLUDE_DIRS=$(WORKDIR)/../../lib_include/android_arm -DFREETYPE_LIBRARY=$(WORKDIR)/../../lib/android_arm/libfreetype.a \
31         -DCMAKE_BUILD_TYPE=Release -DANDROID_TARGET=android-$(ANDROID_TARGET_VER) -DARM_TARGETS=armeabi-v7a \
32         -DSHARED=true -DWANT_MONOLITH=ON -DWANT_EXAMPLES=false -DWANT_DEMO=false  -DWANT_TESTS=false; \
33         make -j6 -i
34         mkdir -p $(WORKDIR)/../../lib_include/android_arm
35         mkdir -p $(WORKDIR)/../../lib/android_arm
36         cp -rf $(WORKDIR)/allegro-5.2.4.0/android/gradle_project/allegro/src/main/java/org/* $(WORKDIR)/../../lib/android_arm
37         cp -rf $(WORKDIR)/allegro-5.2.4.0/buildandroid/include/* $(WORKDIR)/../../lib_include/android_arm
38         cp -rf $(WORKDIR)/allegro-5.2.4.0/include/* $(WORKDIR)/../../lib_include/android_arm
39         cp -rf $(WORKDIR)/allegro-5.2.4.0/addons/acodec/allegro5/* $(WORKDIR)/../../lib_include/android_arm/allegro5
40         cp -rf $(WORKDIR)/allegro-5.2.4.0/addons/audio/allegro5/* $(WORKDIR)/../../lib_include/android_arm/allegro5
41         cp -rf $(WORKDIR)/allegro-5.2.4.0/addons/color/allegro5/* $(WORKDIR)/../../lib_include/android_arm/allegro5
42         cp -rf $(WORKDIR)/allegro-5.2.4.0/addons/font/allegro5/* $(WORKDIR)/../../lib_include/android_arm/allegro5
43         cp -rf $(WORKDIR)/allegro-5.2.4.0/addons/image/allegro5/* $(WORKDIR)/../../lib_include/android_arm/allegro5
44         cp -rf $(WORKDIR)/allegro-5.2.4.0/addons/memfile/allegro5/* $(WORKDIR)/../../lib_include/android_arm/allegro5
45         cp -rf $(WORKDIR)/allegro-5.2.4.0/addons/primitives/allegro5/* $(WORKDIR)/../../lib_include/android_arm/allegro5
46         cp -rf $(WORKDIR)/allegro-5.2.4.0/addons/ttf/allegro5/* $(WORKDIR)/../../lib_include/android_arm/allegro5
47         rename "s/_monolith//g" $(WORKDIR)/allegro-5.2.4.0/buildandroid/lib/*.so
48         cp -rf $(WORKDIR)/allegro-5.2.4.0/buildandroid/lib/*.so $(WORKDIR)/../../lib/android_arm
49
50 .PHONY: clean
51 clean:
52         rm -rf allegro-5.2.4.0