blob: 8cfd9cab7849f22604603b76c32306c392912d95 [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)
wz.wanga4ae28c2024-03-18 13:31:52 +08007# zw.wang Wifi drives basic functions on 20240318 start
8include $(ZTE_PS_LINK_SCRIPT)
9CFLAGS += $(KERNEL_EXT_CFLAGS)
10# zw.wang Wifi drives basic functions on 20240318 end
lh9ed821d2023-04-07 01:36:19 -070011
12CPU_PUB_ROOT=$(TOPDIR_AP)/../pub
13##############USER COMIZE BEGIN################
14EXEC = zte_mdl
15EXEC1 = zte-rtc-clock
16EXEC2 = router_msg_proxy
17OBJS = zte_mdl.o \
18 $(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)) \
19 ../zte_comm/rtc-service/rtc-service.o \
20 $(filter-out ../zte_comm/zte_mainctrl/router_msg_proxy.o,$(patsubst %.c,%.o,$(wildcard ../zte_comm/zte_mainctrl/*.c))) \
21 ../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 \
22 $(patsubst %.c,%.o,$(wildcard ../zte_comm/zte_drv_ctrl/usb/*.c ../zte_comm/zte_drv_ctrl/serial/*.c)) \
23 ../zte_comm/sntp/sntp.o \
24 $(patsubst %.c,%.o,$(wildcard ../zte_comm/fota_dm/src/*.c ))
25
26ifeq ($(USE_VEHICLE_DC),yes)
27OBJS += ../zte_comm/nvserver/nvserver_rpc.o ../zte_comm/nvserver/sc_rpc.o ../zte_comm/nvserver/file.o
28else
29OBJS += ../zte_comm/nvserver/nvserver.o ../zte_comm/nvserver/nvupdate.o
30endif
31
xf.li6c8fc1e2023-08-12 00:11:09 -070032ifeq ($(USE_VEHICLE_DC_REF),yes)
33#wifi
34ifeq ($(CONFIG_WIFI_MODULE),realtek)
35CFLAGS += -D__REALTEK_8192_CHIP__
36ifeq ($(CONFIG_WIFI_RTL_WPA2),yes)
37tools_dir += ../zte_comm/wlan/realtek_tools_wpa2/auth ../zte_comm/wlan/realtek_tools_wpa2/mini_upnp ../zte_comm/wlan/realtek_tools_wpa2/utility
38tools_dir += ../zte_comm/wlan/realtek_tools_wpa2/wsc ../zte_comm/wlan/realtek_tools_wpa2/wireless_tools.25
39else
40tools_dir += ../zte_comm/wlan/realtek_tools/auth ../zte_comm/wlan/realtek_tools/mini_upnp ../zte_comm/wlan/realtek_tools/utility
41tools_dir += ../zte_comm/wlan/realtek_tools/wsc ../zte_comm/wlan/realtek_tools/wireless_tools.25
42endif
43else ifeq ($(CONFIG_WIFI_MODULE),rda5995)
44CFLAGS += -D__RDA_5995_CHIP__
45tools_dir += ../zte_comm/wlan/rda_tools
46else ifeq ($(CONFIG_WIFI_MODULE),esp8089)
47CFLAGS += -D__ESP_8089_CHIP__
48tools_dir += ../zte_comm/wlan/esp_tools/eagle_test ../zte_comm/wlan/esp_tools/fcctest
49else ifeq ($(CONFIG_WIFI_MODULE),xr819)
50CFLAGS += -D__XR_819_CHIP__
51#tools_dir +=
52else ifeq ($(CONFIG_WIFI_MODULE),ssv6x5x)
53CFLAGS += -D__SSV_6X5X_CHIP__
54#tools_dir +=
55else ifeq ($(CONFIG_WIFI_MODULE),aic8800)
56CFLAGS += -D__AIC_8800DW_CHIP__
zw.wangc08ce042024-08-08 18:42:05 +080057ifeq ($(CONFIG_WIFI_SUB_MODULE), d80)
58tools_dir += ../zte_comm/wlan/aic_tools/aicrf_test_d80
59CFLAGS += -D__AIC_8800_D80L__
60else
xf.li6c8fc1e2023-08-12 00:11:09 -070061tools_dir += ../zte_comm/wlan/aic_tools/rftest
zw.wangc08ce042024-08-08 18:42:05 +080062endif
xf.li6c8fc1e2023-08-12 00:11:09 -070063ifeq ($(CONFIG_WIFI_SINGLEAP), no)
64CFLAGS += -D__MULTI_AP__
65endif
66endif
67
68$(warning CONFIG_WIFI_FUNCTION=$(CONFIG_WIFI_FUNCTION))
69
70ifeq ($(findstring sta,$(CONFIG_WIFI_FUNCTION)), sta)
71WLAN_STA_FUNC=yes
72endif
73
74ifeq ($(findstring ap,$(CONFIG_WIFI_FUNCTION)), ap)
75WLAN_AP_FUNC=yes
76endif
77
78CFLAGS += -D__QRCODE_WIFI__
79CFLAGS += -D__USE_AES__
wz.wang8fa01fb2024-05-08 18:37:26 +080080# zw.wang WiFi for MAC is obtained from firmware and set on 20240508 start
81CFLAGS += -DCONFIG_WIFI_EFUSE_MAC
82# zw.wang WiFi for MAC is obtained from firmware and set on 20240508 end
xf.li6c8fc1e2023-08-12 00:11:09 -070083
84ifeq ($(WLAN_STA_FUNC),yes)
85CFLAGS += -D__STA_FUNC__
86CFLAGS += -I$(zte_app_path)/wpa_supplicant-2.10/src/common
87LDLIBS += -lwpa_client -L$(zte_app_path)/wpa_supplicant-2.10/wpa_supplicant
88endif
89
90ifeq ($(WLAN_AP_FUNC),yes)
91CFLAGS += -D__AP_FUNC__
92ifneq ($(WLAN_STA_FUNC),yes)
93CFLAGS += -I$(zte_app_path)/hostapd-2.10/src/common
94LDLIBS += -lwpa_client -L$(zte_app_path)/hostapd-2.10/hostapd
95endif
96endif
97
98OBJS += ../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 \
99 ../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
100ifeq ($(CONFIG_WIFI_MODULE),realtek)
101OBJS += ../zte_comm/wlan/src/wifi_hal.o
102 ifeq ($(WLAN_STA_FUNC),yes)
103 OBJS += ../zte_comm/wlan/src/wlan-station.o
104 endif
105LDLIBS += -lwlan_interface
106LDLIBS += -L$(zte_lib_path)/libwlan_interface
107else ifeq ($(CONFIG_WIFI_MODULE),rda5995)
108 ifeq ($(WLAN_STA_FUNC),yes)
109 OBJS += ../zte_comm/wlan/src/wlan_sta_manager.o ../zte_comm/wlan/src/wlan_sm.o
110 endif
111
112 ifeq ($(WLAN_AP_FUNC),yes)
113 OBJS += ../zte_comm/wlan/src/wifi_ap_ctrl.o
114LDLIBS += -lwlan_interface
115LDLIBS += -L$(zte_lib_path)/libwlan_interface
116 endif
117else ifeq ($(CONFIG_WIFI_MODULE),esp8089)
118 ifeq ($(WLAN_STA_FUNC),yes)
119 OBJS += ../zte_comm/wlan/src/wlan_sta_manager.o ../zte_comm/wlan/src/wlan_sm.o
120 endif
121
122 ifeq ($(WLAN_AP_FUNC),yes)
123 OBJS += ../zte_comm/wlan/src/wifi_ap_ctrl.o
124LDLIBS += -lwlan_interface
125LDLIBS += -L$(zte_lib_path)/libwlan_interface
126 endif
127else ifeq ($(CONFIG_WIFI_MODULE),xr819)
128 ifeq ($(WLAN_STA_FUNC),yes)
129 OBJS += ../zte_comm/wlan/src/wlan_sta_manager.o ../zte_comm/wlan/src/wlan_sm.o
130 endif
131
132 ifeq ($(WLAN_AP_FUNC),yes)
133 OBJS += ../zte_comm/wlan/src/wifi_ap_ctrl.o
134LDLIBS += -lwlan_interface
135LDLIBS += -L$(zte_lib_path)/libwlan_interface
136 endif
137else ifeq ($(CONFIG_WIFI_MODULE),ssv6x5x)
138 ifeq ($(WLAN_STA_FUNC),yes)
139 OBJS += ../zte_comm/wlan/src/wlan-station.o
140 endif
141
142 ifeq ($(WLAN_AP_FUNC),yes)
143 OBJS += ../zte_comm/wlan/src/wifi_ap_ctrl.o
144LDLIBS += -lwlan_interface
145LDLIBS += -L$(zte_lib_path)/libwlan_interface
146 endif
147else ifeq ($(CONFIG_WIFI_MODULE),aic8800)
148 ifeq ($(WLAN_STA_FUNC),yes)
149 OBJS += ../zte_comm/wlan/src/wlan-station.o
150 endif
151
152 ifeq ($(WLAN_AP_FUNC),yes)
153 OBJS += ../zte_comm/wlan/src/wifi_ap_ctrl.o
154LDLIBS += -lwlan_interface
155LDLIBS += -L$(zte_lib_path)/libwlan_interface
156 endif
157endif
158CFLAGS += -I../zte_comm/wlan/inc
159endif
160
lh9ed821d2023-04-07 01:36:19 -0700161OBJS1 = ../zte_comm/rtc-service/zte-rtc-clock.o
162OBJS2 = ../zte_comm/zte_mainctrl/router_msg_proxy.o
163#aes
164CFLAGS += -I$(zte_lib_path)/libssl/install/include
165LDLIBS += -L$(zte_lib_path)/libssl/install/lib -lcrypto
166ifeq ($(USE_DSDS_VSIM),yes)
167LDLIBS += -L$(zte_lib_path)/libvsim -lght_vsim
168CFLAGS += -DUSE_DSDS_VSIM
169endif
170
171#*******************************************************************************
172# include path
173#*******************************************************************************
174CFLAGS += -I./
175CFLAGS += -I../include
176CFLAGS += -I../zte_comm/nvserver
177CFLAGS += -I$(LIB_DIR)/libnvram
178CFLAGS += -I$(APP_DIR)/include
179CFLAGS += -g -Werror=implicit-function-declaration
180
181CFLAGS += -I../zte_comm/zte_hotplug
182CFLAGS += -I../zte_comm/at_ctl/inc
183CFLAGS += -I../zte_comm/at_ctl/src/phone/inc
184CFLAGS += -I$(zte_app_path)/include
185CFLAGS += -I$(zte_lib_path)/libatext
186CFLAGS += -I$(zte_lib_path)/libsqlite
187CFLAGS += -I$(zte_lib_path)/libnvram
188CFLAGS += -I$(LINUX_DIR)
189CFLAGS += -I$(zte_lib_path)/libzcore/std/inc/zCore/bl
190CFLAGS += -I$(zte_lib_path)/libzcore/std/inc/zCore/gui
191CFLAGS += -I$(CPU_PUB_ROOT)/project/zx297520v3/include/nv
192CFLAGS += -O -Dlinux=1 -DHIGH_SPEED=1
193
194
195CFLAGS += -I$(zte_lib_path)/libsoftap
196#CFLAGS += -I.
197
198
199CFLAGS += -I$(zte_lib_path)/libsoft_timer
200
201
202
203
204CFLAGS += -I../zte_comm/fota_dm/inc
205#CFLAGS += -I../zte_comm/fota_dm/gs_lib
206CFLAGS += -I../zte_comm/fota_dm/rs_lib
207CFLAGS += -I$(zte_lib_path)/libzte_dmapp/inc
208
209ifeq ($(USE_FOTA_AB),yes)
xf.li6c8fc1e2023-08-12 00:11:09 -0700210CFLAGS += -I$(LIB_DIR)/libflags
lh9ed821d2023-04-07 01:36:19 -0700211endif
212
213#*******************************************************************************
214# library
215#*******************************************************************************
216LDLIBS += -lnvram_sc -L$(zte_lib_path)/libnvram -lpthread
217ifeq ($(LINUX_TYPE),uClinux)
218LDFLAGS += -Wl,--allow-multiple-definition,-elf2flt=-s131072
219endif
220
221
222LDLIBS += -lsoftap -L$(zte_lib_path)/libsoftap
223LDLIBS += -lsoft_timer_sc -L$(zte_lib_path)/libsoft_timer
224LDLIBS += -latutils -L$(zte_lib_path)/libatutils
225LDLIBS += -lsqlite -L$(zte_lib_path)/libsqlite
xf.libdd93d52023-05-12 07:10:14 -0700226ifeq ($(USE_VOICE_AT),yes)
227LDLIBS += -ltinyalsa -L$(zte_lib_path)/libtinyalsa
228LDLIBS += -lvoice -L$(zte_lib_path)/libvoice
229endif
lh9ed821d2023-04-07 01:36:19 -0700230LDLIBS += -latext -L$(zte_lib_path)/libatext
231LDLIBS += -lm
232#LDLIBS += -ltinyalsa -L$(zte_lib_path)/libtinyalsa
233LDLIBS += -lcpnv -L$(zte_lib_path)/libcpnv
234LDLIBS += -lamt -L$(zte_lib_path)/libamt
235LDLIBS += -lkey -L$(zte_lib_path)/libkey
236
xf.lie31de8b2023-12-26 23:38:58 -0800237#LDLIBS += -lcurl -L$(zte_lib_path)/libcurl/install/lib
lh9ed821d2023-04-07 01:36:19 -0700238
239
240LDLIBS += -lztedmapp -L$(zte_lib_path)/libzte_dmapp
241#LIBSHARE_GS = ../zte_comm/fota_dm/gs_lib/libdmgr.so.1
242#LDLIBS += -L../zte_comm/fota_dm/gs_lib -ldmgr
243
244LIBSHARE_GS = ../zte_comm/fota_dm/rs_lib/librsdlsdk.so
245LDLIBS += -L../zte_comm/fota_dm/rs_lib -lrsdlsdk
246LDLIBS1 += -lnvram_sc -L$(zte_lib_path)/libnvram -lpthread
247LDLIBS1 += -lsoftap -L$(zte_lib_path)/libsoftap
248LDLIBS1 += -lsoft_timer_sc -L$(zte_lib_path)/libsoft_timer
249
250ifeq ($(USE_FOTA_AB),yes)
xf.li6c8fc1e2023-08-12 00:11:09 -0700251LDLIBS += -lflags -L$(zte_lib_path)/libflags
lh9ed821d2023-04-07 01:36:19 -0700252endif
253
zw.wangc08ce042024-08-08 18:42:05 +0800254ifeq ($(USE_ZXIC_DEBUG_INFO),yes)
255LDLIBS += -ldebug_info -L$(zte_lib_path)/libdebug_info
256endif
257
lh9ed821d2023-04-07 01:36:19 -0700258##############USER COMIZE END##################
259
260all: $(EXEC) $(EXEC1) $(EXEC2)
xf.li6c8fc1e2023-08-12 00:11:09 -0700261ifneq ($(tools_dir), )
262 for i in $(tools_dir) ; do $(MAKE) -C $$i || exit $?; done
263endif
lh9ed821d2023-04-07 01:36:19 -0700264 (cd ../zte_comm/fota_dm/gs_lib;rm libdmgr.so;ln -s libdmgr.so.1 libdmgr.so; cd ../../../zte_comm)
265
266$(EXEC): $(OBJS)
267 $(CC) $(LDFLAGS) -o $@ $(OBJS) -Wl,--start-group $(LDLIBS) -Wl,--end-group
268 @cp $@ $@.elf
269
270$(EXEC1): $(OBJS1)
271 $(CC) $(CFLAGS) -o $@ $(OBJS1) -Wl,--start-group $(LDLIBS1) -Wl,--end-group
272 @cp $@ $@.elf
273
274$(EXEC2): $(OBJS2)
275 $(CC) $(CFLAGS) -o $@ $(OBJS2) -Wl,--start-group $(LDLIBS1) -Wl,--end-group
276 @cp $@ $@.elf
277
278romfs:
279 $(ROMFSINST) /sbin/$(EXEC)
280 $(ROMFSINST) /sbin/$(EXEC1)
281 $(ROMFSINST) /sbin/$(EXEC2)
282 $(ROMFSINST) $(LIBSHARE_GS) /lib/
xf.li6c8fc1e2023-08-12 00:11:09 -0700283ifneq ($(tools_dir), )
284 for i in $(tools_dir) ; do $(MAKE) -C $$i romfs || exit $?; done
285endif
lh9ed821d2023-04-07 01:36:19 -0700286
287clean:
288 -rm -f $(EXEC) *.elf *.gdb *.o
289 -rm -f $(EXEC1) *.elf *.gdb *.o
290 -rm -f $(EXEC2) *.elf *.gdb *.o
291 -find ../zte_comm/ -name \*.o -exec rm -rf {} \;
292 -find . -name \*.o -exec rm -rf {} \;
xf.li6c8fc1e2023-08-12 00:11:09 -0700293ifneq ($(tools_dir), )
294 for i in $(tools_dir) ; do $(MAKE) -C $$i clean || exit $?; done
295endif
lh9ed821d2023-04-07 01:36:19 -0700296
297