3dphotoshoot

view android/Makefile @ 18:dccbd7d65517

moved to android-19 to make it work with android 4.x
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 10 Jun 2015 18:53:28 +0300
parents 06dc8b9b4f89
children 94b8ef9b8caa
line source
1 root = ..
2 include $(root)/proj.mk
4 # --- android settings ---
5 android_platform = android-19
6 name = $(bin)
7 pkgprefix = com.mutantstargoat
8 # ------------------------
10 src += $(wildcard $(root)/src/android/*.c)
11 jsrc = $(wildcard $(root)/src/android/*.java)
13 obj = $(src:.c=.o)# $(ccsrc:.cc=.o)
14 lib = libs/armeabi/lib$(name).so
15 apk-release = bin/$(name).apk
16 apk-debug = bin/$(name)-debug.apk
18 pkg = $(pkgprefix).$(name)
19 act = $(pkg).MainActivity
21 CC = arm-linux-androideabi-gcc
22 CXX = arm-linux-androideabi-g++
24 #android_usr = $(NDK)/platforms/$(android_platform)/arch-arm/usr
25 android_inc = -I$(native_app_glue_dir)
26 #android_libs = -lstdc++ -llog -landroid -lEGL -lGLESv2
27 android_libs = -llog -landroid -lEGL -lGLESv2
29 defs += -DANDROID -DAPP_NAME=\"$(name)\"
30 CXXFLAGS = -Wall -g $(defs) -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 \
31 $(android_inc) -I$(root)/src/android -I$(root)/src/gles $(incpaths)
32 CFLAGS = -std=c99 $(CXXFLAGS)
33 LDFLAGS = -Wl,--fix-cortex-a8 -Wl,-z,defs $(android_libs) $(libpaths) $(libs)
35 .PHONY: debug
36 debug: $(apk-debug)
38 .PHONY: release
39 release: $(apk-release)
41 $(apk-debug): $(lib) $(jsrc) AndroidManifest.xml assets/data assets/sdr
42 ant debug
44 $(apk-release): $(lib) $(jsrc) AndroidManifest.xml assets/data assets/sdr
45 ant release
47 assets/data:
48 mkdir -p assets
49 cd assets && rm -f data && ln -s ../../data .
51 assets/sdr:
52 mkdir -p assets
53 cd assets && rm -f sdr && ln -s ../../sdr .
55 .PHONY: lib
56 lib: $(lib)
58 $(lib): $(obj)
59 @mkdir -p libs/armeabi
60 $(CC) -o $@ -shared $(obj) $(LDFLAGS)
62 ant_files = *.xml *.properties proguard-project.txt
63 ant_dirs = bin libs res obj src gen
65 .PHONY: clean
66 clean:
67 rm -f $(obj) $(lib) $(apk-release) $(apk-debug) $(ant_files)
68 rm -rf $(ant_dirs)
70 .PHONY: install
71 install: install-debug
73 .PHONY: install-debug
74 install-debug:
75 adb install -r $(apk-debug)
77 .PHONY: install-release
78 install-release:
79 adb install -r $(apk-release)
81 .PHONY: uninstall
82 uninstall:
83 adb uninstall $(pkg)
85 .PHONY: run
86 run:
87 adb shell am start -n $(pkg)/$(act)
89 .PHONY: stop
90 stop:
91 adb shell am force-stop $(pkg)
93 AndroidManifest.xml: manifest.xml.in
94 android create project -p . -t $(android_platform) -k $(pkg) -a NativeActivity -n $(name)
95 cat manifest.xml.in | sed 's/$$APPNAME/$(name)/g' | sed 's/$$APPTITLE/$(title)/g' >$@
96 cd src && rm -f *.java && ln -s ../../src/android/*.java .
98 .PHONY: update-project
99 update-project: build.xml
100 android update project -p . -t $(android_platform)
102 .PHONY: logcat
103 logcat:
104 adb logcat '$(name):V' 'DEBUG:V' '*:S'