blob: 816aaf8e03b927c987e41ce5b6878bd6282dc7b6 [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_cpe
11EXEC1 = zte-rtc-clock
12EXEC2 = router_msg_proxy
13OBJS = zte_cpe.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 +=
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.6/src/common
79LDLIBS += -lwpa_client -L$(zte_app_path)/wpa_supplicant-2.6/wpa_supplicant
80endif
81ifeq ($(WLAN_AP_FUNC),yes)
82CFLAGS += -D__AP_FUNC__
83CFLAGS += -I$(zte_app_path)/hostapd-2.6/src/common
84LDLIBS += -lwpa_client -L$(zte_app_path)/hostapd-2.6/hostapd
85endif
86
87OBJS += ../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 \
88 ../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
89ifeq ($(CONFIG_WIFI_MODULE),realtek)
90OBJS += ../zte_comm/wlan/src/wifi_hal.o
91 ifeq ($(WLAN_STA_FUNC),yes)
92 OBJS += ../zte_comm/wlan/src/wlan-station.o
93 endif
94LDLIBS += -lwlan_interface
95LDLIBS += -L$(zte_lib_path)/libwlan_interface
96else ifeq ($(CONFIG_WIFI_MODULE),rda5995)
97 ifeq ($(WLAN_STA_FUNC),yes)
98 OBJS += ../zte_comm/wlan/src/wlan_sta_manager.o ../zte_comm/wlan/src/wlan_sm.o
99 endif
100
101 ifeq ($(WLAN_AP_FUNC),yes)
102 OBJS += ../zte_comm/wlan/src/wifi_ap_ctrl.o
103LDLIBS += -lwlan_interface
104LDLIBS += -L$(zte_lib_path)/libwlan_interface
105 endif
106else ifeq ($(CONFIG_WIFI_MODULE),esp8089)
107 ifeq ($(WLAN_STA_FUNC),yes)
108 OBJS += ../zte_comm/wlan/src/wlan_sta_manager.o ../zte_comm/wlan/src/wlan_sm.o
109 endif
110
111 ifeq ($(WLAN_AP_FUNC),yes)
112 OBJS += ../zte_comm/wlan/src/wifi_ap_ctrl.o
113LDLIBS += -lwlan_interface
114LDLIBS += -L$(zte_lib_path)/libwlan_interface
115 endif
116else ifeq ($(CONFIG_WIFI_MODULE),xr819)
117 ifeq ($(WLAN_STA_FUNC),yes)
118 OBJS += ../zte_comm/wlan/src/wlan_sta_manager.o ../zte_comm/wlan/src/wlan_sm.o
119 endif
120
121 ifeq ($(WLAN_AP_FUNC),yes)
122 OBJS += ../zte_comm/wlan/src/wifi_ap_ctrl.o
123LDLIBS += -lwlan_interface
124LDLIBS += -L$(zte_lib_path)/libwlan_interface
125 endif
126endif
127#aes
128CFLAGS += -I$(zte_lib_path)/libssl/install/include
129LDLIBS += -L$(zte_lib_path)/libssl/install/lib -lcrypto
130
131ifeq ($(CONFIG_USE_WEBUI_SECURITY),yes)
132CFLAGS += -DWEBS_SECURITY
133endif
134#*******************************************************************************
135# include path
136#*******************************************************************************
137CFLAGS += -I./
138CFLAGS += -I../include
139CFLAGS += -I../zte_comm/nvserver
140CFLAGS += -I$(LIB_DIR)/libnvram
141CFLAGS += -I$(APP_DIR)/include
142CFLAGS += -g -Werror=implicit-function-declaration
143
144CFLAGS += -I../zte_comm/zte_hotplug
145CFLAGS += -I../zte_comm/at_ctl/inc
146CFLAGS += -I../zte_comm/at_ctl/src/phone/inc
147CFLAGS += -I$(zte_app_path)/include
148CFLAGS += -I$(zte_lib_path)/libatext
149CFLAGS += -I$(zte_lib_path)/libsqlite
150CFLAGS += -I$(zte_lib_path)/libnvram
151CFLAGS += -I$(LINUX_DIR)
152CFLAGS += -I$(zte_lib_path)/libzcore/std/inc/zCore/bl
153CFLAGS += -I$(zte_lib_path)/libzcore/std/inc/zCore/gui
154CFLAGS += -I$(CPU_PUB_ROOT)/project/zx297520v3/include/nv
155CFLAGS += -O -Dlinux=1 -DHIGH_SPEED=1
156
157
158CFLAGS += -I$(zte_lib_path)/libsoftap
159#CFLAGS += -I.
160
161
162CFLAGS += -I$(zte_lib_path)/libsoft_timer
163
164CFLAGS += -I../zte_comm/sms/inc
165CFLAGS += -I../zte_comm/phonebook/inc
166
167CFLAGS += -I../zte_comm/wlan/inc
168
169
170CFLAGS += -I../zte_comm/fota_dm/inc
171#CFLAGS += -I../zte_comm/fota_dm/gs_lib
172CFLAGS += -I../zte_comm/fota_dm/rs_lib
173CFLAGS += -I$(zte_lib_path)/libzte_dmapp/inc
174
175#*******************************************************************************
176# library
177#*******************************************************************************
178LDLIBS += -lnvram_sc -L$(zte_lib_path)/libnvram -lpthread
179ifeq ($(LINUX_TYPE),uClinux)
180LDFLAGS += -Wl,--allow-multiple-definition,-elf2flt=-s131072
181endif
182
183
184LDLIBS += -lsoftap -L$(zte_lib_path)/libsoftap
185LDLIBS += -lsoft_timer_sc -L$(zte_lib_path)/libsoft_timer
186LDLIBS += -latutils -L$(zte_lib_path)/libatutils
187LDLIBS += -lsqlite -L$(zte_lib_path)/libsqlite
188LDLIBS += -latext -L$(zte_lib_path)/libatext
189LDLIBS += -lm
190#LDLIBS += -ltinyalsa -L$(zte_lib_path)/libtinyalsa
191LDLIBS += -lcpnv -L$(zte_lib_path)/libcpnv
192LDLIBS += -lamt -L$(zte_lib_path)/libamt
193LDLIBS += -lkey -L$(zte_lib_path)/libkey
194
195LDLIBS += -lcurl -L$(zte_lib_path)/libcurl/install/lib
196
197ifneq ($(CONFIG_MMI_LCD),no)
198LDLIBS += -lzcore
199LDLIBS += -lrt
200LDLIBS += -L$(zte_lib_path)/libzcore/min
201endif
202
203LDLIBS += -lztedmapp -L$(zte_lib_path)/libzte_dmapp
204#LIBSHARE_GS = ../zte_comm/fota_dm/gs_lib/libdmgr.so.1
205#LDLIBS += -L../zte_comm/fota_dm/gs_lib -ldmgr
206
207LIBSHARE_GS = ../zte_comm/fota_dm/rs_lib/librsdlsdk.so
208LDLIBS += -L../zte_comm/fota_dm/rs_lib -lrsdlsdk
209LDLIBS1 += -lnvram_sc -L$(zte_lib_path)/libnvram -lpthread
210LDLIBS1 += -lsoftap -L$(zte_lib_path)/libsoftap
211LDLIBS1 += -lsoft_timer_sc -L$(zte_lib_path)/libsoft_timer
212
213##############USER COMIZE END##################
214
215all: $(EXEC) $(EXEC1) $(EXEC2)
216ifneq ($(tools_dir), )
217 for i in $(tools_dir) ; do $(MAKE) -C $$i || exit $?; done
218endif
219 (cd ../zte_comm/fota_dm/gs_lib;rm libdmgr.so;ln -s libdmgr.so.1 libdmgr.so; cd ../../../zte_comm)
220
221$(EXEC): $(OBJS) $(ZTE_MMI_DEP) $(ZTE_LOCKNET_DEP) $(ZTE_WATCHDOG_DEP)
222 $(CC) $(LDFLAGS) -o $@ $(OBJS) $(ZTE_MMI_OBJS) $(ZTE_LOCKNET_OBJS) $(ZTE_WATCHDOG_OBJS) -Wl,--start-group $(LDLIBS) -Wl,--end-group
223 @cp $@ $@.elf
224
225$(EXEC1): $(OBJS1)
226 $(CC) $(CFLAGS) -o $@ $(OBJS1) -Wl,--start-group $(LDLIBS1) -Wl,--end-group
227 @cp $@ $@.elf
228
229$(EXEC2): $(OBJS2)
230 $(CC) $(CFLAGS) -o $@ $(OBJS2) -Wl,--start-group $(LDLIBS1) -Wl,--end-group
231 @cp $@ $@.elf
232
233romfs:
234 $(ROMFSINST) /sbin/$(EXEC)
235 $(ROMFSINST) /sbin/$(EXEC1)
236 $(ROMFSINST) /sbin/$(EXEC2)
237 $(ROMFSINST) $(LIBSHARE_GS) /lib/
238ifneq ($(tools_dir), )
239 for i in $(tools_dir) ; do $(MAKE) -C $$i romfs || exit $?; done
240endif
241
242clean:
243 -rm -f $(EXEC) *.elf *.gdb *.o
244 -rm -f $(EXEC1) *.elf *.gdb *.o
245 -rm -f $(EXEC2) *.elf *.gdb *.o
246 -find ../zte_comm/ -name \*.o -exec rm -rf {} \;
247 -find . -name \*.o -exec rm -rf {} \;
248ifneq ($(tools_dir), )
249 for i in $(tools_dir) ; do $(MAKE) -C $$i clean || exit $?; done
250endif
251ifeq ($(CONFIG_USER_SINGLE_DM), zx)
252 rm -rf $(ROOTFS_DIR)//bin/$(EXEC_GS)
253endif
254
255$(ZTE_MMI_DEP):
256 ${MAKE} -C ../zte_comm/zte_mmi lib
257
258$(ZTE_LOCKNET_DEP):
259 ${MAKE} -C ../zte_comm/zte_locknet lib
260
261$(ZTE_WATCHDOG_DEP):
262 ${MAKE} -C ../zte_comm/zte_watchdog lib