blob: 67992a0135285ea445cdc0958b44f374becb3280 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#*******************************************************************************
2# include ZTE application makefile
3#*******************************************************************************
4include $(zte_app_mak)
5#include ../net_team.mk
6include $(COMMON_MK)
7
8CPU_PUB_ROOT=$(TOPDIR_AP)/../pub
9##############USER COMIZE BEGIN################
10EXEC = zte_mdl
11EXEC1 = zte-rtc-clock
12EXEC2 = router_msg_proxy
13OBJS = zte_mdl.o \
14 $(patsubst %.c,%.o,$(wildcard ../zte_comm/at_ctl/src/atctrl/*.c ../zte_comm/at_ctl/src/atconfig/*.c ../zte_comm/at_ctl/src/phone/*.c ../zte_comm/at_ctl/src/phone/src/*.c)) \
15 ../zte_comm/rtc-service/rtc-service.o \
16 $(filter-out ../zte_comm/zte_mainctrl/router_msg_proxy.o,$(patsubst %.c,%.o,$(wildcard ../zte_comm/zte_mainctrl/*.c))) \
17 ../zte_comm/zte_hotplug/hotplug.o ../zte_comm/zte_hotplug/netdev_plug.o ../zte_comm/zte_hotplug/drv_plug.o ../zte_comm/zte_audio_ctrl/audio_res_ctrl.o \
18 $(patsubst %.c,%.o,$(wildcard ../zte_comm/zte_drv_ctrl/usb/*.c ../zte_comm/zte_drv_ctrl/serial/*.c)) \
19 ../zte_comm/sntp/sntp.o \
20 $(patsubst %.c,%.o,$(wildcard ../zte_comm/fota_dm/src/*.c ))
21
22ifeq ($(USE_VEHICLE_DC),yes)
23OBJS += ../zte_comm/nvserver/nvserver_rpc.o ../zte_comm/nvserver/sc_rpc.o ../zte_comm/nvserver/file.o
24else
25OBJS += ../zte_comm/nvserver/nvserver.o ../zte_comm/nvserver/nvupdate.o
26endif
27
xf.li6c8fc1e2023-08-12 00:11:09 -070028ifeq ($(USE_VEHICLE_DC_REF),yes)
29#wifi
30ifeq ($(CONFIG_WIFI_MODULE),realtek)
31CFLAGS += -D__REALTEK_8192_CHIP__
32ifeq ($(CONFIG_WIFI_RTL_WPA2),yes)
33tools_dir += ../zte_comm/wlan/realtek_tools_wpa2/auth ../zte_comm/wlan/realtek_tools_wpa2/mini_upnp ../zte_comm/wlan/realtek_tools_wpa2/utility
34tools_dir += ../zte_comm/wlan/realtek_tools_wpa2/wsc ../zte_comm/wlan/realtek_tools_wpa2/wireless_tools.25
35else
36tools_dir += ../zte_comm/wlan/realtek_tools/auth ../zte_comm/wlan/realtek_tools/mini_upnp ../zte_comm/wlan/realtek_tools/utility
37tools_dir += ../zte_comm/wlan/realtek_tools/wsc ../zte_comm/wlan/realtek_tools/wireless_tools.25
38endif
39else ifeq ($(CONFIG_WIFI_MODULE),rda5995)
40CFLAGS += -D__RDA_5995_CHIP__
41tools_dir += ../zte_comm/wlan/rda_tools
42else ifeq ($(CONFIG_WIFI_MODULE),esp8089)
43CFLAGS += -D__ESP_8089_CHIP__
44tools_dir += ../zte_comm/wlan/esp_tools/eagle_test ../zte_comm/wlan/esp_tools/fcctest
45else ifeq ($(CONFIG_WIFI_MODULE),xr819)
46CFLAGS += -D__XR_819_CHIP__
47#tools_dir +=
48else ifeq ($(CONFIG_WIFI_MODULE),ssv6x5x)
49CFLAGS += -D__SSV_6X5X_CHIP__
50#tools_dir +=
51else ifeq ($(CONFIG_WIFI_MODULE),aic8800)
52CFLAGS += -D__AIC_8800DW_CHIP__
53tools_dir += ../zte_comm/wlan/aic_tools/rftest
54ifeq ($(CONFIG_WIFI_SINGLEAP), no)
55CFLAGS += -D__MULTI_AP__
56endif
57endif
58
59$(warning CONFIG_WIFI_FUNCTION=$(CONFIG_WIFI_FUNCTION))
60
61ifeq ($(findstring sta,$(CONFIG_WIFI_FUNCTION)), sta)
62WLAN_STA_FUNC=yes
63endif
64
65ifeq ($(findstring ap,$(CONFIG_WIFI_FUNCTION)), ap)
66WLAN_AP_FUNC=yes
67endif
68
69CFLAGS += -D__QRCODE_WIFI__
70CFLAGS += -D__USE_AES__
71
72ifeq ($(WLAN_STA_FUNC),yes)
73CFLAGS += -D__STA_FUNC__
74CFLAGS += -I$(zte_app_path)/wpa_supplicant-2.10/src/common
75LDLIBS += -lwpa_client -L$(zte_app_path)/wpa_supplicant-2.10/wpa_supplicant
76endif
77
78ifeq ($(WLAN_AP_FUNC),yes)
79CFLAGS += -D__AP_FUNC__
80ifneq ($(WLAN_STA_FUNC),yes)
81CFLAGS += -I$(zte_app_path)/hostapd-2.10/src/common
82LDLIBS += -lwpa_client -L$(zte_app_path)/hostapd-2.10/hostapd
83endif
84endif
85
86OBJS += ../zte_comm/wlan/src/wlan_main.o ../zte_comm/wlan/src/wifi_socket.o ../zte_comm/wlan/src/wlan_rtc_sleep.o ../zte_comm/wlan/src/wifi_drv_ko.o \
87 ../zte_comm/wlan/src/wifi_sta_ctrl.o ../zte_comm/wlan/src/wifi_util.o ../zte_comm/wlan/src/wlan_config_ssid.o ../zte_comm/wlan/src/wlan_netlink.o ../zte_comm/wlan/src/Vector.o
88ifeq ($(CONFIG_WIFI_MODULE),realtek)
89OBJS += ../zte_comm/wlan/src/wifi_hal.o
90 ifeq ($(WLAN_STA_FUNC),yes)
91 OBJS += ../zte_comm/wlan/src/wlan-station.o
92 endif
93LDLIBS += -lwlan_interface
94LDLIBS += -L$(zte_lib_path)/libwlan_interface
95else ifeq ($(CONFIG_WIFI_MODULE),rda5995)
96 ifeq ($(WLAN_STA_FUNC),yes)
97 OBJS += ../zte_comm/wlan/src/wlan_sta_manager.o ../zte_comm/wlan/src/wlan_sm.o
98 endif
99
100 ifeq ($(WLAN_AP_FUNC),yes)
101 OBJS += ../zte_comm/wlan/src/wifi_ap_ctrl.o
102LDLIBS += -lwlan_interface
103LDLIBS += -L$(zte_lib_path)/libwlan_interface
104 endif
105else ifeq ($(CONFIG_WIFI_MODULE),esp8089)
106 ifeq ($(WLAN_STA_FUNC),yes)
107 OBJS += ../zte_comm/wlan/src/wlan_sta_manager.o ../zte_comm/wlan/src/wlan_sm.o
108 endif
109
110 ifeq ($(WLAN_AP_FUNC),yes)
111 OBJS += ../zte_comm/wlan/src/wifi_ap_ctrl.o
112LDLIBS += -lwlan_interface
113LDLIBS += -L$(zte_lib_path)/libwlan_interface
114 endif
115else ifeq ($(CONFIG_WIFI_MODULE),xr819)
116 ifeq ($(WLAN_STA_FUNC),yes)
117 OBJS += ../zte_comm/wlan/src/wlan_sta_manager.o ../zte_comm/wlan/src/wlan_sm.o
118 endif
119
120 ifeq ($(WLAN_AP_FUNC),yes)
121 OBJS += ../zte_comm/wlan/src/wifi_ap_ctrl.o
122LDLIBS += -lwlan_interface
123LDLIBS += -L$(zte_lib_path)/libwlan_interface
124 endif
125else ifeq ($(CONFIG_WIFI_MODULE),ssv6x5x)
126 ifeq ($(WLAN_STA_FUNC),yes)
127 OBJS += ../zte_comm/wlan/src/wlan-station.o
128 endif
129
130 ifeq ($(WLAN_AP_FUNC),yes)
131 OBJS += ../zte_comm/wlan/src/wifi_ap_ctrl.o
132LDLIBS += -lwlan_interface
133LDLIBS += -L$(zte_lib_path)/libwlan_interface
134 endif
135else ifeq ($(CONFIG_WIFI_MODULE),aic8800)
136 ifeq ($(WLAN_STA_FUNC),yes)
137 OBJS += ../zte_comm/wlan/src/wlan-station.o
138 endif
139
140 ifeq ($(WLAN_AP_FUNC),yes)
141 OBJS += ../zte_comm/wlan/src/wifi_ap_ctrl.o
142LDLIBS += -lwlan_interface
143LDLIBS += -L$(zte_lib_path)/libwlan_interface
144 endif
145endif
146CFLAGS += -I../zte_comm/wlan/inc
147endif
148
lh9ed821d2023-04-07 01:36:19 -0700149OBJS1 = ../zte_comm/rtc-service/zte-rtc-clock.o
150OBJS2 = ../zte_comm/zte_mainctrl/router_msg_proxy.o
151#aes
152CFLAGS += -I$(zte_lib_path)/libssl/install/include
153LDLIBS += -L$(zte_lib_path)/libssl/install/lib -lcrypto
154ifeq ($(USE_DSDS_VSIM),yes)
155LDLIBS += -L$(zte_lib_path)/libvsim -lght_vsim
156CFLAGS += -DUSE_DSDS_VSIM
157endif
158
159#*******************************************************************************
160# include path
161#*******************************************************************************
162CFLAGS += -I./
163CFLAGS += -I../include
164CFLAGS += -I../zte_comm/nvserver
165CFLAGS += -I$(LIB_DIR)/libnvram
166CFLAGS += -I$(APP_DIR)/include
167CFLAGS += -g -Werror=implicit-function-declaration
168
169CFLAGS += -I../zte_comm/zte_hotplug
170CFLAGS += -I../zte_comm/at_ctl/inc
171CFLAGS += -I../zte_comm/at_ctl/src/phone/inc
172CFLAGS += -I$(zte_app_path)/include
173CFLAGS += -I$(zte_lib_path)/libatext
174CFLAGS += -I$(zte_lib_path)/libsqlite
175CFLAGS += -I$(zte_lib_path)/libnvram
176CFLAGS += -I$(LINUX_DIR)
177CFLAGS += -I$(zte_lib_path)/libzcore/std/inc/zCore/bl
178CFLAGS += -I$(zte_lib_path)/libzcore/std/inc/zCore/gui
179CFLAGS += -I$(CPU_PUB_ROOT)/project/zx297520v3/include/nv
180CFLAGS += -O -Dlinux=1 -DHIGH_SPEED=1
181
182
183CFLAGS += -I$(zte_lib_path)/libsoftap
184#CFLAGS += -I.
185
186
187CFLAGS += -I$(zte_lib_path)/libsoft_timer
188
189
190
191
192CFLAGS += -I../zte_comm/fota_dm/inc
193#CFLAGS += -I../zte_comm/fota_dm/gs_lib
194CFLAGS += -I../zte_comm/fota_dm/rs_lib
195CFLAGS += -I$(zte_lib_path)/libzte_dmapp/inc
196
197ifeq ($(USE_FOTA_AB),yes)
xf.li6c8fc1e2023-08-12 00:11:09 -0700198CFLAGS += -I$(LIB_DIR)/libflags
lh9ed821d2023-04-07 01:36:19 -0700199endif
200
201#*******************************************************************************
202# library
203#*******************************************************************************
204LDLIBS += -lnvram_sc -L$(zte_lib_path)/libnvram -lpthread
205ifeq ($(LINUX_TYPE),uClinux)
206LDFLAGS += -Wl,--allow-multiple-definition,-elf2flt=-s131072
207endif
208
209
210LDLIBS += -lsoftap -L$(zte_lib_path)/libsoftap
211LDLIBS += -lsoft_timer_sc -L$(zte_lib_path)/libsoft_timer
212LDLIBS += -latutils -L$(zte_lib_path)/libatutils
213LDLIBS += -lsqlite -L$(zte_lib_path)/libsqlite
xf.libdd93d52023-05-12 07:10:14 -0700214ifeq ($(USE_VOICE_AT),yes)
215LDLIBS += -ltinyalsa -L$(zte_lib_path)/libtinyalsa
216LDLIBS += -lvoice -L$(zte_lib_path)/libvoice
217endif
lh9ed821d2023-04-07 01:36:19 -0700218LDLIBS += -latext -L$(zte_lib_path)/libatext
219LDLIBS += -lm
220#LDLIBS += -ltinyalsa -L$(zte_lib_path)/libtinyalsa
221LDLIBS += -lcpnv -L$(zte_lib_path)/libcpnv
222LDLIBS += -lamt -L$(zte_lib_path)/libamt
223LDLIBS += -lkey -L$(zte_lib_path)/libkey
224
xf.lie31de8b2023-12-26 23:38:58 -0800225#LDLIBS += -lcurl -L$(zte_lib_path)/libcurl/install/lib
lh9ed821d2023-04-07 01:36:19 -0700226
227
228LDLIBS += -lztedmapp -L$(zte_lib_path)/libzte_dmapp
229#LIBSHARE_GS = ../zte_comm/fota_dm/gs_lib/libdmgr.so.1
230#LDLIBS += -L../zte_comm/fota_dm/gs_lib -ldmgr
231
232LIBSHARE_GS = ../zte_comm/fota_dm/rs_lib/librsdlsdk.so
233LDLIBS += -L../zte_comm/fota_dm/rs_lib -lrsdlsdk
234LDLIBS1 += -lnvram_sc -L$(zte_lib_path)/libnvram -lpthread
235LDLIBS1 += -lsoftap -L$(zte_lib_path)/libsoftap
236LDLIBS1 += -lsoft_timer_sc -L$(zte_lib_path)/libsoft_timer
237
238ifeq ($(USE_FOTA_AB),yes)
xf.li6c8fc1e2023-08-12 00:11:09 -0700239LDLIBS += -lflags -L$(zte_lib_path)/libflags
lh9ed821d2023-04-07 01:36:19 -0700240endif
241
242##############USER COMIZE END##################
243
244all: $(EXEC) $(EXEC1) $(EXEC2)
xf.li6c8fc1e2023-08-12 00:11:09 -0700245ifneq ($(tools_dir), )
246 for i in $(tools_dir) ; do $(MAKE) -C $$i || exit $?; done
247endif
lh9ed821d2023-04-07 01:36:19 -0700248 (cd ../zte_comm/fota_dm/gs_lib;rm libdmgr.so;ln -s libdmgr.so.1 libdmgr.so; cd ../../../zte_comm)
249
250$(EXEC): $(OBJS)
251 $(CC) $(LDFLAGS) -o $@ $(OBJS) -Wl,--start-group $(LDLIBS) -Wl,--end-group
252 @cp $@ $@.elf
253
254$(EXEC1): $(OBJS1)
255 $(CC) $(CFLAGS) -o $@ $(OBJS1) -Wl,--start-group $(LDLIBS1) -Wl,--end-group
256 @cp $@ $@.elf
257
258$(EXEC2): $(OBJS2)
259 $(CC) $(CFLAGS) -o $@ $(OBJS2) -Wl,--start-group $(LDLIBS1) -Wl,--end-group
260 @cp $@ $@.elf
261
262romfs:
263 $(ROMFSINST) /sbin/$(EXEC)
264 $(ROMFSINST) /sbin/$(EXEC1)
265 $(ROMFSINST) /sbin/$(EXEC2)
266 $(ROMFSINST) $(LIBSHARE_GS) /lib/
xf.li6c8fc1e2023-08-12 00:11:09 -0700267ifneq ($(tools_dir), )
268 for i in $(tools_dir) ; do $(MAKE) -C $$i romfs || exit $?; done
269endif
lh9ed821d2023-04-07 01:36:19 -0700270
271clean:
272 -rm -f $(EXEC) *.elf *.gdb *.o
273 -rm -f $(EXEC1) *.elf *.gdb *.o
274 -rm -f $(EXEC2) *.elf *.gdb *.o
275 -find ../zte_comm/ -name \*.o -exec rm -rf {} \;
276 -find . -name \*.o -exec rm -rf {} \;
xf.li6c8fc1e2023-08-12 00:11:09 -0700277ifneq ($(tools_dir), )
278 for i in $(tools_dir) ; do $(MAKE) -C $$i clean || exit $?; done
279endif
lh9ed821d2023-04-07 01:36:19 -0700280
281