project_files/Android-build/Templates/Makefile.android
author Xeli
Sat, 24 Mar 2012 15:52:07 +0100
changeset 6812 929b467c7277
parent 6807 f4816282ba01
child 7100 8a2b23efed11
permissions -rw-r--r--
fixed some typo's. LUA_LIBRARY now points to the right name, regardless of the host machine. Running cmake after a bad attempt (ie forgot to add paths to PATH) now works rather than having to clean the cache
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6812
929b467c7277 fixed some typo's. LUA_LIBRARY now points to the right name, regardless of the host machine. Running cmake after a bad attempt (ie forgot to add paths to PATH) now works rather than having to clean the cache
Xeli
parents: 6807
diff changeset
     1
SDL_ANDROID_DIR=${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project
5381
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 \
6812
929b467c7277 fixed some typo's. LUA_LIBRARY now points to the right name, regardless of the host machine. Running cmake after a bad attempt (ie forgot to add paths to PATH) now works rather than having to clean the cache
Xeli
parents: 6807
diff changeset
     7
	-Fu${FPC_DIR}/../rtl/units/arm-linux \
929b467c7277 fixed some typo's. LUA_LIBRARY now points to the right name, regardless of the host machine. Running cmake after a bad attempt (ie forgot to add paths to PATH) now works rather than having to clean the cache
Xeli
parents: 6807
diff changeset
     8
        -Fu${CMAKE_CURRENT_SOURCE_DIR} \
929b467c7277 fixed some typo's. LUA_LIBRARY now points to the right name, regardless of the host machine. Running cmake after a bad attempt (ie forgot to add paths to PATH) now works rather than having to clean the cache
Xeli
parents: 6807
diff changeset
     9
        -Fi../../hedgewars \
5381
8f95038f3f75 Removed protocol check, using CMake now to setup the building scripts using Templates/* removed old scripts
Xeli
parents:
diff changeset
    10
	-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
    11
	-Fl$(SDL_ANDROID_DIR)/libs/armeabi \
6807
f4816282ba01 Improved cmake build script for Android:
simmax@googlemail.com
parents: 6686
diff changeset
    12
	-Fl${ANDROID_NDK_TOOLCHAINDIR}/lib/gcc/arm-linux/arm-linux-androideabi/4.4.3/ \
6812
929b467c7277 fixed some typo's. LUA_LIBRARY now points to the right name, regardless of the host machine. Running cmake after a bad attempt (ie forgot to add paths to PATH) now works rather than having to clean the cache
Xeli
parents: 6807
diff changeset
    13
5381
8f95038f3f75 Removed protocol check, using CMake now to setup the building scripts using Templates/* removed old scripts
Xeli
parents:
diff changeset
    14
#LINKERFLAGS= -k"--static"
8f95038f3f75 Removed protocol check, using CMake now to setup the building scripts using Templates/* removed old scripts
Xeli
parents:
diff changeset
    15
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
    16
6668
f2091a9a77fa split the installing and building in the android Makefile
Xeli
parents: 6641
diff changeset
    17
all: install
f2091a9a77fa split the installing and building in the android Makefile
Xeli
parents: 6641
diff changeset
    18
build:
6812
929b467c7277 fixed some typo's. LUA_LIBRARY now points to the right name, regardless of the host machine. Running cmake after a bad attempt (ie forgot to add paths to PATH) now works rather than having to clean the cache
Xeli
parents: 6807
diff changeset
    19
	-${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_SOURCE_DIR}/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
    20
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
    21
	${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
    22
6812
929b467c7277 fixed some typo's. LUA_LIBRARY now points to the right name, regardless of the host machine. Running cmake after a bad attempt (ie forgot to add paths to PATH) now works rather than having to clean the cache
Xeli
parents: 6807
diff changeset
    23
	$(PPCROSSARM) $(LINKERFLAGS) $(PPCROSSARM_FLAGS) $(PPCROSSARM_INCLUDES) $(FPC_DEFINES) -o${CMAKE_CURRENT_SOURCE_DIR}/out/libhwengine.so ${CMAKE_CURRENT_SOURCE_DIR}/../../hedgewars/hwLibrary.pas
929b467c7277 fixed some typo's. LUA_LIBRARY now points to the right name, regardless of the host machine. Running cmake after a bad attempt (ie forgot to add paths to PATH) now works rather than having to clean the cache
Xeli
parents: 6807
diff changeset
    24
	${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/out/libhwengine.so $(SDL_ANDROID_DIR)/libs/armeabi/
6641
eb0cdccf9ccf wops, must use tabs not spaces..
Xeli
parents: 6621
diff changeset
    25
	${ANT} clean -f $(SDL_ANDROID_DIR)/build.xml
6668
f2091a9a77fa split the installing and building in the android Makefile
Xeli
parents: 6641
diff changeset
    26
	${ANT} debug -f $(SDL_ANDROID_DIR)/build.xml
f2091a9a77fa split the installing and building in the android Makefile
Xeli
parents: 6641
diff changeset
    27
install: build
f2091a9a77fa split the installing and building in the android Makefile
Xeli
parents: 6641
diff changeset
    28
	${ANT} installd -f $(SDL_ANDROID_DIR)/build.xml
f2091a9a77fa split the installing and building in the android Makefile
Xeli
parents: 6641
diff changeset
    29
       
5381
8f95038f3f75 Removed protocol check, using CMake now to setup the building scripts using Templates/* removed old scripts
Xeli
parents:
diff changeset
    30
clean:  
6812
929b467c7277 fixed some typo's. LUA_LIBRARY now points to the right name, regardless of the host machine. Running cmake after a bad attempt (ie forgot to add paths to PATH) now works rather than having to clean the cache
Xeli
parents: 6807
diff changeset
    31
	${CMAKE_COMMAND} -E remove_directory ${CMAKE_CURRENT_SOURCE_DIR}/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
    32
	${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
    33
	${ANT} clean -f $(SDL_ANDROID_DIR)/build.xml