blob: 870f50048ee5417d992bd6db9eccd34a83469b7a [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#*******************************************************************************
2# include ZTE library makefile
3#*******************************************************************************
4include $(COMMON_MK)
5
6##############USER COMIZE BEGIN################
7LIB_STATIC = libnvram.a
8LIB_SHARED = libnvram.so
9LIB_STATIC_SC = libnvram_sc.a
10LIB_SHARED_SC = libnvram_sc.so
11
12OBJS = nv_api.o cfg_api.o sys_infra.o
13OBJS2 = cfg_api_wrapper.o
14
15CFLAGS += -g
16#LDFLAGS += -lpthread
17##############USER COMIZE END##################
18
19CFLAGS += -I$(APP_DIR)/include
20CFLAGS += -fPIC
21LDFLAGS += -shared
22
23ifeq ($(MK_SDK_VERSION),yes)
24all:
25 echo "libnvram skip build in sdk version"
26else
27all: $(LIB_STATIC) $(LIB_SHARED) $(LIB_STATIC_SC) $(LIB_SHARED_SC)
28endif
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
42romfs:
43ifeq ($(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)
46else
47 $(ROMFSINST) $(LIB_SHARED) /lib/$(LIB_SHARED)
48 cd $(ROOTFS_DIR)/lib && rm -f $(LIB_SHARED_SC) && ln -s $(LIB_SHARED) $(LIB_SHARED_SC)
49endif
50
51clean:
52ifeq ($(MK_SDK_VERSION),yes)
53 echo "libupi_ab skip clean in sdk version"
54else
55 -$(RM) *.a *.o *.so
56endif
57