-
Notifications
You must be signed in to change notification settings - Fork 74
/
Makefile
77 lines (60 loc) · 2.48 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
NDK_PATH=$(shell dirname `which ndk-build`)
SDK_PATH=$(shell dirname `which android`)
NUMCPUS=$(shell grep -c '^processor' /proc/cpuinfo || echo "4" )
TOPDIR=$(shell pwd)
PATCH_FFMPEG=$(shell cd submodules/externals/ffmpeg && git status | grep neon)
LINPHONE_VERSION=$(shell grep -e '^.C_INIT' submodules/linphone/configure.ac | sed -e 's/.*linphone]\,\[//' |sed -e 's/\].*//' )
KEYSTORE=bc-android.keystore
KEYALIAS=nw8000
all: prepare-sources generate-libs generate-apk install-apk run-linphone
prepare-ffmpeg:
ifeq ($(PATCH_FFMPEG),)
@patch -p0 < $(TOPDIR)/patches/ffmpeg_scalar_product_remove_alignment_hints.patch
endif
prepare-ilbc:
@cd $(TOPDIR)/submodules/libilbc-rfc3951 && \
./autogen.sh && \
./configure && make \
|| ( echo "iLBC prepare stage failed" ; exit 1 )
prepare-vpx:
@cd $(TOPDIR)/submodules/externals/libvpx && \
./configure --target=armv7-android-gcc --sdk-path=$(NDK_PATH) --enable-error-concealment && \
make clean && \
make asm_com_offsets.asm \
|| ( echo "VP8 prepare stage failed." ; exit 1 )
prepare-silk:
@cd $(TOPDIR)/submodules/mssilk && \
./autogen.sh && \
./configure --host=arm-linux MEDIASTREAMER_CFLAGS=" " MEDIASTREAMER_LIBS=" " && \
cd sdk && make extract-sources \
|| ( echo "SILK audio plugin prepare state failed." ; exit 1 )
prepare-srtp:
@cd $(TOPDIR)/submodules/externals/srtp/ && \
cp ../build/srtp/config.h . \
|| ( echo "SRTP prepare state failed." ; exit 1 )
prepare-mediastreamer2:
@cd $(TOPDIR)/submodules/linphone/mediastreamer2/src/ && \
eval `cat Makefile.am | grep xxd | grep yuv2rgb.vs | sed 's/$$$$builddir/./'` && \
eval `cat Makefile.am | grep xxd | grep yuv2rgb.fs | sed 's/$$$$builddir/./'` && \
if ! [ -e yuv2rgb.vs.h ]; then echo "yuv2rgb.vs.h creation error (do you have 'xxd' application installed ?)"; exit 1; fi && \
if ! [ -e yuv2rgb.fs.h ]; then echo "yuv2rgb.fs.h creation error (do you have 'xxd' application installed ?)"; exit 1; fi
prepare-sources: prepare-ffmpeg prepare-ilbc prepare-vpx prepare-silk prepare-srtp prepare-mediastreamer2
generate-libs:
$(NDK_PATH)/ndk-build LINPHONE_VERSION=$(LINPHONE_VERSION) BUILD_SILK=1 BUILD_AMRNB=full -j$(NUMCPUS)
update-project:
$(SDK_PATH)/android update project --path .
echo "key.store=$(KEYSTORE)" > ant.properties
echo "key.alias=$(KEYALIAS)" >> ant.properties
touch default.properties
generate-apk:
ant debug
install-apk: generate-apk
ant installd
release: update-project
ant release
run-linphone:
ant run
clean:
$(NDK_PATH)/ndk-build clean
ant clean
.PHONY: clean