nuclear@0: android_platform = android-21 nuclear@0: nuclear@0: src = $(wildcard src/*.c) nuclear@0: obj = $(src:.c=.o) nuclear@0: name = ndktest nuclear@0: lib = libs/armeabi/lib$(name).so nuclear@0: apk-release = bin/$(name).apk nuclear@0: apk-debug = bin/$(name)-debug.apk nuclear@0: nuclear@0: pkg = com.mutantstargoat.ndktest nuclear@0: act = android.app.NativeActivity nuclear@0: nuclear@0: CC = arm-linux-androideabi-gcc nuclear@0: nuclear@0: android_usr = $(NDK)/platforms/$(android_platform)/arch-arm/usr nuclear@0: android_inc = -I$(android_usr)/include nuclear@0: android_libs = -L$(android_usr)/lib -llog -landroid -lEGL -lGLESv1_CM nuclear@0: nuclear@0: CFLAGS = -std=c99 -pedantic -Wall -g $(android_inc) -Isrc nuclear@0: LDFLAGS = -Wl,--fix-cortex-a8 $(android_libs) nuclear@0: nuclear@0: .PHONY: debug nuclear@0: debug: $(apk-debug) nuclear@0: nuclear@0: .PHONY: release nuclear@0: release: $(apk-release) nuclear@0: nuclear@0: $(apk-debug): $(lib) nuclear@0: ant debug nuclear@0: nuclear@0: $(apk-release): $(lib) nuclear@0: ant release nuclear@0: nuclear@0: .PHONY: lib nuclear@0: lib: $(lib) nuclear@0: nuclear@0: $(lib): $(obj) nuclear@0: @mkdir -p libs/armeabi nuclear@0: $(CC) -o $@ -shared $(obj) $(LDFLAGS) nuclear@0: nuclear@0: .PHONY: clean nuclear@0: clean: nuclear@0: rm -f $(obj) $(lib) $(apk-release) $(apk-debug) nuclear@0: nuclear@0: .PHONY: install nuclear@0: install: install-debug nuclear@0: nuclear@0: .PHONY: install-debug nuclear@0: install-debug: nuclear@0: adb install -r $(apk-debug) nuclear@0: nuclear@0: .PHONY: install-release nuclear@0: install-release: nuclear@0: adb install -r $(apk-release) nuclear@0: nuclear@0: .PHONY: run nuclear@0: run: nuclear@0: adb shell am start -n $(pkg)/$(act) nuclear@0: nuclear@0: .PHONY: stop nuclear@0: stop: nuclear@0: adb shell am force-stop $(pkg)