blob: 1d3080637643668396f561f3906e419c7439a5a0 [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_mdl
11EXEC1 = zte-rtc-clock
12EXEC2 = router_msg_proxy
13OBJS = zte_mdl.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 ../zte_comm/zte_audio_ctrl/audio_res_ctrl.o \
18 $(patsubst %.c,%.o,$(wildcard ../zte_comm/zte_drv_ctrl/usb/*.c ../zte_comm/zte_drv_ctrl/serial/*.c)) \
19 ../zte_comm/sntp/sntp.o \
20 $(patsubst %.c,%.o,$(wildcard ../zte_comm/fota_dm/src/*.c ))
21
22ifeq ($(USE_VEHICLE_DC),yes)
23OBJS += ../zte_comm/nvserver/nvserver_rpc.o ../zte_comm/nvserver/sc_rpc.o ../zte_comm/nvserver/file.o
24else
25OBJS += ../zte_comm/nvserver/nvserver.o ../zte_comm/nvserver/nvupdate.o
26endif
27
28OBJS1 = ../zte_comm/rtc-service/zte-rtc-clock.o
29OBJS2 = ../zte_comm/zte_mainctrl/router_msg_proxy.o
30#aes
31CFLAGS += -I$(zte_lib_path)/libssl/install/include
32LDLIBS += -L$(zte_lib_path)/libssl/install/lib -lcrypto
33ifeq ($(USE_DSDS_VSIM),yes)
34LDLIBS += -L$(zte_lib_path)/libvsim -lght_vsim
35CFLAGS += -DUSE_DSDS_VSIM
36endif
37
38#*******************************************************************************
39# include path
40#*******************************************************************************
41CFLAGS += -I./
42CFLAGS += -I../include
43CFLAGS += -I../zte_comm/nvserver
44CFLAGS += -I$(LIB_DIR)/libnvram
45CFLAGS += -I$(APP_DIR)/include
46CFLAGS += -g -Werror=implicit-function-declaration
47
48CFLAGS += -I../zte_comm/zte_hotplug
49CFLAGS += -I../zte_comm/at_ctl/inc
50CFLAGS += -I../zte_comm/at_ctl/src/phone/inc
51CFLAGS += -I$(zte_app_path)/include
52CFLAGS += -I$(zte_lib_path)/libatext
53CFLAGS += -I$(zte_lib_path)/libsqlite
54CFLAGS += -I$(zte_lib_path)/libnvram
55CFLAGS += -I$(LINUX_DIR)
56CFLAGS += -I$(zte_lib_path)/libzcore/std/inc/zCore/bl
57CFLAGS += -I$(zte_lib_path)/libzcore/std/inc/zCore/gui
58CFLAGS += -I$(CPU_PUB_ROOT)/project/zx297520v3/include/nv
59CFLAGS += -O -Dlinux=1 -DHIGH_SPEED=1
60
61
62CFLAGS += -I$(zte_lib_path)/libsoftap
63#CFLAGS += -I.
64
65
66CFLAGS += -I$(zte_lib_path)/libsoft_timer
67
68
69
70
71CFLAGS += -I../zte_comm/fota_dm/inc
72#CFLAGS += -I../zte_comm/fota_dm/gs_lib
73CFLAGS += -I../zte_comm/fota_dm/rs_lib
74CFLAGS += -I$(zte_lib_path)/libzte_dmapp/inc
75
76ifeq ($(USE_FOTA_AB),yes)
77CFLAGS += -I$(LIB_DIR)/libupi_ab/inc
78endif
79
80#*******************************************************************************
81# library
82#*******************************************************************************
83LDLIBS += -lnvram_sc -L$(zte_lib_path)/libnvram -lpthread
84ifeq ($(LINUX_TYPE),uClinux)
85LDFLAGS += -Wl,--allow-multiple-definition,-elf2flt=-s131072
86endif
87
88
89LDLIBS += -lsoftap -L$(zte_lib_path)/libsoftap
90LDLIBS += -lsoft_timer_sc -L$(zte_lib_path)/libsoft_timer
91LDLIBS += -latutils -L$(zte_lib_path)/libatutils
92LDLIBS += -lsqlite -L$(zte_lib_path)/libsqlite
93LDLIBS += -latext -L$(zte_lib_path)/libatext
94LDLIBS += -lm
95#LDLIBS += -ltinyalsa -L$(zte_lib_path)/libtinyalsa
96LDLIBS += -lcpnv -L$(zte_lib_path)/libcpnv
97LDLIBS += -lamt -L$(zte_lib_path)/libamt
98LDLIBS += -lkey -L$(zte_lib_path)/libkey
99
100LDLIBS += -lcurl -L$(zte_lib_path)/libcurl/install/lib
101
102
103LDLIBS += -lztedmapp -L$(zte_lib_path)/libzte_dmapp
104#LIBSHARE_GS = ../zte_comm/fota_dm/gs_lib/libdmgr.so.1
105#LDLIBS += -L../zte_comm/fota_dm/gs_lib -ldmgr
106
107LIBSHARE_GS = ../zte_comm/fota_dm/rs_lib/librsdlsdk.so
108LDLIBS += -L../zte_comm/fota_dm/rs_lib -lrsdlsdk
109LDLIBS1 += -lnvram_sc -L$(zte_lib_path)/libnvram -lpthread
110LDLIBS1 += -lsoftap -L$(zte_lib_path)/libsoftap
111LDLIBS1 += -lsoft_timer_sc -L$(zte_lib_path)/libsoft_timer
112
113ifeq ($(USE_FOTA_AB),yes)
114LDLIBS += -lupi_ab -L$(LIB_DIR)/libupi_ab
115LDLIBS += -lcrypto -L$(LIB_DIR)/libssl/install/lib
116endif
117
118##############USER COMIZE END##################
119
120all: $(EXEC) $(EXEC1) $(EXEC2)
121 (cd ../zte_comm/fota_dm/gs_lib;rm libdmgr.so;ln -s libdmgr.so.1 libdmgr.so; cd ../../../zte_comm)
122
123$(EXEC): $(OBJS)
124 $(CC) $(LDFLAGS) -o $@ $(OBJS) -Wl,--start-group $(LDLIBS) -Wl,--end-group
125 @cp $@ $@.elf
126
127$(EXEC1): $(OBJS1)
128 $(CC) $(CFLAGS) -o $@ $(OBJS1) -Wl,--start-group $(LDLIBS1) -Wl,--end-group
129 @cp $@ $@.elf
130
131$(EXEC2): $(OBJS2)
132 $(CC) $(CFLAGS) -o $@ $(OBJS2) -Wl,--start-group $(LDLIBS1) -Wl,--end-group
133 @cp $@ $@.elf
134
135romfs:
136 $(ROMFSINST) /sbin/$(EXEC)
137 $(ROMFSINST) /sbin/$(EXEC1)
138 $(ROMFSINST) /sbin/$(EXEC2)
139 $(ROMFSINST) $(LIBSHARE_GS) /lib/
140
141clean:
142 -rm -f $(EXEC) *.elf *.gdb *.o
143 -rm -f $(EXEC1) *.elf *.gdb *.o
144 -rm -f $(EXEC2) *.elf *.gdb *.o
145 -find ../zte_comm/ -name \*.o -exec rm -rf {} \;
146 -find . -name \*.o -exec rm -rf {} \;
147
148