project_files/Android-build/Templates/Makefile.android
author simmax@googlemail.com
Fri, 23 Mar 2012 00:21:34 +0100
changeset 6807 f4816282ba01
parent 6686 bdb7c67eba06
child 6812 929b467c7277
permissions -rw-r--r--
Improved cmake build script for Android: - Error out when Ant or android can't be found - Attempt to find the NDK toolchain binaries on Windows and Linux instead of assuming Linux - Use find_program instead of find_path to find some binaries - ANDROID_SDK now refers to the Android SDK base directory - Fixed detection of android.bat on Windows - Output of the android tool is now shown so that success/failure is visible
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5381
8f95038f3f75 Removed protocol check, using CMake now to setup the building scripts using Templates/* removed old scripts
Xeli
parents:
diff changeset
     1
SDL_ANDROID_DIR=./SDL-android-project
8f95038f3f75 Removed protocol check, using CMake now to setup the building scripts using Templates/* removed old scripts
Xeli
parents:
diff changeset
     2
6807
f4816282ba01 Improved cmake build script for Android:
simmax@googlemail.com
parents: 6686
diff changeset
     3
PPCROSSARM=${FPC_DIR}/ppcrossarm
6686
bdb7c67eba06 rebuild all modules each time..... :P
Xeli
parents: 6668
diff changeset
     4
PPCROSSARM_FLAGS= -Xd -O2 -g -Tlinux -XParm-linux-androideabi- -B -vwnh
5381
8f95038f3f75 Removed protocol check, using CMake now to setup the building scripts using Templates/* removed old scripts
Xeli
parents:
diff changeset
     5
PPCROSSARM_INCLUDES= \
6807
f4816282ba01 Improved cmake build script for Android:
simmax@googlemail.com
parents: 6686
diff changeset
     6
	-FD${ANDROID_NDK_TOOLCHAINDIR}/bin \
5381
8f95038f3f75 Removed protocol check, using CMake now to setup the building scripts using Templates/* removed old scripts
Xeli
parents:
diff changeset
     7
	-Fu${FPC_DIR}/rtl/units/arm-linux \
8f95038f3f75 Removed protocol check, using CMake now to setup the building scripts using Templates/* removed old scripts
Xeli
parents:
diff changeset
     8
	-Fl${ANDROID_NDK}/platforms/android-${ANDROID_NDK_API_LVL}/arch-arm/usr/lib \
8f95038f3f75 Removed protocol check, using CMake now to setup the building scripts using Templates/* removed old scripts
Xeli
parents:
diff changeset
     9
	-Fl$(SDL_ANDROID_DIR)/libs/armeabi \
6807
f4816282ba01 Improved cmake build script for Android:
simmax@googlemail.com
parents: 6686
diff changeset
    10
	-Fl${ANDROID_NDK_TOOLCHAINDIR}/lib/gcc/arm-linux/arm-linux-androideabi/4.4.3/ \
5381
8f95038f3f75 Removed protocol check, using CMake now to setup the building scripts using Templates/* removed old scripts
Xeli
parents:
diff changeset
    11
#LINKERFLAGS= -k"--static"
8f95038f3f75 Removed protocol check, using CMake now to setup the building scripts using Templates/* removed old scripts
Xeli
parents:
diff changeset
    12
FPC_DEFINES=-dandroid -darm
8f95038f3f75 Removed protocol check, using CMake now to setup the building scripts using Templates/* removed old scripts
Xeli
parents:
diff changeset
    13
6668
f2091a9a77fa split the installing and building in the android Makefile
Xeli
parents: 6641
diff changeset
    14
all: install
f2091a9a77fa split the installing and building in the android Makefile
Xeli
parents: 6641
diff changeset
    15
build:
5381
8f95038f3f75 Removed protocol check, using CMake now to setup the building scripts using Templates/* removed old scripts
Xeli
parents:
diff changeset
    16
	-${CMAKE_COMMAND} -E make_directory out
6230
de1e43054017 automated the build process some more, users must add the android ndk, sdk and fpc dir to their $PATH and cmake will do the rest, I still need a solution for the sdl dir. Subrepo's perhaps?
Xeli
parents: 6033
diff changeset
    17
de1e43054017 automated the build process some more, users must add the android ndk, sdk and fpc dir to their $PATH and cmake will do the rest, I still need a solution for the sdl dir. Subrepo's perhaps?
Xeli
parents: 6033
diff changeset
    18
	${ANDROID_NDK}/ndk-build -C $(SDL_ANDROID_DIR) -j 8
de1e43054017 automated the build process some more, users must add the android ndk, sdk and fpc dir to their $PATH and cmake will do the rest, I still need a solution for the sdl dir. Subrepo's perhaps?
Xeli
parents: 6033
diff changeset
    19
5381
8f95038f3f75 Removed protocol check, using CMake now to setup the building scripts using Templates/* removed old scripts
Xeli
parents:
diff changeset
    20
	$(PPCROSSARM) $(LINKERFLAGS) $(PPCROSSARM_FLAGS) $(PPCROSSARM_INCLUDES) $(FPC_DEFINES) -oout/libhwengine.so ../../hedgewars/hwLibrary.pas
8f95038f3f75 Removed protocol check, using CMake now to setup the building scripts using Templates/* removed old scripts
Xeli
parents:
diff changeset
    21
	${CMAKE_COMMAND} -E copy out/libhwengine.so SDL-android-project/libs/armeabi/
6641
eb0cdccf9ccf wops, must use tabs not spaces..
Xeli
parents: 6621
diff changeset
    22
	${ANT} clean -f $(SDL_ANDROID_DIR)/build.xml
6668
f2091a9a77fa split the installing and building in the android Makefile
Xeli
parents: 6641
diff changeset
    23
	${ANT} debug -f $(SDL_ANDROID_DIR)/build.xml
f2091a9a77fa split the installing and building in the android Makefile
Xeli
parents: 6641
diff changeset
    24
install: build
f2091a9a77fa split the installing and building in the android Makefile
Xeli
parents: 6641
diff changeset
    25
	${ANT} installd -f $(SDL_ANDROID_DIR)/build.xml
f2091a9a77fa split the installing and building in the android Makefile
Xeli
parents: 6641
diff changeset
    26
       
5381
8f95038f3f75 Removed protocol check, using CMake now to setup the building scripts using Templates/* removed old scripts
Xeli
parents:
diff changeset
    27
clean:  
6230
de1e43054017 automated the build process some more, users must add the android ndk, sdk and fpc dir to their $PATH and cmake will do the rest, I still need a solution for the sdl dir. Subrepo's perhaps?
Xeli
parents: 6033
diff changeset
    28
	${CMAKE_COMMAND} -E remove_directory out
de1e43054017 automated the build process some more, users must add the android ndk, sdk and fpc dir to their $PATH and cmake will do the rest, I still need a solution for the sdl dir. Subrepo's perhaps?
Xeli
parents: 6033
diff changeset
    29
	${ANDROID_NDK}/ndk-build -C $(SDL_ANDROID_DIR) -j 8 clean
de1e43054017 automated the build process some more, users must add the android ndk, sdk and fpc dir to their $PATH and cmake will do the rest, I still need a solution for the sdl dir. Subrepo's perhaps?
Xeli
parents: 6033
diff changeset
    30
	${ANT} clean -f $(SDL_ANDROID_DIR)/build.xml