3dphotoshoot
view android/Makefile @ 1:7eb73ce46dd0
fucking jni man ... wtf
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 14 May 2015 23:46:56 +0300 |
parents | |
children | cf5964db7ff3 |
line source
1 root = ..
2 include $(root)/proj.mk
4 # --- android settings ---
5 android_platform = android-22
6 name = $(bin)
7 pkgprefix = com.mutantstargoat
8 # ------------------------
10 src += $(wildcard $(root)/src/android/*.c)
12 obj = $(src:.c=.o) $(ccsrc:.cc=.o)
13 lib = libs/armeabi/lib$(name).so
14 apk-release = bin/$(name).apk
15 apk-debug = bin/$(name)-debug.apk
17 pkg = $(pkgprefix).$(name)
18 act = $(pkg).MainActivity
20 CC = arm-linux-androideabi-gcc
21 CXX = arm-linux-androideabi-g++
23 android_usr = $(NDK)/platforms/$(android_platform)/arch-arm/usr
24 android_inc = -I$(native_app_glue_dir)
25 android_libs = -llog -landroid -lEGL -lGLESv1_CM
27 CFLAGS = -std=c99 -Wall -g -DAPP_NAME=\"$(name)\" -march=armv7-a -mfloat-abi=softfp \
28 $(android_inc) -I$(root)/src/android -I$(root)/src/gles $(incpaths)
29 LDFLAGS = -Wl,--fix-cortex-a8 -Wl,-z,defs $(android_libs) $(libpaths) -lm
31 .PHONY: debug
32 debug: $(apk-debug)
34 .PHONY: release
35 release: $(apk-release)
37 $(apk-debug): $(lib) AndroidManifest.xml
38 ant debug
40 $(apk-release): $(lib) AndroidManifest.xml
41 ant release
43 .PHONY: lib
44 lib: $(lib)
46 $(lib): $(obj)
47 @mkdir -p libs/armeabi
48 $(CC) -o $@ -shared $(obj) $(LDFLAGS)
50 ant_files = *.xml *.properties proguard-project.txt
51 ant_dirs = bin libs res obj src gen
53 .PHONY: clean
54 clean:
55 rm -f $(obj) $(lib) $(apk-release) $(apk-debug) $(ant_files)
56 rm -rf $(ant_dirs)
58 .PHONY: install
59 install: install-debug
61 .PHONY: install-debug
62 install-debug:
63 adb install -r $(apk-debug)
65 .PHONY: install-release
66 install-release:
67 adb install -r $(apk-release)
69 .PHONY: uninstall
70 uninstall:
71 adb uninstall $(pkg)
73 .PHONY: run
74 run:
75 adb shell am start -n $(pkg)/$(act)
77 .PHONY: stop
78 stop:
79 adb shell am force-stop $(pkg)
81 AndroidManifest.xml:
82 android create project -p . -t $(android_platform) -k $(pkg) -a NativeActivity -n $(name)
83 cat manifest.xml.in | sed 's/$$APPNAME/$(name)/g' | sed 's/$$APPTITLE/$(title)/g' >$@
84 cd src && rm -f *.java && ln -s ../../src/android/*.java .
86 .PHONY: update-project
87 update-project: build.xml
88 android update project -p . -t $(android_platform)