lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | #*******************************************************************************
|
| 2 | # include ZTE application makefile
|
| 3 | #*******************************************************************************
|
| 4 | include $(zte_app_mak)
|
| 5 | #include ../net_team.mk
|
| 6 | include $(COMMON_MK)
|
| 7 |
|
| 8 | CPU_PUB_ROOT=$(TOPDIR_AP)/../pub
|
| 9 | ##############USER COMIZE BEGIN################
|
| 10 | EXEC = zte_cpe
|
| 11 | EXEC1 = zte-rtc-clock
|
| 12 | EXEC2 = router_msg_proxy
|
| 13 | OBJS = 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 |
|
| 26 | OBJS1 = ../zte_comm/rtc-service/zte-rtc-clock.o
|
| 27 | OBJS2 = ../zte_comm/zte_mainctrl/router_msg_proxy.o
|
| 28 |
|
| 29 | ZTE_MMI_DEP = zte_mmi_app
|
| 30 | ZTE_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
|
| 33 | ZTE_MMI_OBJS = $(addprefix ../zte_comm/zte_mmi/,$(ZTE_MMI_TOBJS))
|
| 34 |
|
| 35 | ZTE_LOCKNET_DEP = zte_locknet_app
|
| 36 | ZTE_LOCKNET_OBJS = $(patsubst %.c,%.o,$(wildcard ../zte_comm/zte_locknet/src/*.c ))
|
| 37 |
|
| 38 | ZTE_WATCHDOG_DEP = zte_watchdog_app
|
| 39 | ZTE_WATCHDOG_TOBJS = watchdog.o watchdog_adapter.o watchdog_battery.o
|
| 40 | ZTE_WATCHDOG_OBJS = $(addprefix ../zte_comm/zte_watchdog/,$(ZTE_WATCHDOG_TOBJS))
|
| 41 |
|
| 42 | #wifi
|
| 43 | ifeq ($(CONFIG_WIFI_MODULE),realtek)
|
| 44 | CFLAGS += -D__REALTEK_8192_CHIP__
|
| 45 | ifeq ($(CONFIG_WIFI_RTL_WPA2),yes)
|
| 46 | tools_dir += ../zte_comm/wlan/realtek_tools_wpa2/auth ../zte_comm/wlan/realtek_tools_wpa2/mini_upnp ../zte_comm/wlan/realtek_tools_wpa2/utility
|
| 47 | tools_dir += ../zte_comm/wlan/realtek_tools_wpa2/wsc ../zte_comm/wlan/realtek_tools_wpa2/wireless_tools.25
|
| 48 | else
|
| 49 | tools_dir += ../zte_comm/wlan/realtek_tools/auth ../zte_comm/wlan/realtek_tools/mini_upnp ../zte_comm/wlan/realtek_tools/utility
|
| 50 | tools_dir += ../zte_comm/wlan/realtek_tools/wsc ../zte_comm/wlan/realtek_tools/wireless_tools.25
|
| 51 | endif
|
| 52 | else ifeq ($(CONFIG_WIFI_MODULE),rda5995)
|
| 53 | CFLAGS += -D__RDA_5995_CHIP__
|
| 54 | tools_dir += ../zte_comm/wlan/rda_tools
|
| 55 | else ifeq ($(CONFIG_WIFI_MODULE),esp8089)
|
| 56 | CFLAGS += -D__ESP_8089_CHIP__
|
| 57 | tools_dir += ../zte_comm/wlan/esp_tools/eagle_test ../zte_comm/wlan/esp_tools/fcctest
|
| 58 | else ifeq ($(CONFIG_WIFI_MODULE),xr819)
|
| 59 | CFLAGS += -D__XR_819_CHIP__
|
| 60 | #tools_dir +=
|
| 61 | endif
|
| 62 |
|
| 63 | $(warning CONFIG_WIFI_FUNCTION=$(CONFIG_WIFI_FUNCTION))
|
| 64 |
|
| 65 | ifeq ($(findstring sta,$(CONFIG_WIFI_FUNCTION)), sta)
|
| 66 | WLAN_STA_FUNC=yes
|
| 67 | endif
|
| 68 |
|
| 69 | ifeq ($(findstring ap,$(CONFIG_WIFI_FUNCTION)), ap)
|
| 70 | WLAN_AP_FUNC=yes
|
| 71 | endif
|
| 72 |
|
| 73 | CFLAGS += -D__QRCODE_WIFI__
|
| 74 | CFLAGS += -D__USE_AES__
|
| 75 |
|
| 76 | ifeq ($(WLAN_STA_FUNC),yes)
|
| 77 | CFLAGS += -D__STA_FUNC__
|
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame^] | 78 | CFLAGS += -I$(zte_app_path)/wpa_supplicant-2.10/src/common
|
| 79 | LDLIBS += -lwpa_client -L$(zte_app_path)/wpa_supplicant-2.10/wpa_supplicant
|
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 80 | endif
|
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame^] | 81 |
|
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 82 | ifeq ($(WLAN_AP_FUNC),yes)
|
| 83 | CFLAGS += -D__AP_FUNC__
|
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame^] | 84 | ifneq ($(WLAN_STA_FUNC),yes)
|
| 85 | CFLAGS += -I$(zte_app_path)/hostapd-2.10/src/common
|
| 86 | LDLIBS += -lwpa_client -L$(zte_app_path)/hostapd-2.10/hostapd
|
| 87 | endif
|
lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 88 | endif
|
| 89 |
|
| 90 | OBJS += ../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
|
| 92 | ifeq ($(CONFIG_WIFI_MODULE),realtek)
|
| 93 | OBJS += ../zte_comm/wlan/src/wifi_hal.o
|
| 94 | ifeq ($(WLAN_STA_FUNC),yes)
|
| 95 | OBJS += ../zte_comm/wlan/src/wlan-station.o
|
| 96 | endif
|
| 97 | LDLIBS += -lwlan_interface
|
| 98 | LDLIBS += -L$(zte_lib_path)/libwlan_interface
|
| 99 | else 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
|
| 106 | LDLIBS += -lwlan_interface
|
| 107 | LDLIBS += -L$(zte_lib_path)/libwlan_interface
|
| 108 | endif
|
| 109 | else 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
|
| 116 | LDLIBS += -lwlan_interface
|
| 117 | LDLIBS += -L$(zte_lib_path)/libwlan_interface
|
| 118 | endif
|
| 119 | else 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
|
| 126 | LDLIBS += -lwlan_interface
|
| 127 | LDLIBS += -L$(zte_lib_path)/libwlan_interface
|
| 128 | endif
|
| 129 | endif
|
| 130 | #aes
|
| 131 | CFLAGS += -I$(zte_lib_path)/libssl/install/include
|
| 132 | LDLIBS += -L$(zte_lib_path)/libssl/install/lib -lcrypto
|
| 133 |
|
| 134 | ifeq ($(CONFIG_USE_WEBUI_SECURITY),yes)
|
| 135 | CFLAGS += -DWEBS_SECURITY
|
| 136 | endif
|
| 137 | #*******************************************************************************
|
| 138 | # include path
|
| 139 | #*******************************************************************************
|
| 140 | CFLAGS += -I./
|
| 141 | CFLAGS += -I../include
|
| 142 | CFLAGS += -I../zte_comm/nvserver
|
| 143 | CFLAGS += -I$(LIB_DIR)/libnvram
|
| 144 | CFLAGS += -I$(APP_DIR)/include
|
| 145 | CFLAGS += -g -Werror=implicit-function-declaration
|
| 146 |
|
| 147 | CFLAGS += -I../zte_comm/zte_hotplug
|
| 148 | CFLAGS += -I../zte_comm/at_ctl/inc
|
| 149 | CFLAGS += -I../zte_comm/at_ctl/src/phone/inc
|
| 150 | CFLAGS += -I$(zte_app_path)/include
|
| 151 | CFLAGS += -I$(zte_lib_path)/libatext
|
| 152 | CFLAGS += -I$(zte_lib_path)/libsqlite
|
| 153 | CFLAGS += -I$(zte_lib_path)/libnvram
|
| 154 | CFLAGS += -I$(LINUX_DIR)
|
| 155 | CFLAGS += -I$(zte_lib_path)/libzcore/std/inc/zCore/bl
|
| 156 | CFLAGS += -I$(zte_lib_path)/libzcore/std/inc/zCore/gui
|
| 157 | CFLAGS += -I$(CPU_PUB_ROOT)/project/zx297520v3/include/nv
|
| 158 | CFLAGS += -O -Dlinux=1 -DHIGH_SPEED=1
|
| 159 |
|
| 160 |
|
| 161 | CFLAGS += -I$(zte_lib_path)/libsoftap
|
| 162 | #CFLAGS += -I.
|
| 163 |
|
| 164 |
|
| 165 | CFLAGS += -I$(zte_lib_path)/libsoft_timer
|
| 166 |
|
| 167 | CFLAGS += -I../zte_comm/sms/inc
|
| 168 | CFLAGS += -I../zte_comm/phonebook/inc
|
| 169 |
|
| 170 | CFLAGS += -I../zte_comm/wlan/inc
|
| 171 |
|
| 172 |
|
| 173 | CFLAGS += -I../zte_comm/fota_dm/inc
|
| 174 | #CFLAGS += -I../zte_comm/fota_dm/gs_lib
|
| 175 | CFLAGS += -I../zte_comm/fota_dm/rs_lib
|
| 176 | CFLAGS += -I$(zte_lib_path)/libzte_dmapp/inc
|
| 177 |
|
| 178 | #*******************************************************************************
|
| 179 | # library
|
| 180 | #*******************************************************************************
|
| 181 | LDLIBS += -lnvram_sc -L$(zte_lib_path)/libnvram -lpthread
|
| 182 | ifeq ($(LINUX_TYPE),uClinux)
|
| 183 | LDFLAGS += -Wl,--allow-multiple-definition,-elf2flt=-s131072
|
| 184 | endif
|
| 185 |
|
| 186 |
|
| 187 | LDLIBS += -lsoftap -L$(zte_lib_path)/libsoftap
|
| 188 | LDLIBS += -lsoft_timer_sc -L$(zte_lib_path)/libsoft_timer
|
| 189 | LDLIBS += -latutils -L$(zte_lib_path)/libatutils
|
| 190 | LDLIBS += -lsqlite -L$(zte_lib_path)/libsqlite
|
| 191 | LDLIBS += -latext -L$(zte_lib_path)/libatext
|
| 192 | LDLIBS += -lm
|
| 193 | #LDLIBS += -ltinyalsa -L$(zte_lib_path)/libtinyalsa
|
| 194 | LDLIBS += -lcpnv -L$(zte_lib_path)/libcpnv
|
| 195 | LDLIBS += -lamt -L$(zte_lib_path)/libamt
|
| 196 | LDLIBS += -lkey -L$(zte_lib_path)/libkey
|
| 197 |
|
| 198 | LDLIBS += -lcurl -L$(zte_lib_path)/libcurl/install/lib
|
| 199 |
|
| 200 | ifneq ($(CONFIG_MMI_LCD),no)
|
| 201 | LDLIBS += -lzcore
|
| 202 | LDLIBS += -lrt
|
| 203 | LDLIBS += -L$(zte_lib_path)/libzcore/min
|
| 204 | endif
|
| 205 |
|
| 206 | LDLIBS += -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 |
|
| 210 | LIBSHARE_GS = ../zte_comm/fota_dm/rs_lib/librsdlsdk.so
|
| 211 | LDLIBS += -L../zte_comm/fota_dm/rs_lib -lrsdlsdk
|
| 212 | LDLIBS1 += -lnvram_sc -L$(zte_lib_path)/libnvram -lpthread
|
| 213 | LDLIBS1 += -lsoftap -L$(zte_lib_path)/libsoftap
|
| 214 | LDLIBS1 += -lsoft_timer_sc -L$(zte_lib_path)/libsoft_timer
|
| 215 |
|
| 216 | ##############USER COMIZE END##################
|
| 217 |
|
| 218 | all: $(EXEC) $(EXEC1) $(EXEC2)
|
| 219 | ifneq ($(tools_dir), )
|
| 220 | for i in $(tools_dir) ; do $(MAKE) -C $$i || exit $?; done
|
| 221 | endif
|
| 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 |
|
| 236 | romfs:
|
| 237 | $(ROMFSINST) /sbin/$(EXEC)
|
| 238 | $(ROMFSINST) /sbin/$(EXEC1)
|
| 239 | $(ROMFSINST) /sbin/$(EXEC2)
|
| 240 | $(ROMFSINST) $(LIBSHARE_GS) /lib/
|
| 241 | ifneq ($(tools_dir), )
|
| 242 | for i in $(tools_dir) ; do $(MAKE) -C $$i romfs || exit $?; done
|
| 243 | endif
|
| 244 |
|
| 245 | clean:
|
| 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 {} \;
|
| 251 | ifneq ($(tools_dir), )
|
| 252 | for i in $(tools_dir) ; do $(MAKE) -C $$i clean || exit $?; done
|
| 253 | endif
|
| 254 | ifeq ($(CONFIG_USER_SINGLE_DM), zx)
|
| 255 | rm -rf $(ROOTFS_DIR)//bin/$(EXEC_GS)
|
| 256 | endif
|
| 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
|