blob: 1d7011bbf0a424ac2281096443d283b986698b78 [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_mifi
11EXEC1 = zte-rtc-clock
12EXEC2 = router_msg_proxy
13OBJS = zte_mifi.o ../zte_comm/nvserver/nvserver.o ../zte_comm/nvserver/nvupdate.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 \
18 $(patsubst %.c,%.o,$(wildcard ../zte_comm/zte_drv_ctrl/usb/*.c ../zte_comm/zte_drv_ctrl/serial/*.c)) \
19 ../zte_comm/fluxstat/fluxstat.o \
20 ../zte_comm/sntp/sntp.o \
21 ../zte_comm/sd_hotplug/sd_hotplug.o ../zte_comm/sd_hotplug/sd_httpshare.o \
22 $(patsubst %.c,%.o,$(wildcard ../zte_comm/sms/src/*.c )) \
23 $(patsubst %.c,%.o,$(wildcard ../zte_comm/fota_dm/src/*.c )) \
24# $(patsubst %.c,%.o,$(wildcard ../zte_comm/phonebook/src/*.c )) ../zte_comm/zte_audio_ctrl/audio_res_ctrl.o
25
26OBJS1 = ../zte_comm/rtc-service/zte-rtc-clock.o
27OBJS2 = ../zte_comm/zte_mainctrl/router_msg_proxy.o
28
29ZTE_MMI_DEP = zte_mmi_app
30ZTE_MMI_TOBJS = mmi_adapter.o mmi.o mmi_battery.o mmi_net.o mmi_wifi.o mmi_tip.o mmi_sms.o mmi_lcd_page.o mmi_lcd.o mmi_lcd_init.o mmi_ctrl.o \
31 mmi_keystrokes.o mmi_lcd_timer.o mmi_led.o mmi_led_init.o mmi_led_adapter.o mmi_poweroff_charger.o mmi_traffic.o mmi_fota.o mmi_msg.o \
32 mmi_cfg.o mmi_poweroff.o mmi_battery_adapter.o mmi_mo.o mmi_mo_en.o mmi_mo_zh.o mmi_voip.o mmi_plat_adapter.o
33ZTE_MMI_OBJS = $(addprefix ../zte_comm/zte_mmi/,$(ZTE_MMI_TOBJS))
34
35ZTE_LOCKNET_DEP = zte_locknet_app
36ZTE_LOCKNET_OBJS = $(patsubst %.c,%.o,$(wildcard ../zte_comm/zte_locknet/src/*.c ))
37
38ZTE_WATCHDOG_DEP = zte_watchdog_app
39ZTE_WATCHDOG_TOBJS = watchdog.o watchdog_adapter.o watchdog_battery.o
40ZTE_WATCHDOG_OBJS = $(addprefix ../zte_comm/zte_watchdog/,$(ZTE_WATCHDOG_TOBJS))
41
42#wifi
43ifeq ($(CONFIG_WIFI_MODULE),realtek)
44CFLAGS += -D__REALTEK_8192_CHIP__
45ifeq ($(CONFIG_WIFI_RTL_WPA2),yes)
46tools_dir += ../zte_comm/wlan/realtek_tools_wpa2/auth ../zte_comm/wlan/realtek_tools_wpa2/mini_upnp ../zte_comm/wlan/realtek_tools_wpa2/utility
47tools_dir += ../zte_comm/wlan/realtek_tools_wpa2/wsc ../zte_comm/wlan/realtek_tools_wpa2/wireless_tools.25
48else
49tools_dir += ../zte_comm/wlan/realtek_tools/auth ../zte_comm/wlan/realtek_tools/mini_upnp ../zte_comm/wlan/realtek_tools/utility
50tools_dir += ../zte_comm/wlan/realtek_tools/wsc ../zte_comm/wlan/realtek_tools/wireless_tools.25
51endif
52else ifeq ($(CONFIG_WIFI_MODULE),rda5995)
53CFLAGS += -D__RDA_5995_CHIP__
54tools_dir += ../zte_comm/wlan/rda_tools
55else ifeq ($(CONFIG_WIFI_MODULE),esp8089)
56CFLAGS += -D__ESP_8089_CHIP__
57tools_dir += ../zte_comm/wlan/esp_tools/eagle_test ../zte_comm/wlan/esp_tools/fcctest
58else ifeq ($(CONFIG_WIFI_MODULE),xr819)
59CFLAGS += -D__XR_819_CHIP__
60#tools_dir +=
61else ifeq ($(CONFIG_WIFI_MODULE),ssv6x5x)
62CFLAGS += -D__SSV_6X5X_CHIP__
63#tools_dir +=
64else ifeq ($(CONFIG_WIFI_MODULE),aic8800)
65CFLAGS += -D__AIC_8800DW_CHIP__
66tools_dir += ../zte_comm/wlan/aic_tools/rftest
67ifeq ($(CONFIG_WIFI_SINGLEAP), no)
68CFLAGS += -D__MULTI_AP__
69endif
70endif
71
72$(warning CONFIG_WIFI_FUNCTION=$(CONFIG_WIFI_FUNCTION))
73
74ifeq ($(findstring sta,$(CONFIG_WIFI_FUNCTION)), sta)
75WLAN_STA_FUNC=yes
76endif
77
78ifeq ($(findstring ap,$(CONFIG_WIFI_FUNCTION)), ap)
79WLAN_AP_FUNC=yes
80endif
81
82CFLAGS += -D__QRCODE_WIFI__
83CFLAGS += -D__USE_AES__
84
85ifeq ($(WLAN_STA_FUNC),yes)
86CFLAGS += -D__STA_FUNC__
lh9ed821d2023-04-07 01:36:19 -070087CFLAGS += -I$(zte_app_path)/wpa_supplicant-2.10/src/common
88LDLIBS += -lwpa_client -L$(zte_app_path)/wpa_supplicant-2.10/wpa_supplicant
lh9ed821d2023-04-07 01:36:19 -070089endif
xf.li6c8fc1e2023-08-12 00:11:09 -070090
lh9ed821d2023-04-07 01:36:19 -070091ifeq ($(WLAN_AP_FUNC),yes)
92CFLAGS += -D__AP_FUNC__
xf.li6c8fc1e2023-08-12 00:11:09 -070093ifneq ($(WLAN_STA_FUNC),yes)
lh9ed821d2023-04-07 01:36:19 -070094CFLAGS += -I$(zte_app_path)/hostapd-2.10/src/common
95LDLIBS += -lwpa_client -L$(zte_app_path)/hostapd-2.10/hostapd
lh9ed821d2023-04-07 01:36:19 -070096endif
97endif
98
99OBJS += ../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 \
100 ../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
101ifeq ($(CONFIG_WIFI_MODULE),realtek)
102OBJS += ../zte_comm/wlan/src/wifi_hal.o
103 ifeq ($(WLAN_STA_FUNC),yes)
104 OBJS += ../zte_comm/wlan/src/wlan-station.o
105 endif
106LDLIBS += -lwlan_interface
107LDLIBS += -L$(zte_lib_path)/libwlan_interface
108else ifeq ($(CONFIG_WIFI_MODULE),rda5995)
109 ifeq ($(WLAN_STA_FUNC),yes)
110 OBJS += ../zte_comm/wlan/src/wlan_sta_manager.o ../zte_comm/wlan/src/wlan_sm.o
111 endif
112
113 ifeq ($(WLAN_AP_FUNC),yes)
114 OBJS += ../zte_comm/wlan/src/wifi_ap_ctrl.o
115LDLIBS += -lwlan_interface
116LDLIBS += -L$(zte_lib_path)/libwlan_interface
117 endif
118else ifeq ($(CONFIG_WIFI_MODULE),esp8089)
119 ifeq ($(WLAN_STA_FUNC),yes)
120 OBJS += ../zte_comm/wlan/src/wlan_sta_manager.o ../zte_comm/wlan/src/wlan_sm.o
121 endif
122
123 ifeq ($(WLAN_AP_FUNC),yes)
124 OBJS += ../zte_comm/wlan/src/wifi_ap_ctrl.o
125LDLIBS += -lwlan_interface
126LDLIBS += -L$(zte_lib_path)/libwlan_interface
127 endif
128else ifeq ($(CONFIG_WIFI_MODULE),xr819)
129 ifeq ($(WLAN_STA_FUNC),yes)
130 OBJS += ../zte_comm/wlan/src/wlan_sta_manager.o ../zte_comm/wlan/src/wlan_sm.o
131 endif
132
133 ifeq ($(WLAN_AP_FUNC),yes)
134 OBJS += ../zte_comm/wlan/src/wifi_ap_ctrl.o
135LDLIBS += -lwlan_interface
136LDLIBS += -L$(zte_lib_path)/libwlan_interface
137 endif
138else ifeq ($(CONFIG_WIFI_MODULE),ssv6x5x)
139 ifeq ($(WLAN_STA_FUNC),yes)
140 OBJS += ../zte_comm/wlan/src/wlan-station.o
141 endif
142
143 ifeq ($(WLAN_AP_FUNC),yes)
144 OBJS += ../zte_comm/wlan/src/wifi_ap_ctrl.o
145LDLIBS += -lwlan_interface
146LDLIBS += -L$(zte_lib_path)/libwlan_interface
147 endif
148else ifeq ($(CONFIG_WIFI_MODULE),aic8800)
149 ifeq ($(WLAN_STA_FUNC),yes)
150 OBJS += ../zte_comm/wlan/src/wlan-station.o
151 endif
152
153 ifeq ($(WLAN_AP_FUNC),yes)
154 OBJS += ../zte_comm/wlan/src/wifi_ap_ctrl.o
155LDLIBS += -lwlan_interface
156LDLIBS += -L$(zte_lib_path)/libwlan_interface
157 endif
158endif
159#aes
160CFLAGS += -I$(zte_lib_path)/libssl/install/include
161LDLIBS += -L$(zte_lib_path)/libssl/install/lib -lcrypto
162
163
164#*******************************************************************************
165# include path
166#*******************************************************************************
167CFLAGS += -I./
168CFLAGS += -I../include
169CFLAGS += -I../zte_comm/nvserver
170CFLAGS += -I$(LIB_DIR)/libnvram
171CFLAGS += -I$(APP_DIR)/include
172CFLAGS += -g -Werror=implicit-function-declaration
173
174CFLAGS += -I../zte_comm/zte_hotplug
175CFLAGS += -I../zte_comm/at_ctl/inc
176CFLAGS += -I../zte_comm/at_ctl/src/phone/inc
177CFLAGS += -I$(zte_app_path)/include
178CFLAGS += -I$(zte_lib_path)/libatext
179CFLAGS += -I$(zte_lib_path)/libsqlite
180CFLAGS += -I$(zte_lib_path)/libnvram
181CFLAGS += -I$(LINUX_DIR)
182CFLAGS += -I$(zte_lib_path)/libzcore/std/inc/zCore/bl
183CFLAGS += -I$(zte_lib_path)/libzcore/std/inc/zCore/gui
184CFLAGS += -I$(CPU_PUB_ROOT)/project/zx297520v3/include/nv
185CFLAGS += -O -Dlinux=1 -DHIGH_SPEED=1
186
187
188CFLAGS += -I$(zte_lib_path)/libsoftap
189#CFLAGS += -I.
190
191
192CFLAGS += -I$(zte_lib_path)/libsoft_timer
193
194CFLAGS += -I../zte_comm/sms/inc
195#CFLAGS += -I../zte_comm/phonebook/inc
196
197CFLAGS += -I../zte_comm/wlan/inc
198
199
200CFLAGS += -I../zte_comm/fota_dm/inc
201#CFLAGS += -I../zte_comm/fota_dm/gs_lib
202CFLAGS += -I../zte_comm/fota_dm/rs_lib
203CFLAGS += -I$(zte_lib_path)/libzte_dmapp/inc
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
218LDLIBS += -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
225LDLIBS += -lcurl -L$(zte_lib_path)/libcurl/install/lib
226
227ifneq ($(CONFIG_MMI_LCD),no)
228LDLIBS += -lzcore
229LDLIBS += -lrt
230ifeq ($(USE_TTF_FONT), yes)
231LDLIBS += -lft2
232LDLIBS += -lttf_font
233else
234LDLIBS += -lbitmap_font
235endif
236LDLIBS += -L$(zte_lib_path)/libzcore/min
237ifeq ($(USE_TTF_FONT), yes)
238LDLIBS += -L$(zte_lib_path)/libzcore/min/prebuilts/freetype
239endif
240endif
241
242LDLIBS += -lztedmapp -L$(zte_lib_path)/libzte_dmapp
243#LIBSHARE_GS = ../zte_comm/fota_dm/gs_lib/libdmgr.so.1
244#LDLIBS += -L../zte_comm/fota_dm/gs_lib -ldmgr
245
246LIBSHARE_GS = ../zte_comm/fota_dm/rs_lib/librsdlsdk.so
247LDLIBS += -L../zte_comm/fota_dm/rs_lib -lrsdlsdk
248LDLIBS1 += -lnvram_sc -L$(zte_lib_path)/libnvram -lpthread
249LDLIBS1 += -lsoftap -L$(zte_lib_path)/libsoftap
250LDLIBS1 += -lsoft_timer_sc -L$(zte_lib_path)/libsoft_timer
251
252##############USER COMIZE END##################
253
254all: $(EXEC) $(EXEC1) $(EXEC2)
255ifneq ($(tools_dir), )
256 for i in $(tools_dir) ; do $(MAKE) -C $$i || exit $?; done
257endif
258 (cd ../zte_comm/fota_dm/gs_lib;rm libdmgr.so;ln -s libdmgr.so.1 libdmgr.so; cd ../../../zte_comm)
259
260$(EXEC): $(OBJS) $(ZTE_MMI_DEP) $(ZTE_LOCKNET_DEP) $(ZTE_WATCHDOG_DEP)
261 $(CC) $(LDFLAGS) -o $@ $(OBJS) $(ZTE_MMI_OBJS) $(ZTE_LOCKNET_OBJS) $(ZTE_WATCHDOG_OBJS) -Wl,--start-group $(LDLIBS) -Wl,--end-group
262 @cp $@ $@.elf
263
264$(EXEC1): $(OBJS1)
265 $(CC) $(CFLAGS) -o $@ $(OBJS1) -Wl,--start-group $(LDLIBS1) -Wl,--end-group
266 @cp $@ $@.elf
267
268$(EXEC2): $(OBJS2)
269 $(CC) $(CFLAGS) -o $@ $(OBJS2) -Wl,--start-group $(LDLIBS1) -Wl,--end-group
270 @cp $@ $@.elf
271
272romfs:
273 $(ROMFSINST) /sbin/$(EXEC)
274 $(ROMFSINST) /sbin/$(EXEC1)
275 $(ROMFSINST) /sbin/$(EXEC2)
276 $(ROMFSINST) $(LIBSHARE_GS) /lib/
277ifneq ($(tools_dir), )
278 for i in $(tools_dir) ; do $(MAKE) -C $$i romfs || exit $?; done
279endif
280
281clean:
282 -rm -f $(EXEC) *.elf *.gdb *.o
283 -rm -f $(EXEC1) *.elf *.gdb *.o
284 -rm -f $(EXEC2) *.elf *.gdb *.o
285 -find ../zte_comm/ -name \*.o -exec rm -rf {} \;
286 -find . -name \*.o -exec rm -rf {} \;
287ifneq ($(tools_dir), )
288 for i in $(tools_dir) ; do $(MAKE) -C $$i clean || exit $?; done
289endif
290ifeq ($(CONFIG_USER_SINGLE_DM), zx)
291 rm -rf $(ROOTFS_DIR)//bin/$(EXEC_GS)
292endif
293
294$(ZTE_MMI_DEP):
295 ${MAKE} -C ../zte_comm/zte_mmi lib
296
297$(ZTE_LOCKNET_DEP):
298 ${MAKE} -C ../zte_comm/zte_locknet lib
299
300$(ZTE_WATCHDOG_DEP):
301 ${MAKE} -C ../zte_comm/zte_watchdog lib