-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathMakefile
119 lines (90 loc) · 2.94 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Android Makefile v0.1 (c) 2011 - Daniel Hiepler <daniel@niftylight.de>
# Additions v0.2 (c) 2012 made by Scott Sibley <sisibley@gmail.com>
APPNAME = LibVisual
ACTIVITY = LibVisual
TARGET = android-8
all: bin/$(APPNAME)-unsigned.apk
bin/$(APPNAME)-unsigned.apk:
ndk-build APP_OPTIM=release
ant clean
ant release
install: bin/$(APPNAME).apk
adb install -r bin/$(APPNAME).apk
install_emu: bin/$(APPNAME).apk
adb -e install -r bin/$(APPNAME).apk
install_dev: bin/$(APPNAME).apk
adb -d install -r bin/$(APPNAME).apk
debug:
ndk-build NDK_DEBUG=1 APP_OPTIM=debug V=1
ant clean
ant debug
install_debug: debug
adb install -r bin/$(APPNAME)-debug.apk
install_debug_emu: debug
adb -e install -r bin/$(APPNAME)-debug.apk
install_debug_dev: debug
adb -d install -r bin/$(APPNAME)-debug.apk
clean:
ndk-build clean
ant clean
rm -rf bin obj gen
update:
android update project --path . --target $(TARGET)
keygen: my.keystore
my.keystore:
keytool -genkey -v -keystore my.keystore -alias $(APPNAME)_key -keyalg RSA -keysize 4096 -validity 100000
sign: bin/$(APPNAME).apk
bin/$(APPNAME).apk: bin/$(APPNAME)-unsigned.apk my.keystore all
jarsigner -keystore my.keystore bin/$(ACTIVITY)-release-unsigned.apk $(APPNAME)_key
zipalign -v 4 bin/$(ACTIVITY)-release-unsigned.apk bin/$(APPNAME).apk
log:
adb pull /data/data/org.libvisual.android/lib/ lyrical/data/data/org.libvisual.android/
/opt/arm-2011.09/bin/arm-none-linux-gnueabi-objdump -S obj/local/armeabi/libvisual.so > libvisual.asm
adb shell logcat -d > test.log
./tools/stack.py --symbols-dir=./lyrical/ ./test.log
#./tools/parse_stack.py ./libvisual.asm ./test.log
adb shell dumpsys meminfo -h > meminfo.txt
gdb:
ndk-gdb --start --force --verbose
#Perform leak detection
mem1:
adb shell setprop dalvik.vm.checkjni true
adb shell setprop libc.debug.malloc 1
adb shell setprop dalvik.vm.jniopts forcecopy
adb shell stop
adb shell start
#Fill allocated memory to detect overruns
mem5:
adb shell setprop dalvik.vm.checkjni true
adb shell setprop libc.debug.malloc 5
adb shell setprop dalvik.vm.jniopts forcecopy
adb shell stop
adb shell start
#Fill memory and add sentinels to detect overruns
mem10:
adb shell setprop dalvik.vm.checkjni true
adb shell setprop libc.debug.malloc 10
adb shell setprop dalvik.vm.jniopts forcecopy
adb shell stop
adb shell start
#Use special instrumented malloc/free routines for the emulator. (Emulator only!)
mem20:
adb shell setprop dalvik.vm.checkjni true
adb shell setprop libc.debug.malloc 20
adb shell setprop dalvik.vm.jniopts forcecopy
adb shell stop
adb shell start
start:
adb shell am start -n org.libvisual.android/.LibVisual
start_dev:
adb -d shell am start -n org.libvisual.android/.LibVisual
start_emu:
adb -e shell am start -n org.libvisual.android/.LibVisual
valgrind:
adb shell setprop wrap.org.libvisual.android "logwrapper valgrind"
redirect:
adb shell stop
adb shell setprop log.redirect-stdio true
adb shell start
profile:
./tools/gprof.sh