Skip to content

Commit

Permalink
Modified makefile to accept the new structure of android
Browse files Browse the repository at this point in the history
As well to compile in arm64 -> aarch64 architecture of the
new android devices
  • Loading branch information
vlachoudis committed Aug 14, 2018
1 parent dcf4485 commit be34fb5
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 21 deletions.
38 changes: 25 additions & 13 deletions make.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,26 @@
INCDIR = ../inc
LIBDIR = ../lstring

# Android paths
ANDNDK = /opt/android-sdk/ndk-bundle
#ANDOS = 8
ANDOS = 19
ANDVER = 4.9
ANDARCH = arm
###############
# Android
#
# Create first a standalone toolchain, since with the new ndk
# the sysroot is no longer working from the default directory
# https://developer.android.com/ndk/guides/standalone_toolchain
# http://zwyuan.github.io/2015/12/22/three-ways-to-use-android-ndk-cross-compiler/
###############
ANDNDK = /opt/android-ndk
ANDOS = 24
#ANDARCH = arm
ANDARCH = aarch64
#ANDBIT = linux-x86
ANDBIT = linux-x86_64
ANDBIN := $(ANDNDK)/toolchains/${ANDARCH}-linux-androideabi-${ANDVER}/prebuilt/${ANDBIT}/bin
ANDROOT := $(ANDNDK)/platforms/android-${ANDOS}/arch-${ANDARCH}
ANDARM := $(ANDBIN)/${ANDARCH}-linux-androideabi
#ANDBIT = linux-x86_64
ANDBIT := linux-${shell uname -p}
#ANDBIN := $(ANDNDK)/toolchains/${ANDARCH}-linux-androideabi-${ANDVER}/prebuilt/$(ANDBIT)/bin
#ANDROOT := $(ANDNDK)/platforms/android-${ANDOS}/arch-$(ANDARCH)
#ANDARM := $(ANDBIN)/${ANDARCH}-linux-androideabi
#ANDARM := $(ANDNDK)/android-$(ANDOS)/bin/${ANDARCH}-linux-androideabi
ANDARM := $(ANDNDK)/android-$(ANDOS)/bin/${ANDARCH}-linux-android
ANDLINKER = /system/bin/linker

# Support of Greek character set
Expand Down Expand Up @@ -111,18 +120,21 @@ android:
"CC = $(ANDARM)-gcc" \
"CPP = $(ANDARM)-cpp" \
"STATIC = no" \
"CFLAGS = -O -rdynamic -fpic -pie -fPIE -DALIGN -DINLINE -DANDROID --sysroot=$(ANDROOT)" \
"CFLAGS = -O -rdynamic -pie -fPIE -fPIC -DALIGN -DINLINE -DANDROID -D__ANDROID_API__=${ANDOS}" \
"LDEXTRA = -ldl -lm" \
"LIBEXTRA = -ldl -lm"

# "CFLAGS = -O -rdynamic -fpic -pie -fPIE -DALIGN -DINLINE -DANDROID --sysroot=$(ANDROOT)" \

android_debug:
$(MAKE) targets \
"CC = $(ANDARM)-gcc" \
"CPP = $(ANDARM)-cpp" \
"STATIC = no" \
"CFLAGS = -O0 -g -rdynamic -fpic -pie -fPIE -D__DEBUG__ -DALIGN -DINLINE -DANDROID --sysroot=$(ANDROOT)" \
"LDEXTRA = -ldl -lm" \
"CFLAGS = -O0 -g -rdynamic -fPIE -fPIC -D__DEBUG__ -DALIGN -DINLINE -DANDROID -D__ANDROID_API__=${ANDOS}" \
"LDEXTRA = -pie -ldl -lm" \
"LIBEXTRA = -ldl -lm"
# "CFLAGS = -O0 -g -rdynamic -fpic -pie -fPIE -D__DEBUG__ -DALIGN -DINLINE -DANDROID --sysroot=$(ANDROOT)" \

bc:
$(MAKE) targets \
Expand Down
18 changes: 10 additions & 8 deletions mkandroid.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#make clean
make clean
make android
mkdir -p brexx/bin
mkdir -p brexx/lib
Expand All @@ -8,22 +8,24 @@ cp modules/*.so brexx/lib

rm brexx.zip
zip -r brexx.zip brexx/
rm -Rf brexx/*

rm -Rf brexx/bin
cp [A-Z]* brexx/
mkdir brexx/doc
mkdir brexx/lib
mkdir brexx
cp AUTHORS COPYING INSTALL README NEWS ChangeLog BUGS brexx/
mkdir -p brexx/doc
mkdir -p brexx/lib
cp -Rdpvu doc/*.html brexx/doc
cp -Rdpvu lib/*.r brexx/lib

rm brexx_extras.zip
zip -r brexx_extras.zip brexx
rm -Rf brexx/*

rm -R brexx_scripts.zip brexx/*
mkdir brexx/ce
mkdir brexx/android
mkdir -p brexx/ce
mkdir -p brexx/android
cp progs/*.r brexx/
cp progs/ce/*.r brexx/ce
cp progs/android/*.r brexx/android
rm brexx_scripts.zip
zip -r brexx_scripts.zip brexx
rm -Rf brexx

0 comments on commit be34fb5

Please sign in to comment.