xf.li | bfc6e71 | 2025-02-07 01:54:34 -0800 | [diff] [blame] | 1 | #******************************************************************************* |
| 2 | # include ZTE library makefile |
| 3 | #******************************************************************************* |
| 4 | include $(COMMON_MK) |
| 5 | |
| 6 | LIB_STATIC = libupi_ab.a |
| 7 | LIB_SHARED = libupi_ab.so |
| 8 | |
| 9 | SRCS=$(wildcard ./src/*.c) |
| 10 | OBJS = $(patsubst %.c,%.o,$(SRCS)) |
| 11 | |
| 12 | #定义宏和头文件目录,要用+=,不要用=,否则会覆盖COMMON_MK里的值 |
| 13 | CFLAGS += -g -O2 -marm -I./upi_ab/inc |
| 14 | CFLAGS += -Wall -g |
| 15 | |
| 16 | CFLAGS += -Werror=implicit-int \ |
| 17 | -Werror=implicit-function-declaration \ |
| 18 | -Werror=float-equal \ |
| 19 | -Werror=return-type \ |
| 20 | -Werror=enum-compare \ |
| 21 | -Werror=init-self |
| 22 | |
| 23 | CFLAGS += -O2 |
| 24 | CFLAGS += -I../../app/include |
| 25 | CFLAGS += -I./inc \ |
| 26 | -I$(zte_lib_path)/libssl/install/include |
| 27 | |
| 28 | #下面不要修改 |
| 29 | CFLAGS += -fPIC |
| 30 | LDFLAGS += -shared |
| 31 | |
| 32 | ifeq ($(MK_SDK_VERSION),yes) |
| 33 | all: |
| 34 | echo "libupi_ab skip build in sdk version" |
| 35 | else |
| 36 | all: $(LIB_STATIC) $(LIB_SHARED) |
| 37 | endif |
| 38 | |
| 39 | $(LIB_STATIC) : $(OBJS) |
| 40 | $(AR) rcs $(LIB_STATIC) $(OBJS) |
| 41 | |
| 42 | $(LIB_SHARED): $(OBJS) |
| 43 | $(CC) $(LDFLAGS) -o $@ $^ |
| 44 | |
| 45 | romfs: |
| 46 | $(ROMFSINST) $(LIB_SHARED) /lib/$(LIB_SHARED) |
| 47 | |
| 48 | clean: |
| 49 | ifeq ($(MK_SDK_VERSION),yes) |
| 50 | echo "libupi_ab skip clean in sdk version" |
| 51 | else |
| 52 | -@rm *.a *.o *.so $(LIB_SHARED) $(LIB_STATIC) $(OBJS) |
| 53 | endif |