Add gl4es to prepare adding basic opengl support for android. Add zoom to SDL android.
[fltk_mvc_template.git] / _template / packages / gl4es1.1.0 / 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 # Add android ndk toolchain
10 ANDROID_NDK_HOME=/usr/lib/android-ndk
11 export PATH := $(ANDROID_NDK_HOME)/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/:$(PATH)
12
13 all: unpack android_arm
14
15 .PHONY: unpack
16 unpack:
17         unzip -o gl4es-1.1.0.zip
18
19 .PHONY: android_arm
20 android_arm:
21         export NDK_PROJECT_PATH=$(WORKDIR); \
22         cp -r $(WORKDIR)/gl4es-1.1.0 $(WORKDIR)/jni; \
23         sed -i -e 's~-DNOX11~-I$(WORKDIR)/../../lib_include/android_arm~g' $(WORKDIR)/jni/Android.mk; \
24 #       sed -i -e 's/BUILD_STATIC_LIBRARY/BUILD_SHARED_LIBRARY/g' $(WORKDIR)/jni/Android.mk; \
25         sed -i -e 's/#LOCAL_CFLAGS += -DDEFAULT_ES=2/LOCAL_CFLAGS += -DDEFAULT_ES=2/g' $(WORKDIR)/jni/Android.mk; \
26 #       sed -i -e 's/#LOCAL_CFLAGS += -DNO_INIT_CONSTRUCTOR/LOCAL_CFLAGS += -DNO_INIT_CONSTRUCTOR/g' $(WORKDIR)/jni/Android.mk; \
27         sed -i -e '/src\/glx\/streaming.c.*/ a  src\/glx\/rpi.c src\/glx\/utils.c' $(WORKDIR)/jni/Android.mk; \
28         echo "APP_ABI := armeabi-v7a"> $(WORKDIR)/jni/Application.mk; \
29         /usr/lib/android-ndk/ndk-build
30         mkdir -p $(WORKDIR)/../../lib_include/android_arm
31         mkdir -p $(WORKDIR)/../../lib/android_arm
32         cp -rf $(WORKDIR)/gl4es-1.1.0/include/* $(WORKDIR)/../../lib_include/android_arm
33         cp $(WORKDIR)/obj/local/armeabi-v7a/libGL.a $(WORKDIR)/../../lib/android_arm
34
35 .PHONY: clean
36 clean:
37         rm -rf $(WORKDIR)/gl4es-1.1.0
38         rm -rf $(WORKDIR)/jni
39         rm -rf $(WORKDIR)/obj
40