blob: e3dfcfd700f1bf3751a375ee7f9baf2fec343268 [file] [log] [blame]
# /*****************************************************************************
#* °æÈ¨ËùÓÐ (C)2015, ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾¡£
#*
#* ÎļþÃû³Æ: Makefile
#* Îļþ±êʶ: Makefile
#* ÄÚÈÝÕªÒª: Makefile of ZTE applications
#* ʹÓ÷½·¨: void
#*
#* ÐÞ¸ÄÈÕÆÚ °æ±¾ºÅ Ð޸ıê¼Ç ÐÞ¸ÄÈË ÐÞ¸ÄÄÚÈÝ
#* -----------------------------------------------------------------------------
#* 2022/07/13 V1.0 Create zln ´´½¨
#*
# ******************************************************************************/
#*******************************************************************************
# include ZTE application makefile
#*******************************************************************************
.EXPORT_ALL_VARIABLES:
include $(COMMON_MK)
#*******************************************************************************
# execute
#*******************************************************************************
EXEC = fota_upi_ab
#*******************************************************************************
# objects
#*******************************************************************************
SRCS=$(wildcard ./src/*.c)
OBJS = $(patsubst %.c,%.o,$(SRCS))
#*******************************************************************************
# include path
#*******************************************************************************
CFLAGS += -Wall -g
CFLAGS += -Werror=implicit-int \
-Werror=implicit-function-declaration \
-Werror=float-equal \
-Werror=return-type \
-Werror=enum-compare \
-Werror=init-self
CFLAGS += -O2
CFLAGS += -I../include
CFLAGS += -I./inc \
-I$(zte_lib_path)/libssl/install/include \
-I$(zte_lib_path)/libupi_ab/inc
#*******************************************************************************
# macro definition
#*******************************************************************************
ifeq ($(PRJ_IS_MIN),yes)
CFLAGS += -D_IS_MIN
endif
ifeq ($(CONFIG_USER_FOTA_OPEN_SOURCE),n)
CFLAGS += -D_USE_SYSTEM_COMMAND
endif
#*******************************************************************************
# library
#*******************************************************************************
LDLIBS += -lsoft_timer_sc -L$(zte_lib_path)/libsoft_timer
LDLIBS += -lpthread
LDLIBS += -lsoftap
LDLIBS += -lnvram_sc
# SHA512 functions in libcrypto.a not libssl
#LDLIBS += -lssl
LDLIBS += -lcrypto
LDLIBS += -L$(zte_lib_path)/libssl/install/lib
LDLIBS += -L$(zte_lib_path)/libnvram
LDLIBS += -L$(zte_lib_path)/libsoftap
#LDLIBS += -lcpnv -L$(LIB_DIR)/libcpnv
LDLIBS += -lupi_ab
LDLIBS += -L$(zte_lib_path)/libupi_ab
CFLAGS += -I$(zte_lib_path)/libnvram
#*******************************************************************************
# library path
#*******************************************************************************
#*******************************************************************************
# targets
#*******************************************************************************
all: $(EXEC)
$(EXEC): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $^ -Wl,--start-group $(LDLIBS) $(LDLIBS_$@) -Wl,--end-group
$(CC) $(LD_BEGIN) -static $(LDFLAGS) -o $@_static $^ -Wl,--start-group $(LDLIBS) $(LDLIBS_$@) -Wl,--end-group $(LD_END)
cp $(EXEC) $(EXEC).elf
cp $(EXEC)_static $(EXEC)_static.elf
romfs root_fs:
$(ROMFSINST) /bin/$(EXEC)_static
clean:
-rm -f $(EXEC) $(EXEC)_static *.elf *.gdb *.o ./src/*.o