project_files/Android-build/Templates/Makefile.android
author nemo
Sun, 12 Feb 2012 15:11:47 -0500
changeset 6681 f46b1a1de2ce
parent 6668 f2091a9a77fa
child 6686 bdb7c67eba06
permissions -rw-r--r--
oops

SDL_ANDROID_DIR=./SDL-android-project

PPCROSSARM=${FPC_DIR}/compiler/ppcrossarm
PPCROSSARM_FLAGS= -Xd -O2 -g -Tlinux -XParm-linux-androideabi- -vwnh
PPCROSSARM_INCLUDES= \
	-FD${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin \
	-Fu${FPC_DIR}/rtl/units/arm-linux \
	-Fl${ANDROID_NDK}/platforms/android-${ANDROID_NDK_API_LVL}/arch-arm/usr/lib \
	-Fl$(SDL_ANDROID_DIR)/libs/armeabi \
	-Fl${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/lib/gcc/arm-linux/arm-linux-androideabi/4.4.3/ \
#LINKERFLAGS= -k"--static"
FPC_DEFINES=-dandroid -darm

all: install
build:
	-${CMAKE_COMMAND} -E make_directory out

	${ANDROID_NDK}/ndk-build -C $(SDL_ANDROID_DIR) -j 8

	$(PPCROSSARM) $(LINKERFLAGS) $(PPCROSSARM_FLAGS) $(PPCROSSARM_INCLUDES) $(FPC_DEFINES) -oout/libhwengine.so ../../hedgewars/hwLibrary.pas
	${CMAKE_COMMAND} -E copy out/libhwengine.so SDL-android-project/libs/armeabi/
	${ANT} clean -f $(SDL_ANDROID_DIR)/build.xml
	${ANT} debug -f $(SDL_ANDROID_DIR)/build.xml
install: build
	${ANT} installd -f $(SDL_ANDROID_DIR)/build.xml
       
clean:  
	${CMAKE_COMMAND} -E remove_directory out
	${ANDROID_NDK}/ndk-build -C $(SDL_ANDROID_DIR) -j 8 clean
	${ANT} clean -f $(SDL_ANDROID_DIR)/build.xml