blob: 55b17770ba307c4660be3f3a490d7a98f147a21b [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__
xf.li6c8fc1e2023-08-12 00:11:09 -070078CFLAGS += -I$(zte_app_path)/wpa_supplicant-2.10/src/common
79LDLIBS += -lwpa_client -L$(zte_app_path)/wpa_supplicant-2.10/wpa_supplicant
lh9ed821d2023-04-07 01:36:19 -070080endif
xf.li6c8fc1e2023-08-12 00:11:09 -070081
lh9ed821d2023-04-07 01:36:19 -070082ifeq ($(WLAN_AP_FUNC),yes)
83CFLAGS += -D__AP_FUNC__
xf.li6c8fc1e2023-08-12 00:11:09 -070084ifneq ($(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
lh9ed821d2023-04-07 01:36:19 -070088endif
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
129endif
130#aes
131CFLAGS += -I$(zte_lib_path)/libssl/install/include
132LDLIBS += -L$(zte_lib_path)/libssl/install/lib -lcrypto
133
134ifeq ($(CONFIG_USE_WEBUI_SECURITY),yes)
135CFLAGS += -DWEBS_SECURITY
136endif
137#*******************************************************************************
138# include path
139#*******************************************************************************
140CFLAGS += -I./
141CFLAGS += -I../include
142CFLAGS += -I../zte_comm/nvserver
143CFLAGS += -I$(LIB_DIR)/libnvram
144CFLAGS += -I$(APP_DIR)/include
145CFLAGS += -g -Werror=implicit-function-declaration
146
147CFLAGS += -I../zte_comm/zte_hotplug
148CFLAGS += -I../zte_comm/at_ctl/inc
149CFLAGS += -I../zte_comm/at_ctl/src/phone/inc
150CFLAGS += -I$(zte_app_path)/include
151CFLAGS += -I$(zte_lib_path)/libatext
152CFLAGS += -I$(zte_lib_path)/libsqlite
153CFLAGS += -I$(zte_lib_path)/libnvram
154CFLAGS += -I$(LINUX_DIR)
155CFLAGS += -I$(zte_lib_path)/libzcore/std/inc/zCore/bl
156CFLAGS += -I$(zte_lib_path)/libzcore/std/inc/zCore/gui
157CFLAGS += -I$(CPU_PUB_ROOT)/project/zx297520v3/include/nv
158CFLAGS += -O -Dlinux=1 -DHIGH_SPEED=1
159
160
161CFLAGS += -I$(zte_lib_path)/libsoftap
162#CFLAGS += -I.
163
164
165CFLAGS += -I$(zte_lib_path)/libsoft_timer
166
167CFLAGS += -I../zte_comm/sms/inc
168CFLAGS += -I../zte_comm/phonebook/inc
169
170CFLAGS += -I../zte_comm/wlan/inc
171
172
173CFLAGS += -I../zte_comm/fota_dm/inc
174#CFLAGS += -I../zte_comm/fota_dm/gs_lib
175CFLAGS += -I../zte_comm/fota_dm/rs_lib
176CFLAGS += -I$(zte_lib_path)/libzte_dmapp/inc
177
178#*******************************************************************************
179# library
180#*******************************************************************************
181LDLIBS += -lnvram_sc -L$(zte_lib_path)/libnvram -lpthread
182ifeq ($(LINUX_TYPE),uClinux)
183LDFLAGS += -Wl,--allow-multiple-definition,-elf2flt=-s131072
184endif
185
186
187LDLIBS += -lsoftap -L$(zte_lib_path)/libsoftap
188LDLIBS += -lsoft_timer_sc -L$(zte_lib_path)/libsoft_timer
189LDLIBS += -latutils -L$(zte_lib_path)/libatutils
190LDLIBS += -lsqlite -L$(zte_lib_path)/libsqlite
191LDLIBS += -latext -L$(zte_lib_path)/libatext
192LDLIBS += -lm
193#LDLIBS += -ltinyalsa -L$(zte_lib_path)/libtinyalsa
194LDLIBS += -lcpnv -L$(zte_lib_path)/libcpnv
195LDLIBS += -lamt -L$(zte_lib_path)/libamt
196LDLIBS += -lkey -L$(zte_lib_path)/libkey
197
198LDLIBS += -lcurl -L$(zte_lib_path)/libcurl/install/lib
199
200ifneq ($(CONFIG_MMI_LCD),no)
201LDLIBS += -lzcore
202LDLIBS += -lrt
203LDLIBS += -L$(zte_lib_path)/libzcore/min
204endif
205
206LDLIBS += -lztedmapp -L$(zte_lib_path)/libzte_dmapp
207#LIBSHARE_GS = ../zte_comm/fota_dm/gs_lib/libdmgr.so.1
208#LDLIBS += -L../zte_comm/fota_dm/gs_lib -ldmgr
209
210LIBSHARE_GS = ../zte_comm/fota_dm/rs_lib/librsdlsdk.so
211LDLIBS += -L../zte_comm/fota_dm/rs_lib -lrsdlsdk
212LDLIBS1 += -lnvram_sc -L$(zte_lib_path)/libnvram -lpthread
213LDLIBS1 += -lsoftap -L$(zte_lib_path)/libsoftap
214LDLIBS1 += -lsoft_timer_sc -L$(zte_lib_path)/libsoft_timer
215
216##############USER COMIZE END##################
217
218all: $(EXEC) $(EXEC1) $(EXEC2)
219ifneq ($(tools_dir), )
220 for i in $(tools_dir) ; do $(MAKE) -C $$i || exit $?; done
221endif
222 (cd ../zte_comm/fota_dm/gs_lib;rm libdmgr.so;ln -s libdmgr.so.1 libdmgr.so; cd ../../../zte_comm)
223
224$(EXEC): $(OBJS) $(ZTE_MMI_DEP) $(ZTE_LOCKNET_DEP) $(ZTE_WATCHDOG_DEP)
225 $(CC) $(LDFLAGS) -o $@ $(OBJS) $(ZTE_MMI_OBJS) $(ZTE_LOCKNET_OBJS) $(ZTE_WATCHDOG_OBJS) -Wl,--start-group $(LDLIBS) -Wl,--end-group
226 @cp $@ $@.elf
227
228$(EXEC1): $(OBJS1)
229 $(CC) $(CFLAGS) -o $@ $(OBJS1) -Wl,--start-group $(LDLIBS1) -Wl,--end-group
230 @cp $@ $@.elf
231
232$(EXEC2): $(OBJS2)
233 $(CC) $(CFLAGS) -o $@ $(OBJS2) -Wl,--start-group $(LDLIBS1) -Wl,--end-group
234 @cp $@ $@.elf
235
236romfs:
237 $(ROMFSINST) /sbin/$(EXEC)
238 $(ROMFSINST) /sbin/$(EXEC1)
239 $(ROMFSINST) /sbin/$(EXEC2)
240 $(ROMFSINST) $(LIBSHARE_GS) /lib/
241ifneq ($(tools_dir), )
242 for i in $(tools_dir) ; do $(MAKE) -C $$i romfs || exit $?; done
243endif
244
245clean:
246 -rm -f $(EXEC) *.elf *.gdb *.o
247 -rm -f $(EXEC1) *.elf *.gdb *.o
248 -rm -f $(EXEC2) *.elf *.gdb *.o
249 -find ../zte_comm/ -name \*.o -exec rm -rf {} \;
250 -find . -name \*.o -exec rm -rf {} \;
251ifneq ($(tools_dir), )
252 for i in $(tools_dir) ; do $(MAKE) -C $$i clean || exit $?; done
253endif
254ifeq ($(CONFIG_USER_SINGLE_DM), zx)
255 rm -rf $(ROOTFS_DIR)//bin/$(EXEC_GS)
256endif
257
258$(ZTE_MMI_DEP):
259 ${MAKE} -C ../zte_comm/zte_mmi lib
260
261$(ZTE_LOCKNET_DEP):
262 ${MAKE} -C ../zte_comm/zte_locknet lib
263
264$(ZTE_WATCHDOG_DEP):
265 ${MAKE} -C ../zte_comm/zte_watchdog lib