blob: e3dfcfd700f1bf3751a375ee7f9baf2fec343268 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001# /*****************************************************************************
2#* °æÈ¨ËùÓÐ (C)2015, ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾¡£
3#*
4#* ÎļþÃû³Æ: Makefile
5#* Îļþ±êʶ: Makefile
6#* ÄÚÈÝÕªÒª: Makefile of ZTE applications
7#* ʹÓ÷½·¨: void
8#*
9#* ÐÞ¸ÄÈÕÆÚ °æ±¾ºÅ Ð޸ıê¼Ç ÐÞ¸ÄÈË ÐÞ¸ÄÄÚÈÝ
10#* -----------------------------------------------------------------------------
11#* 2022/07/13 V1.0 Create zln ´´½¨
12#*
13# ******************************************************************************/
14
15#*******************************************************************************
16# include ZTE application makefile
17#*******************************************************************************
18.EXPORT_ALL_VARIABLES:
19include $(COMMON_MK)
20#*******************************************************************************
21# execute
22#*******************************************************************************
23EXEC = fota_upi_ab
24
25#*******************************************************************************
26# objects
27#*******************************************************************************
28SRCS=$(wildcard ./src/*.c)
29OBJS = $(patsubst %.c,%.o,$(SRCS))
30
31#*******************************************************************************
32# include path
33#*******************************************************************************
34
35
36
37CFLAGS += -Wall -g
38
39CFLAGS += -Werror=implicit-int \
40 -Werror=implicit-function-declaration \
41 -Werror=float-equal \
42 -Werror=return-type \
43 -Werror=enum-compare \
44 -Werror=init-self
45
46CFLAGS += -O2
47CFLAGS += -I../include
48CFLAGS += -I./inc \
49 -I$(zte_lib_path)/libssl/install/include \
50 -I$(zte_lib_path)/libupi_ab/inc
51#*******************************************************************************
52# macro definition
53#*******************************************************************************
54
55ifeq ($(PRJ_IS_MIN),yes)
56
57CFLAGS += -D_IS_MIN
58
59endif
60
61ifeq ($(CONFIG_USER_FOTA_OPEN_SOURCE),n)
62CFLAGS += -D_USE_SYSTEM_COMMAND
63endif
64
65
66#*******************************************************************************
67# library
68#*******************************************************************************
69LDLIBS += -lsoft_timer_sc -L$(zte_lib_path)/libsoft_timer
70
71LDLIBS += -lpthread
72LDLIBS += -lsoftap
73LDLIBS += -lnvram_sc
74
75# SHA512 functions in libcrypto.a not libssl
76#LDLIBS += -lssl
77LDLIBS += -lcrypto
78LDLIBS += -L$(zte_lib_path)/libssl/install/lib
79LDLIBS += -L$(zte_lib_path)/libnvram
80LDLIBS += -L$(zte_lib_path)/libsoftap
81
xf.liaa4d92f2023-09-13 00:18:58 -070082#LDLIBS += -lcpnv -L$(LIB_DIR)/libcpnv
lh9ed821d2023-04-07 01:36:19 -070083
84LDLIBS += -lupi_ab
85LDLIBS += -L$(zte_lib_path)/libupi_ab
86
87CFLAGS += -I$(zte_lib_path)/libnvram
88
89#*******************************************************************************
90# library path
91#*******************************************************************************
92
93#*******************************************************************************
94# targets
95#*******************************************************************************
96all: $(EXEC)
97
98
99$(EXEC): $(OBJS)
100 $(CC) $(LDFLAGS) -o $@ $^ -Wl,--start-group $(LDLIBS) $(LDLIBS_$@) -Wl,--end-group
101 $(CC) $(LD_BEGIN) -static $(LDFLAGS) -o $@_static $^ -Wl,--start-group $(LDLIBS) $(LDLIBS_$@) -Wl,--end-group $(LD_END)
102 cp $(EXEC) $(EXEC).elf
103 cp $(EXEC)_static $(EXEC)_static.elf
104
105
106
107romfs root_fs:
108 $(ROMFSINST) /bin/$(EXEC)_static
109
110
111clean:
112 -rm -f $(EXEC) $(EXEC)_static *.elf *.gdb *.o ./src/*.o