blob: 95e588281c7bc8708e0fa9ae03a6fb2b06db373d [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001SHELL = /bin/sh
2RM = rm -f
3
4LOCAL_CFLAGS := -Wall \
5 -std=gnu++14 \
6 -g -Os \
7 -flto \
8 -DRIL_SHLIB \
9 -DATCI_PARSE \
10 -DKEEP_ALIVE \
11 -DECALL_SUPPORT \
12 -fpermissive \
13
14$(warning ################# C2K support: $(RAT_CONFIG_C2K_SUPPORT) $(CXX))
15ifeq ($(strip $(RAT_CONFIG_C2K_SUPPORT)), yes)
16 LOCAL_CFLAGS += -DC2K_SUPPORT
17
18endif
19
20ifeq ($(strip $(MTK_MULTI_SIM_SUPPORT)), dsds)
21 LOCAL_CFLAGS += -DANDROID_SIM_COUNT_2 \
22 -DANDROID_MULTI_SIM \
23 -DMODE_DSDS
24endif
25
26ifeq ($(strip $(MTK_MULTI_SIM_SUPPORT)), dsss)
27 LOCAL_CFLAGS += -DMODE_DSSS
28endif
29
30
31ifeq ($(strip $(TARGET_PLATFORM)), mt2731)
32$(warning ################# TARGET_PLATFORM_MT2731)
33 LOCAL_CFLAGS += -DTARGET_PLATFORM_MT2731 \
34 -DMD_93_SUPPORT
35else ifeq ($(strip $(TARGET_PLATFORM)), mt2635)
36$(warning ################# TARGET_PLATFORM_MT2635)
37 LOCAL_CFLAGS += -DTARGET_PLATFORM_MT2635 \
38 -DMD_90_SUPPORT
39endif
40
41ifeq ($(strip $(TARGET_PLATFORM)), mt2735)
42LOCAL_CFLAGS += -DTARGET_PLATFORM_MT2735
43LOCAL_CFLAGS += -DBASELIB_DIR_LIB64
44endif
45
46LOCAL_PATH = .
47
48LOCAL_C_INCLUDES = \
49 -I. \
50 -I$(LOCAL_PATH)/data \
51 -I$(LOCAL_PATH)/util \
52 -I$(LOCAL_PATH)/em/rfdesense \
53 -I$(LOCAL_PATH)/em \
54 -I$(LOCAL_PATH)/sms \
55 -I$(LOCAL_PATH)/sms/cdma \
56 -I$(LOCAL_PATH)/sms/gsm \
57 -I$(LOCAL_PATH)/atci \
58 -I$(LOCAL_PATH)/../include/libtel \
59 -I$(LOCAL_PATH)/stateManager \
60 -I$(LOCAL_PATH)/ecall/ \
61 -I$(LOCAL_PATH)/ecall/gost \
62 -I$(LOCAL_PATH)/ecall/gost/utils \
63 -I$(LOCAL_PATH)/ecall/gost/sslp \
64 -I$(LOCAL_PATH)/ecall/gost/sslp/auth \
65 -I$(LOCAL_PATH)/ecall/gost/sslp/firmware \
66 -I$(LOCAL_PATH)/ecall/gost/sslp/commands \
67 -I$(LOCAL_PATH)/ecall/gost/sslp/ecall \
68 -I$(LOCAL_PATH)/ecall/gost/sslp/teledata \
69 -I$(ROOT)$(includedir)/logger \
70 -I$(ROOT)$(includedir)/liblog \
71 -I$(ROOT)$(includedir)/vendor-ril \
72 -I$(ROOT)$(includedir)/gstreamer-1.0 \
73 -I$(ROOT)$(includedir)/glib-2.0 \
74 -I$(ROOT)$(libdir)/glib-2.0/include \
75 -I$(ROOT)$(libdir)/gstreamer-1.0/include\
76 -I$(ROOT)$(includedir)/dbus-1.0 \
77 -I$(ROOT)$(libdir)/dbus-1.0/include \
78
79
80LOCAL_LIBS := \
81 -L. \
82 -ldl \
83 -lrt \
84 -lstdc++ \
85 -llog \
86 -llynq-log \
87 -lcutils \
88 -lutils \
89 -lpower \
90 -lbinder \
91 -lpthread \
92 -lmtk_audio_mixer_ctrl \
93 -lasound \
94 -lpal \
95 -lgstreamer-1.0 \
96 -lglib-2.0 \
97 -lgstbase-1.0 \
98 -lgstreamer-1.0 \
99 -lgobject-2.0 \
100 -lgio-2.0 \
101 -ldtmf \
102 -lapn \
103 -ldbus-1 \
104
105ifeq ($(strip $(TARGET_PLATFORM)), mt2735)
106LOCAL_LIBS += -luciwrapper
107else
108LOCAL_LIBS += -lsncfg
109endif
110
111
112SOURCES = $(wildcard util/*.cpp *.cpp ecall/*.cpp ecall/gost/*.cpp ecall/gost/utils/*.cpp ecall/gost/sslp/*.cpp ecall/gost/sslp/auth/*.cpp ecall/gost/sslp/firmware/*.cpp ecall/gost/sslp/commands/*.cpp ecall/gost/sslp/ecall/*.cpp ecall/gost/sslp/teledata/*.cpp data/*.cpp em/rfdesense/*.cpp em/networkinfo/*.cpp em/*.cpp sms/*.cpp sms/gsm/*.cpp sms/cdma/*.cpp atci/*.cpp stateManager/*.cpp)
113
114EXECUTABLE = liblynq-tele-ril.so
115
116OBJECTS=$(SOURCES:.cpp=.o)
117
118
119.PHONY: build clean install pack_rootfs
120
121all: build
122
123$(EXECUTABLE): $(OBJECTS)
124 $(CXX) -shared -Wl,--no-undefined $(OBJECTS) $(LOCAL_LIBS) $(LOCAL_CFLAGS) $(LOCAL_C_INCLUDES) -o $@
125
126%.o : %.cpp
127 $(CXX) $(LOCAL_C_INCLUDES) $(LOCAL_CFLAGS) $(LOCAL_LIBS) -o $@ -c $<
128
129build: $(EXECUTABLE)
130 $(warning ########## build $(EXECUTABLE) ##########)
131
132install:
133 mkdir -p $(ROOT)$(base_libdir)/
134 install $(EXECUTABLE) $(ROOT)$(base_libdir)/
135 mkdir -p $(ROOT)$(includedir)/$(NAME)/sdk
136
137pack_rootfs:
138 mkdir -p $(PACK_INITRAMFS_TO)$(base_libdir)/
139 cp -af $(EXECUTABLE) $(PACK_INITRAMFS_TO)$(base_libdir)/
140 $(CROSS)strip $(PACK_INITRAMFS_TO)$(base_libdir)/$(EXECUTABLE)
141 mkdir -p $(PACK_TO)$(base_libdir)/
142 cp -af $(EXECUTABLE) $(PACK_TO)$(base_libdir)/
143 $(CROSS)strip $(PACK_TO)$(base_libdir)/$(EXECUTABLE)
144
145.PHONY: clean
146clean:
147 $(RM) $(OBJECTS) $(EXECUTABLE)