3dphotoshoot

diff android/Makefile @ 0:a4bf2687e406

3d photoshoot initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 12 May 2015 05:31:21 +0300
parents
children cf5964db7ff3
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/android/Makefile	Tue May 12 05:31:21 2015 +0300
     1.3 @@ -0,0 +1,88 @@
     1.4 +root = ..
     1.5 +include $(root)/proj.mk
     1.6 +
     1.7 +# --- android settings ---
     1.8 +android_platform = android-22
     1.9 +name = $(bin)
    1.10 +pkgprefix = com.mutantstargoat
    1.11 +# ------------------------
    1.12 +
    1.13 +src += $(wildcard $(root)/src/android/*.c)
    1.14 +
    1.15 +obj = $(src:.c=.o) $(ccsrc:.cc=.o)
    1.16 +lib = libs/armeabi/lib$(name).so
    1.17 +apk-release = bin/$(name).apk
    1.18 +apk-debug = bin/$(name)-debug.apk
    1.19 +
    1.20 +pkg = $(pkgprefix).$(name)
    1.21 +act = $(pkg).MainActivity
    1.22 +
    1.23 +CC = arm-linux-androideabi-gcc
    1.24 +CXX = arm-linux-androideabi-g++
    1.25 +
    1.26 +android_usr = $(NDK)/platforms/$(android_platform)/arch-arm/usr
    1.27 +android_inc = -I$(native_app_glue_dir)
    1.28 +android_libs = -llog -landroid -lEGL -lGLESv1_CM
    1.29 +
    1.30 +CFLAGS = -std=c99 -Wall -g -DAPP_NAME=\"$(name)\" -march=armv7-a -mfloat-abi=softfp \
    1.31 +		 $(android_inc) -I$(root)/src/android -I$(root)/src/gles $(incpaths)
    1.32 +LDFLAGS = -Wl,--fix-cortex-a8 -Wl,-z,defs $(android_libs) $(libpaths) -lm
    1.33 +
    1.34 +.PHONY: debug
    1.35 +debug: $(apk-debug)
    1.36 +
    1.37 +.PHONY: release
    1.38 +release: $(apk-release)
    1.39 +
    1.40 +$(apk-debug): $(lib) AndroidManifest.xml
    1.41 +	ant debug
    1.42 +
    1.43 +$(apk-release): $(lib) AndroidManifest.xml
    1.44 +	ant release
    1.45 +
    1.46 +.PHONY: lib
    1.47 +lib: $(lib)
    1.48 +
    1.49 +$(lib): $(obj)
    1.50 +	@mkdir -p libs/armeabi
    1.51 +	$(CC) -o $@ -shared $(obj) $(LDFLAGS)
    1.52 +
    1.53 +ant_files = *.xml *.properties proguard-project.txt
    1.54 +ant_dirs = bin libs res obj src gen
    1.55 +
    1.56 +.PHONY: clean
    1.57 +clean:
    1.58 +	rm -f $(obj) $(lib) $(apk-release) $(apk-debug) $(ant_files)
    1.59 +	rm -rf $(ant_dirs)
    1.60 +
    1.61 +.PHONY: install
    1.62 +install: install-debug
    1.63 +
    1.64 +.PHONY: install-debug
    1.65 +install-debug:
    1.66 +	adb install -r $(apk-debug)
    1.67 +
    1.68 +.PHONY: install-release
    1.69 +install-release:
    1.70 +	adb install -r $(apk-release)
    1.71 +
    1.72 +.PHONY: uninstall
    1.73 +uninstall:
    1.74 +	adb uninstall $(pkg)
    1.75 +
    1.76 +.PHONY: run
    1.77 +run:
    1.78 +	adb shell am start -n $(pkg)/$(act)
    1.79 +
    1.80 +.PHONY: stop
    1.81 +stop:
    1.82 +	adb shell am force-stop $(pkg)
    1.83 +
    1.84 +AndroidManifest.xml:
    1.85 +	android create project -p . -t $(android_platform) -k $(pkg) -a NativeActivity -n $(name)
    1.86 +	cat manifest.xml.in | sed 's/$$APPNAME/$(name)/g' | sed 's/$$APPTITLE/$(title)/g' >$@
    1.87 +	cd src && rm -f *.java && ln -s ../../src/android/*.java .
    1.88 +
    1.89 +.PHONY: update-project
    1.90 +update-project: build.xml
    1.91 +	android update project -p . -t $(android_platform)