summaryrefslogtreecommitdiffstats
path: root/bindings/java/android/droid-makefile
blob: 5383adc3c7285d4154b6e667ab122a30420cb669 (plain)
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
APP := lib$(PROJECT)_$(MARCH).$(EXT)

CFLAGS := $(CFLAGS_LIB) -fno-rtti -fno-exceptions -I../../_common -I../../. -I../../../tinySAK/src -I../../../tinyNET/src -I../../../tinyHTTP/include -I../../../tinyXCAP/include \
	-I../../../tinySMS/include -I../../../tinySDP/include -I../../../tinyMEDIA/include -I../../../tinyMSRP/include -I../../../tinyDAV/include -I../../../tinySIP/include
	
# Because of the static build, we need all librarires
THIRDPARTIES_LIB := ../../../thirdparties/android/lib
THIRDPARTIES_MARCH_LIB := ../../../thirdparties/android/lib/$(MARCH)

##########
# Before starting to set parmeters we will override those provided by the user
#

ifeq ($(LICENSE),lgpl)
	H264 := no
endif


##########
# Set LD and CFLAGS according to the user parameters
#

ifneq ($(FFMPEG), no)
FFMPEG_LDFLAGS := -lavutil-$(LICENSE) -lswscale-$(LICENSE) -lavcore-$(LICENSE) -lavcodec-$(LICENSE)
	ifneq ($(H264),no)
	FFMPEG_LDFLAGS := $(FFMPEG_LDFLAGS) -lx264
	endif
	ifneq ($(THEORA),no)
	FFMPEG_LDFLAGS := $(FFMPEG_LDFLAGS) -ltheora -logg
	endif
endif

ifneq ($(LIBYUV),no)
	LIBYUV_LDLAGS := -lyuv_$(MARCH)
endif

ifeq ($(VPX),yes)
	VPX_LDLAGS := -lvpx_$(MARCH)
endif

ifneq ($(OPUS), no)
	OPUS_LDFLAGS := -lopus
endif

ifneq ($(OPENCORE_AMR), no)
	OPENCORE_ARM_LDFLAGS := -lopencore-amrnb
endif

ifeq ($(SPEEX_DSP), yes)
	SPEEX_DSP_LDFLAGS := -lspeexdsp
endif

ifeq ($(SPEEX), yes)
	SPEEX_LDFLAGS := -lspeex
endif

ifeq ($(WEBRTC), yes)
	WEBRTC_LDFLAGS := -lwebrtc_aec_$(MARCH) -lwebrtc_spl_$(MARCH) -lwebrtc_apm_utility_$(MARCH) -lwebrtc_nsx_$(MARCH) -lwebrtc_system_wrappers_$(MARCH)
endif

ifeq ($(ILBC), yes)
	ILBC_LDFLAGS := -liLBC
endif

ifneq ($(LIBGSM),no)
	LIBGSM_LDFLAGS := -lgsm
endif

#BV16_LDFLAGS := -lbv16

ifeq ($(G729), yes)
	G729_LDFLAGS := -lg729b_$(MARCH)
	
	# Reset all other ITU CODECS
	OPENCORE_ARM_LDFLAGS :=
	BV16_LDFLAGS :=
else
	G729_LDFLAGS :=
endif

ifneq ($(SRTP),no)
	LIBSRTP_LDFLAGS := -lsrtp
endif

ifneq ($(TLS), no)
	TLS_LDFLAGS := -lssl_$(MARCH) -lcrypto_$(MARCH)
endif

ifeq ($(LT),shared)
	_LT=Bdynamic
else
	_LT=Bstatic
endif

LDFLAGS := $(LDFLAGS_LIB) -L$(THIRDPARTIES_LIB) -L$(THIRDPARTIES_MARCH_LIB) $(FFMPEG_LDFLAGS) $(LIBYUV_LDLAGS) $(VPX_LDLAGS) $(WEBRTC_LDFLAGS) $(SPEEX_DSP_LDFLAGS) $(SPEEX_LDFLAGS) $(OPUS_LDFLAGS) $(OPENCORE_ARM_LDFLAGS) $(BV16_LDFLAGS) $(ILBC_LDFLAGS) $(LIBGSM_LDFLAGS) $(G729_LDFLAGS) \
	 $(LIBSRTP_LDFLAGS) $(TLS_LDFLAGS) \
	-Wl,-Bdynamic -lm -lstdc++ -lgnustl_static -lgcc -llog -ldl \
	-Wl,-$(_LT) -ltinySAK_$(MARCH) -ltinyHTTP_$(MARCH) -ltinyXCAP_$(MARCH) -ltinyIPSec_$(MARCH) -ltinySIGCOMP_$(MARCH) -ltinySMS_$(MARCH) -ltinyNET_$(MARCH) -ltinySDP_$(MARCH) -ltinyRTP_$(MARCH) -ltinyMEDIA_$(MARCH) -ltinyMSRP_$(MARCH) -ltinyDAV_$(MARCH) -ltinySIP_$(MARCH)


all: $(APP)

OBJS = tinyWRAP_wrap.o\
	../../_common/ActionConfig.o \
	../../_common/AudioResampler.o \
	../../_common/DDebug.o \
	../../_common/MediaContent.o \
	../../_common/MediaSessionMgr.o \
	../../_common/Msrp.o \
	../../_common/ProxyConsumer.o \
	../../_common/ProxyPluginMgr.o \
	../../_common/ProxyProducer.o \
	../../_common/SafeObject.o \
	../../_common/SipCallback.o \
	../../_common/SipEvent.o \
	../../_common/SipMessage.o \
	../../_common/SipSession.o \
	../../_common/SipStack.o \
	../../_common/SipUri.o \
	../../_common/SMSEncoder.o \
	../../_common/Xcap.o


$(APP): $(OBJS)
ifeq ($(EXT), a)
	$(AR) rcs $@ $^
else
	$(CC) $(LDFLAGS) -o $@ $^
endif

%.o: %.cxx
	$(CPP) -c $(INCLUDE) $(CFLAGS) $< -o $@
	
install: $(APP)
	$(ANDROID_SDK_ROOT)/tools/adb remount
	$(ANDROID_SDK_ROOT)/tools/adb push $(APP) $(LIB_DIR)/$(APP)
	$(ANDROID_SDK_ROOT)/tools/adb shell chmod 777 $(LIB_DIR)/$(APP)

shell:
	$(ANDROID_SDK_ROOT)/tools/adb shell

run:
	$(ANDROID_SDK_ROOT)/tools/adb shell $(LIB_DIR)/$(APP)
	
clean:
	@rm -f $(OBJS) $(APP)
OpenPOWER on IntegriCloud