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