blob: 7cd997dde4a34611cbcde29e0cc278dff0903b7b [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__
57tools_dir += ../zte_comm/wlan/aic_tools/rftest
58ifeq ($(CONFIG_WIFI_SINGLEAP), no)
59CFLAGS += -D__MULTI_AP__
60endif
61endif
62
63$(warning CONFIG_WIFI_FUNCTION=$(CONFIG_WIFI_FUNCTION))
64
65ifeq ($(findstring sta,$(CONFIG_WIFI_FUNCTION)), sta)
66WLAN_STA_FUNC=yes
67endif
68
69ifeq ($(findstring ap,$(CONFIG_WIFI_FUNCTION)), ap)
70WLAN_AP_FUNC=yes
71endif
72
73CFLAGS += -D__QRCODE_WIFI__
74CFLAGS += -D__USE_AES__
75
76ifeq ($(WLAN_STA_FUNC),yes)
77CFLAGS += -D__STA_FUNC__
78CFLAGS += -I$(zte_app_path)/wpa_supplicant-2.10/src/common
79LDLIBS += -lwpa_client -L$(zte_app_path)/wpa_supplicant-2.10/wpa_supplicant
80endif
81
82ifeq ($(WLAN_AP_FUNC),yes)
83CFLAGS += -D__AP_FUNC__
84ifneq ($(WLAN_STA_FUNC),yes)
85CFLAGS += -I$(zte_app_path)/hostapd-2.10/src/common
86LDLIBS += -lwpa_client -L$(zte_app_path)/hostapd-2.10/hostapd
87endif
88endif
89
90OBJS += ../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 \
91 ../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
92ifeq ($(CONFIG_WIFI_MODULE),realtek)
93OBJS += ../zte_comm/wlan/src/wifi_hal.o
94 ifeq ($(WLAN_STA_FUNC),yes)
95 OBJS += ../zte_comm/wlan/src/wlan-station.o
96 endif
97LDLIBS += -lwlan_interface
98LDLIBS += -L$(zte_lib_path)/libwlan_interface
99else ifeq ($(CONFIG_WIFI_MODULE),rda5995)
100 ifeq ($(WLAN_STA_FUNC),yes)
101 OBJS += ../zte_comm/wlan/src/wlan_sta_manager.o ../zte_comm/wlan/src/wlan_sm.o
102 endif
103
104 ifeq ($(WLAN_AP_FUNC),yes)
105 OBJS += ../zte_comm/wlan/src/wifi_ap_ctrl.o
106LDLIBS += -lwlan_interface
107LDLIBS += -L$(zte_lib_path)/libwlan_interface
108 endif
109else ifeq ($(CONFIG_WIFI_MODULE),esp8089)
110 ifeq ($(WLAN_STA_FUNC),yes)
111 OBJS += ../zte_comm/wlan/src/wlan_sta_manager.o ../zte_comm/wlan/src/wlan_sm.o
112 endif
113
114 ifeq ($(WLAN_AP_FUNC),yes)
115 OBJS += ../zte_comm/wlan/src/wifi_ap_ctrl.o
116LDLIBS += -lwlan_interface
117LDLIBS += -L$(zte_lib_path)/libwlan_interface
118 endif
119else ifeq ($(CONFIG_WIFI_MODULE),xr819)
120 ifeq ($(WLAN_STA_FUNC),yes)
121 OBJS += ../zte_comm/wlan/src/wlan_sta_manager.o ../zte_comm/wlan/src/wlan_sm.o
122 endif
123
124 ifeq ($(WLAN_AP_FUNC),yes)
125 OBJS += ../zte_comm/wlan/src/wifi_ap_ctrl.o
126LDLIBS += -lwlan_interface
127LDLIBS += -L$(zte_lib_path)/libwlan_interface
128 endif
129else ifeq ($(CONFIG_WIFI_MODULE),ssv6x5x)
130 ifeq ($(WLAN_STA_FUNC),yes)
131 OBJS += ../zte_comm/wlan/src/wlan-station.o
132 endif
133
134 ifeq ($(WLAN_AP_FUNC),yes)
135 OBJS += ../zte_comm/wlan/src/wifi_ap_ctrl.o
136LDLIBS += -lwlan_interface
137LDLIBS += -L$(zte_lib_path)/libwlan_interface
138 endif
139else ifeq ($(CONFIG_WIFI_MODULE),aic8800)
140 ifeq ($(WLAN_STA_FUNC),yes)
141 OBJS += ../zte_comm/wlan/src/wlan-station.o
142 endif
143
144 ifeq ($(WLAN_AP_FUNC),yes)
145 OBJS += ../zte_comm/wlan/src/wifi_ap_ctrl.o
146LDLIBS += -lwlan_interface
147LDLIBS += -L$(zte_lib_path)/libwlan_interface
148 endif
149endif
150CFLAGS += -I../zte_comm/wlan/inc
151endif
152
lh9ed821d2023-04-07 01:36:19 -0700153OBJS1 = ../zte_comm/rtc-service/zte-rtc-clock.o
154OBJS2 = ../zte_comm/zte_mainctrl/router_msg_proxy.o
155#aes
156CFLAGS += -I$(zte_lib_path)/libssl/install/include
157LDLIBS += -L$(zte_lib_path)/libssl/install/lib -lcrypto
158ifeq ($(USE_DSDS_VSIM),yes)
159LDLIBS += -L$(zte_lib_path)/libvsim -lght_vsim
160CFLAGS += -DUSE_DSDS_VSIM
161endif
162
163#*******************************************************************************
164# include path
165#*******************************************************************************
166CFLAGS += -I./
167CFLAGS += -I../include
168CFLAGS += -I../zte_comm/nvserver
169CFLAGS += -I$(LIB_DIR)/libnvram
170CFLAGS += -I$(APP_DIR)/include
171CFLAGS += -g -Werror=implicit-function-declaration
172
173CFLAGS += -I../zte_comm/zte_hotplug
174CFLAGS += -I../zte_comm/at_ctl/inc
175CFLAGS += -I../zte_comm/at_ctl/src/phone/inc
176CFLAGS += -I$(zte_app_path)/include
177CFLAGS += -I$(zte_lib_path)/libatext
178CFLAGS += -I$(zte_lib_path)/libsqlite
179CFLAGS += -I$(zte_lib_path)/libnvram
180CFLAGS += -I$(LINUX_DIR)
181CFLAGS += -I$(zte_lib_path)/libzcore/std/inc/zCore/bl
182CFLAGS += -I$(zte_lib_path)/libzcore/std/inc/zCore/gui
183CFLAGS += -I$(CPU_PUB_ROOT)/project/zx297520v3/include/nv
184CFLAGS += -O -Dlinux=1 -DHIGH_SPEED=1
185
186
187CFLAGS += -I$(zte_lib_path)/libsoftap
188#CFLAGS += -I.
189
190
191CFLAGS += -I$(zte_lib_path)/libsoft_timer
192
193
194
195
196CFLAGS += -I../zte_comm/fota_dm/inc
197#CFLAGS += -I../zte_comm/fota_dm/gs_lib
198CFLAGS += -I../zte_comm/fota_dm/rs_lib
199CFLAGS += -I$(zte_lib_path)/libzte_dmapp/inc
200
201ifeq ($(USE_FOTA_AB),yes)
xf.li6c8fc1e2023-08-12 00:11:09 -0700202CFLAGS += -I$(LIB_DIR)/libflags
lh9ed821d2023-04-07 01:36:19 -0700203endif
204
205#*******************************************************************************
206# library
207#*******************************************************************************
208LDLIBS += -lnvram_sc -L$(zte_lib_path)/libnvram -lpthread
209ifeq ($(LINUX_TYPE),uClinux)
210LDFLAGS += -Wl,--allow-multiple-definition,-elf2flt=-s131072
211endif
212
213
214LDLIBS += -lsoftap -L$(zte_lib_path)/libsoftap
215LDLIBS += -lsoft_timer_sc -L$(zte_lib_path)/libsoft_timer
216LDLIBS += -latutils -L$(zte_lib_path)/libatutils
217LDLIBS += -lsqlite -L$(zte_lib_path)/libsqlite
xf.libdd93d52023-05-12 07:10:14 -0700218ifeq ($(USE_VOICE_AT),yes)
219LDLIBS += -ltinyalsa -L$(zte_lib_path)/libtinyalsa
220LDLIBS += -lvoice -L$(zte_lib_path)/libvoice
221endif
lh9ed821d2023-04-07 01:36:19 -0700222LDLIBS += -latext -L$(zte_lib_path)/libatext
223LDLIBS += -lm
224#LDLIBS += -ltinyalsa -L$(zte_lib_path)/libtinyalsa
225LDLIBS += -lcpnv -L$(zte_lib_path)/libcpnv
226LDLIBS += -lamt -L$(zte_lib_path)/libamt
227LDLIBS += -lkey -L$(zte_lib_path)/libkey
228
xf.lie31de8b2023-12-26 23:38:58 -0800229#LDLIBS += -lcurl -L$(zte_lib_path)/libcurl/install/lib
lh9ed821d2023-04-07 01:36:19 -0700230
231
232LDLIBS += -lztedmapp -L$(zte_lib_path)/libzte_dmapp
233#LIBSHARE_GS = ../zte_comm/fota_dm/gs_lib/libdmgr.so.1
234#LDLIBS += -L../zte_comm/fota_dm/gs_lib -ldmgr
235
236LIBSHARE_GS = ../zte_comm/fota_dm/rs_lib/librsdlsdk.so
237LDLIBS += -L../zte_comm/fota_dm/rs_lib -lrsdlsdk
238LDLIBS1 += -lnvram_sc -L$(zte_lib_path)/libnvram -lpthread
239LDLIBS1 += -lsoftap -L$(zte_lib_path)/libsoftap
240LDLIBS1 += -lsoft_timer_sc -L$(zte_lib_path)/libsoft_timer
241
242ifeq ($(USE_FOTA_AB),yes)
xf.li6c8fc1e2023-08-12 00:11:09 -0700243LDLIBS += -lflags -L$(zte_lib_path)/libflags
lh9ed821d2023-04-07 01:36:19 -0700244endif
245
246##############USER COMIZE END##################
247
248all: $(EXEC) $(EXEC1) $(EXEC2)
xf.li6c8fc1e2023-08-12 00:11:09 -0700249ifneq ($(tools_dir), )
250 for i in $(tools_dir) ; do $(MAKE) -C $$i || exit $?; done
251endif
lh9ed821d2023-04-07 01:36:19 -0700252 (cd ../zte_comm/fota_dm/gs_lib;rm libdmgr.so;ln -s libdmgr.so.1 libdmgr.so; cd ../../../zte_comm)
253
254$(EXEC): $(OBJS)
255 $(CC) $(LDFLAGS) -o $@ $(OBJS) -Wl,--start-group $(LDLIBS) -Wl,--end-group
256 @cp $@ $@.elf
257
258$(EXEC1): $(OBJS1)
259 $(CC) $(CFLAGS) -o $@ $(OBJS1) -Wl,--start-group $(LDLIBS1) -Wl,--end-group
260 @cp $@ $@.elf
261
262$(EXEC2): $(OBJS2)
263 $(CC) $(CFLAGS) -o $@ $(OBJS2) -Wl,--start-group $(LDLIBS1) -Wl,--end-group
264 @cp $@ $@.elf
265
266romfs:
267 $(ROMFSINST) /sbin/$(EXEC)
268 $(ROMFSINST) /sbin/$(EXEC1)
269 $(ROMFSINST) /sbin/$(EXEC2)
270 $(ROMFSINST) $(LIBSHARE_GS) /lib/
xf.li6c8fc1e2023-08-12 00:11:09 -0700271ifneq ($(tools_dir), )
272 for i in $(tools_dir) ; do $(MAKE) -C $$i romfs || exit $?; done
273endif
lh9ed821d2023-04-07 01:36:19 -0700274
275clean:
276 -rm -f $(EXEC) *.elf *.gdb *.o
277 -rm -f $(EXEC1) *.elf *.gdb *.o
278 -rm -f $(EXEC2) *.elf *.gdb *.o
279 -find ../zte_comm/ -name \*.o -exec rm -rf {} \;
280 -find . -name \*.o -exec rm -rf {} \;
xf.li6c8fc1e2023-08-12 00:11:09 -0700281ifneq ($(tools_dir), )
282 for i in $(tools_dir) ; do $(MAKE) -C $$i clean || exit $?; done
283endif
lh9ed821d2023-04-07 01:36:19 -0700284
285