1 SDL_ANDROID_DIR=./SDL-android-project |
1 SDL_ANDROID_DIR=${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project |
2 |
2 |
3 PPCROSSARM=${FPC_DIR}/ppcrossarm |
3 PPCROSSARM=${FPC_DIR}/ppcrossarm |
4 PPCROSSARM_FLAGS= -Xd -O2 -g -Tlinux -XParm-linux-androideabi- -B -vwnh |
4 PPCROSSARM_FLAGS= -Xd -O2 -g -Tlinux -XParm-linux-androideabi- -B -vwnh |
5 PPCROSSARM_INCLUDES= \ |
5 PPCROSSARM_INCLUDES= \ |
6 -FD${ANDROID_NDK_TOOLCHAINDIR}/bin \ |
6 -FD${ANDROID_NDK_TOOLCHAINDIR}/bin \ |
7 -Fu${FPC_DIR}/rtl/units/arm-linux \ |
7 -Fu${FPC_DIR}/../rtl/units/arm-linux \ |
|
8 -Fu${CMAKE_CURRENT_SOURCE_DIR} \ |
|
9 -Fi../../hedgewars \ |
8 -Fl${ANDROID_NDK}/platforms/android-${ANDROID_NDK_API_LVL}/arch-arm/usr/lib \ |
10 -Fl${ANDROID_NDK}/platforms/android-${ANDROID_NDK_API_LVL}/arch-arm/usr/lib \ |
9 -Fl$(SDL_ANDROID_DIR)/libs/armeabi \ |
11 -Fl$(SDL_ANDROID_DIR)/libs/armeabi \ |
10 -Fl${ANDROID_NDK_TOOLCHAINDIR}/lib/gcc/arm-linux/arm-linux-androideabi/4.4.3/ \ |
12 -Fl${ANDROID_NDK_TOOLCHAINDIR}/lib/gcc/arm-linux/arm-linux-androideabi/4.4.3/ \ |
|
13 |
11 #LINKERFLAGS= -k"--static" |
14 #LINKERFLAGS= -k"--static" |
12 FPC_DEFINES=-dandroid -darm |
15 FPC_DEFINES=-dandroid -darm |
13 |
16 |
14 all: install |
17 all: install |
15 build: |
18 build: |
16 -${CMAKE_COMMAND} -E make_directory out |
19 -${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_SOURCE_DIR}/out |
17 |
20 |
18 ${ANDROID_NDK}/ndk-build -C $(SDL_ANDROID_DIR) -j 8 |
21 ${ANDROID_NDK}/ndk-build -C $(SDL_ANDROID_DIR) -j 8 |
19 |
22 |
20 $(PPCROSSARM) $(LINKERFLAGS) $(PPCROSSARM_FLAGS) $(PPCROSSARM_INCLUDES) $(FPC_DEFINES) -oout/libhwengine.so ../../hedgewars/hwLibrary.pas |
23 $(PPCROSSARM) $(LINKERFLAGS) $(PPCROSSARM_FLAGS) $(PPCROSSARM_INCLUDES) $(FPC_DEFINES) -o${CMAKE_CURRENT_SOURCE_DIR}/out/libhwengine.so ${CMAKE_CURRENT_SOURCE_DIR}/../../hedgewars/hwLibrary.pas |
21 ${CMAKE_COMMAND} -E copy out/libhwengine.so SDL-android-project/libs/armeabi/ |
24 ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/out/libhwengine.so $(SDL_ANDROID_DIR)/libs/armeabi/ |
22 ${ANT} clean -f $(SDL_ANDROID_DIR)/build.xml |
25 ${ANT} clean -f $(SDL_ANDROID_DIR)/build.xml |
23 ${ANT} debug -f $(SDL_ANDROID_DIR)/build.xml |
26 ${ANT} debug -f $(SDL_ANDROID_DIR)/build.xml |
24 install: build |
27 install: build |
25 ${ANT} installd -f $(SDL_ANDROID_DIR)/build.xml |
28 ${ANT} installd -f $(SDL_ANDROID_DIR)/build.xml |
26 |
29 |
27 clean: |
30 clean: |
28 ${CMAKE_COMMAND} -E remove_directory out |
31 ${CMAKE_COMMAND} -E remove_directory ${CMAKE_CURRENT_SOURCE_DIR}/out |
29 ${ANDROID_NDK}/ndk-build -C $(SDL_ANDROID_DIR) -j 8 clean |
32 ${ANDROID_NDK}/ndk-build -C $(SDL_ANDROID_DIR) -j 8 clean |
30 ${ANT} clean -f $(SDL_ANDROID_DIR)/build.xml |
33 ${ANT} clean -f $(SDL_ANDROID_DIR)/build.xml |