ewolDrawer/Makefile

46 lines
1.6 KiB
Makefile
Raw Normal View History

2011-12-13 14:29:06 +01:00
PROJECT_PATH=$(shell pwd)
PROJECT_NDK=$(PROJECT_PATH)/../android/ndk-r7/
PROJECT_SDK=$(PROJECT_PATH)/../android/sdk-r15/
PROJECT_MODULE=$(PROJECT_PATH)/../
EWOL_FOLDER=$(PROJECT_MODULE)ewol
2011-12-14 10:19:03 +01:00
2011-12-14 14:09:55 +01:00
PROJECT_VENDOR=heeroyui
PROJECT_NAME=ewoldrawer
2011-12-14 13:58:01 +01:00
PROJECT_PACKAGE=ewoldrawerpackage
2011-12-14 10:19:03 +01:00
JAVA_FOLDER=src/com/$(PROJECT_VENDOR)/$(PROJECT_NAME)
2011-12-13 14:29:06 +01:00
all:
2011-12-14 10:19:03 +01:00
# Clear previous sources
rm -rf src
# Create folder
mkdir -p $(JAVA_FOLDER)/
# copy the java File :
cp $(EWOL_FOLDER)/SourcesJava/PROJECT_NAME.java $(JAVA_FOLDER)/$(PROJECT_NAME).java
sed -i "s|__PROJECT_VENDOR__|$(PROJECT_VENDOR)|" $(JAVA_FOLDER)/$(PROJECT_NAME).java
sed -i "s|__PROJECT_NAME__|$(PROJECT_NAME)|" $(JAVA_FOLDER)/$(PROJECT_NAME).java
2011-12-14 13:58:01 +01:00
sed -i "s|__PROJECT_PACKAGE__|$(PROJECT_PACKAGE)|" $(JAVA_FOLDER)/$(PROJECT_NAME).java
cp $(EWOL_FOLDER)/SourcesJava/ewolAndroidAbstraction.cpp jni/
sed -i "s|__PROJECT_VENDOR__|$(PROJECT_VENDOR)|" jni/ewolAndroidAbstraction.cpp
sed -i "s|__PROJECT_NAME__|$(PROJECT_NAME)|" jni/ewolAndroidAbstraction.cpp
sed -i "s|__PROJECT_PACKAGE__|$(PROJECT_PACKAGE)|" jni/ewolAndroidAbstraction.cpp
2011-12-14 10:19:03 +01:00
2011-12-14 13:58:01 +01:00
#build native code
cd $(PROJECT_NDK) ; NDK_PROJECT_PATH=$(PROJECT_PATH) NDK_MODULE_PATH=$(PROJECT_MODULE) ./ndk-build
#build java CODE :
2011-12-13 14:29:06 +01:00
PATH=$(PROJECT_SDK)/tools/:$(PROJECT_SDK)/platform-tools/:$(PATH) ant -Dsdk.dir=$(PROJECT_SDK) debug
rm -rf src
2011-12-14 13:58:01 +01:00
rm -f jni/ewolAndroidAbstraction.cpp
2011-12-13 14:29:06 +01:00
install: all
#$(PROJECT_SDK)/platform-tools/adb kill-server
# install application
2011-12-14 14:17:22 +01:00
sudo $(PROJECT_SDK)/platform-tools/adb install -r ./bin/$(PROJECT_NAME)-debug.apk
2011-12-13 14:29:06 +01:00
clean:
2011-12-14 10:19:03 +01:00
rm -rf bin libs gen obj