Handle some stuff a little bit neater. (i.e. setting android target version)
authorDaniel G <giri@nwrk.biz>
Wed, 30 Jan 2019 19:46:14 +0000 (20:46 +0100)
committerDaniel G <giri@nwrk.biz>
Wed, 30 Jan 2019 19:46:14 +0000 (20:46 +0100)
_template/packages/allegro5.1.13/Makefile
_template/packages/allegro5.1.13/setenv.sh
_template/packages/nanox/Makefile
_template/src/Makefile
_template/src/android-src/AndroidManifest.xml

index 7033d10..e334334 100644 (file)
@@ -5,6 +5,7 @@
 # Description: Universal Makefile for Unix based Operating Systems
 ############################################################################
 WORKDIR = $(shell pwd)
 # Description: Universal Makefile for Unix based Operating Systems
 ############################################################################
 WORKDIR = $(shell pwd)
+ANDROID_TARGET_VER=23
 
 all: unpack android_arm
 
 
 all: unpack android_arm
 
@@ -17,18 +18,18 @@ unpack:
 android_arm:
        cd $(WORKDIR)/allegro-5.1.13.1; \
        set -e; \
 android_arm:
        cd $(WORKDIR)/allegro-5.1.13.1; \
        set -e; \
-       . $(WORKDIR)/setenv.sh && \
+       . $(WORKDIR)/setenv.sh $(ANDROID_TARGET_VER) ; \
        mkdir -p ./buildandroid; \
        cd ./buildandroid; \
        mkdir -p ./buildandroid; \
        cd ./buildandroid; \
-       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; \
-       make -j4 -i 
+       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; \
+       make -j4 -i
        mkdir -p $(WORKDIR)/../../include
        mkdir -p $(WORKDIR)/../../lib/android_arm
        mkdir -p $(WORKDIR)/../../lib/android_arm/liballeg
        cp -rf $(WORKDIR)/allegro-5.1.13.1/include/* $(WORKDIR)/../../include
        cp -rf $(WORKDIR)/allegro-5.1.13.1/android/allegro_activity/src/* $(WORKDIR)/../../lib/android_arm/liballeg
        cp -rf $(WORKDIR)/allegro-5.1.13.1/buildandroid/include/* $(WORKDIR)/../../include
        mkdir -p $(WORKDIR)/../../include
        mkdir -p $(WORKDIR)/../../lib/android_arm
        mkdir -p $(WORKDIR)/../../lib/android_arm/liballeg
        cp -rf $(WORKDIR)/allegro-5.1.13.1/include/* $(WORKDIR)/../../include
        cp -rf $(WORKDIR)/allegro-5.1.13.1/android/allegro_activity/src/* $(WORKDIR)/../../lib/android_arm/liballeg
        cp -rf $(WORKDIR)/allegro-5.1.13.1/buildandroid/include/* $(WORKDIR)/../../include
-       rename "s/_monolith//g" $(WORKDIR)/allegro-5.1.13.1/buildandroid/lib/*.so
+       rename "s/_monolith-debug//g" $(WORKDIR)/allegro-5.1.13.1/buildandroid/lib/*.so
        cp -rf $(WORKDIR)/allegro-5.1.13.1/buildandroid/lib/*.so $(WORKDIR)/../../lib/android_arm
 
 .PHONY: clean
        cp -rf $(WORKDIR)/allegro-5.1.13.1/buildandroid/lib/*.so $(WORKDIR)/../../lib/android_arm
 
 .PHONY: clean
index 1eddb46..f309eca 100755 (executable)
@@ -1,3 +1,4 @@
+#!/bin/sh
 WORKDIR=$(pwd)
 #git clone https://github.com/mherod/android-sdk-licenses.git
 #sudo cp -a $WORKDIR/android-sdk-licenses/*-license /usr/lib/android-sdk/licenses
 WORKDIR=$(pwd)
 #git clone https://github.com/mherod/android-sdk-licenses.git
 #sudo cp -a $WORKDIR/android-sdk-licenses/*-license /usr/lib/android-sdk/licenses
index 7983c1d..d68b5cb 100644 (file)
@@ -5,8 +5,8 @@
 # Description: Universal Makefile for Unix based Operating Systems
 ############################################################################
 WORKDIR = $(shell pwd)
 # Description: Universal Makefile for Unix based Operating Systems
 ############################################################################
 WORKDIR = $(shell pwd)
+ANDROID_TARGET_VER=23
 
 
-# compiler flags
 
 all: unpack android_arm
 
 
 all: unpack android_arm
 
@@ -33,8 +33,8 @@ android_arm:
        cp $(WORKDIR)/config_android_arm $(WORKDIR)/microwindows-master/src/config
        export PATH=/usr/lib/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/:${PATH}; \
        cd $(WORKDIR)/microwindows-master/src/; \
        cp $(WORKDIR)/config_android_arm $(WORKDIR)/microwindows-master/src/config
        export PATH=/usr/lib/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/:${PATH}; \
        cd $(WORKDIR)/microwindows-master/src/; \
-       sed -i -e 's/CFLAGS=.*/CFLAGS=--sysroot=\/usr\/lib\/android-ndk\/platforms\/android-23\/arch-arm\/ -I..\/..\/..\/..\/..\/include/g' ./Makefile.rules; \
-       sed -i -e 's/LDFLAGS=.*/LDFLAGS=--sysroot=\/usr\/lib\/android-ndk\/platforms\/android-23\/arch-arm\//g' ./Makefile.rules; \
+       sed -i -e 's/CFLAGS=.*/CFLAGS=--sysroot=\/usr\/lib\/android-ndk\/platforms\/android-$(ANDROID_TARGET_VER)\/arch-arm\/ -I..\/..\/..\/..\/..\/include/g' ./Makefile.rules; \
+       sed -i -e 's/LDFLAGS=.*/LDFLAGS=--sysroot=\/usr\/lib\/android-ndk\/platforms\/android-$(ANDROID_TARGET_VER)\/arch-arm\//g' ./Makefile.rules; \
        make -j4
        mkdir -p $(WORKDIR)/../../lib/android_arm
        mkdir -p $(WORKDIR)/../../include/nanox
        make -j4
        mkdir -p $(WORKDIR)/../../lib/android_arm
        mkdir -p $(WORKDIR)/../../include/nanox
index a70a64a..60886fb 100644 (file)
@@ -44,7 +44,7 @@ WINDRES_LINUXARM =
 
 INC_LINUXARM = $(INC)
 LIBDIR_LINUXARM = -L$(WORKDIR)/../lib/linux_arm
 
 INC_LINUXARM = $(INC)
 LIBDIR_LINUXARM = -L$(WORKDIR)/../lib/linux_arm
-CFLAGS_LINUXARM = $(CFLAGS) -fPIC
+CFLAGS_LINUXARM = $(CFLAGS)
 RESINC_LINUXARM =
 LDFLAGS_LINUXARM = $(LDFLAGS)
 LIB_LINUXARM = $(LIB) -lm -Wl,-Bdynamic -lX11 -lxcb -lXau -lXdmcp -lpthread -lrt -ldl
 RESINC_LINUXARM =
 LDFLAGS_LINUXARM = $(LDFLAGS)
 LIB_LINUXARM = $(LIB) -lm -Wl,-Bdynamic -lX11 -lxcb -lXau -lXdmcp -lpthread -lrt -ldl
@@ -428,7 +428,7 @@ before_android_apk:
        test -d $(CLASSDIR_ANDROID) || mkdir -p $(CLASSDIR_ANDROID)
        test -d $(ANDROID_SRC)/res/mipmap-hdpi || mkdir -p $(ANDROID_SRC)/res/mipmap-hdpi
        test -d $(ANDROID_SRC)/java/liballeg || mkdir -p $(ANDROID_SRC)/java/liballeg
        test -d $(CLASSDIR_ANDROID) || mkdir -p $(CLASSDIR_ANDROID)
        test -d $(ANDROID_SRC)/res/mipmap-hdpi || mkdir -p $(ANDROID_SRC)/res/mipmap-hdpi
        test -d $(ANDROID_SRC)/java/liballeg || mkdir -p $(ANDROID_SRC)/java/liballeg
-       cp $(WORKDIR)/../lib/android_arm/liballeg/* $(ANDROID_SRC)/java/liballeg
+       cp -r $(WORKDIR)/../lib/android_arm/liballeg/* $(ANDROID_SRC)/java/liballeg
        cp $(WORKDIR)/../lib/android_arm/liballegro.so $(ANDROID_SRC)/lib/$(ANDROID_ARCH_VER)/
        cp $(WORKDIR)/Icon.png $(ANDROID_SRC)/res/mipmap-hdpi/ic_launcher.png
        $(AAPT) package -f -m -J $(GENDIR_ANDROID) -M $(ANDROID_SRC)/AndroidManifest.xml -S $(ANDROID_SRC)/res -I $(ANDROID_CP)
        cp $(WORKDIR)/../lib/android_arm/liballegro.so $(ANDROID_SRC)/lib/$(ANDROID_ARCH_VER)/
        cp $(WORKDIR)/Icon.png $(ANDROID_SRC)/res/mipmap-hdpi/ic_launcher.png
        $(AAPT) package -f -m -J $(GENDIR_ANDROID) -M $(ANDROID_SRC)/AndroidManifest.xml -S $(ANDROID_SRC)/res -I $(ANDROID_CP)
index 2f90663..e766b91 100644 (file)
@@ -4,8 +4,10 @@
       android:versionCode="1"
       android:versionName="1.1">
   <uses-sdk android:minSdkVersion="22"/>
       android:versionCode="1"
       android:versionName="1.1">
   <uses-sdk android:minSdkVersion="22"/>
+  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
   <application
   <application
-      android:label="@string/app_name">
+      android:label="@string/app_name"
+      android:debuggable="false">
     <activity
         android:name=".MainActivity"
         android:icon="@mipmap/ic_launcher"
     <activity
         android:name=".MainActivity"
         android:icon="@mipmap/ic_launcher"