nuclear@3: root = .. nuclear@3: include $(root)/proj.mk nuclear@3: nuclear@3: # --- android settings --- nuclear@3: android_platform = android-22 nuclear@3: name = $(bin) nuclear@3: pkgprefix = com.mutantstargoat nuclear@3: # ------------------------ nuclear@3: native_app_glue_dir = $(NDK)/sources/android/native_app_glue nuclear@3: nuclear@3: src += $(wildcard $(root)/src/android/*.c) \ nuclear@3: $(wildcard $(root)/src/gles/*.c) \ nuclear@3: $(native_app_glue_dir)/android_native_app_glue.c nuclear@3: nuclear@3: obj = $(src:.c=.o) $(ccsrc:.cc=.o) nuclear@3: lib = libs/armeabi/lib$(name).so nuclear@3: apk-release = bin/$(name).apk nuclear@3: apk-debug = bin/$(name)-debug.apk nuclear@3: nuclear@3: pkg = $(pkgprefix).$(name) nuclear@3: act = android.app.NativeActivity nuclear@3: nuclear@3: CC = arm-linux-androideabi-gcc nuclear@3: CXX = arm-linux-androideabi-g++ nuclear@3: nuclear@3: android_usr = $(NDK)/platforms/$(android_platform)/arch-arm/usr nuclear@3: android_inc = -I$(android_usr)/include -I$(native_app_glue_dir) nuclear@3: android_libs = -L$(android_usr)/lib -llog -landroid -lEGL -lGLESv1_CM nuclear@3: nuclear@3: CFLAGS = -std=c99 -Wall -g -DAPP_NAME=\"$(name)\" \ nuclear@3: $(android_inc) -I$(root)/src/android -I$(root)/src/gles $(incpaths) nuclear@3: LDFLAGS = -Wl,--fix-cortex-a8 $(android_libs) $(libpaths) nuclear@3: nuclear@3: .PHONY: debug nuclear@3: debug: $(apk-debug) nuclear@3: nuclear@3: .PHONY: release nuclear@3: release: $(apk-release) nuclear@3: nuclear@3: $(apk-debug): $(lib) AndroidManifest.xml nuclear@3: ant debug nuclear@3: nuclear@3: $(apk-release): $(lib) AndroidManifest.xml nuclear@3: ant release nuclear@3: nuclear@3: .PHONY: lib nuclear@3: lib: $(lib) nuclear@3: nuclear@3: $(lib): $(obj) nuclear@3: @mkdir -p libs/armeabi nuclear@3: $(CC) -o $@ -shared $(obj) $(LDFLAGS) nuclear@3: nuclear@3: .PHONY: clean nuclear@3: clean: nuclear@3: rm -f $(obj) $(lib) $(apk-release) $(apk-debug) nuclear@3: nuclear@3: .PHONY: install nuclear@3: install: install-debug nuclear@3: nuclear@3: .PHONY: install-debug nuclear@3: install-debug: nuclear@3: adb install -r $(apk-debug) nuclear@3: nuclear@3: .PHONY: install-release nuclear@3: install-release: nuclear@3: adb install -r $(apk-release) nuclear@3: nuclear@3: .PHONY: run nuclear@3: run: nuclear@3: adb shell am start -n $(pkg)/$(act) nuclear@3: nuclear@3: .PHONY: stop nuclear@3: stop: nuclear@3: adb shell am force-stop $(pkg) nuclear@3: nuclear@3: .PHONY: update-project nuclear@3: update-project: build.xml nuclear@3: android update project --path . --target $(android_platform)