lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | #******************************************************************************* |
| 2 | # include ZTE library makefile |
| 3 | #******************************************************************************* |
| 4 | include $(COMMON_MK) |
| 5 | |
| 6 | ##############USER COMIZE BEGIN################ |
| 7 | LIB_STATIC = libnvram.a |
| 8 | LIB_SHARED = libnvram.so |
| 9 | LIB_STATIC_SC = libnvram_sc.a |
| 10 | LIB_SHARED_SC = libnvram_sc.so |
| 11 | |
| 12 | OBJS = nv_api.o cfg_api.o sys_infra.o |
| 13 | OBJS2 = cfg_api_wrapper.o |
| 14 | |
| 15 | CFLAGS += -g |
| 16 | #LDFLAGS += -lpthread |
| 17 | ##############USER COMIZE END################## |
| 18 | |
| 19 | CFLAGS += -I$(APP_DIR)/include |
| 20 | CFLAGS += -fPIC |
| 21 | LDFLAGS += -shared |
| 22 | |
| 23 | ifeq ($(MK_SDK_VERSION),yes) |
| 24 | all: |
| 25 | echo "libnvram skip build in sdk version" |
| 26 | else |
| 27 | all: $(LIB_STATIC) $(LIB_SHARED) $(LIB_STATIC_SC) $(LIB_SHARED_SC) |
| 28 | endif |
| 29 | |
| 30 | $(LIB_STATIC) : $(OBJS) $(OBJS2) |
| 31 | $(AR) rcs $@ $(OBJS) $(OBJS2) |
| 32 | |
| 33 | $(LIB_SHARED): $(OBJS) $(OBJS2) |
| 34 | $(CC) $(LDFLAGS) -o $@ $(OBJS) $(OBJS2) |
| 35 | |
| 36 | $(LIB_STATIC_SC) : $(OBJS) |
| 37 | $(AR) rcs $@ $(OBJS) |
| 38 | |
| 39 | $(LIB_SHARED_SC): $(OBJS) |
| 40 | $(CC) $(LDFLAGS) -o $@ $(OBJS) |
| 41 | |
| 42 | romfs: |
| 43 | ifeq ($(LIBNVRAM_API_NEW),yes) |
| 44 | $(ROMFSINST) $(LIB_SHARED_SC) /lib/$(LIB_SHARED_SC) |
| 45 | cd $(ROOTFS_DIR)/lib && rm -f $(LIB_SHARED) && ln -s $(LIB_SHARED_SC) $(LIB_SHARED) |
| 46 | else |
| 47 | $(ROMFSINST) $(LIB_SHARED) /lib/$(LIB_SHARED) |
| 48 | cd $(ROOTFS_DIR)/lib && rm -f $(LIB_SHARED_SC) && ln -s $(LIB_SHARED) $(LIB_SHARED_SC) |
| 49 | endif |
| 50 | |
| 51 | clean: |
| 52 | ifeq ($(MK_SDK_VERSION),yes) |
| 53 | echo "libupi_ab skip clean in sdk version" |
| 54 | else |
| 55 | -$(RM) *.a *.o *.so |
| 56 | endif |
| 57 | |