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 = libsoft_timer.a |
| 8 | LIB_SHARED = libsoft_timer.so |
| 9 | LIB_STATIC_SC = libsoft_timer_sc.a |
| 10 | LIB_SHARED_SC = libsoft_timer_sc.so |
| 11 | |
| 12 | OBJS = soft_timer.o |
| 13 | OBJS2 = soft_timer_api_wrapper.o |
| 14 | |
| 15 | CFLAGS += -g |
| 16 | |
| 17 | LDFLAGS += -lpthread |
| 18 | |
| 19 | ##############USER COMIZE END################## |
| 20 | |
| 21 | CFLAGS += -I$(APP_DIR)/include |
| 22 | CFLAGS += -fPIC |
| 23 | |
| 24 | LDFLAGS += -shared |
| 25 | |
| 26 | ifeq ($(MK_SDK_VERSION),yes) |
| 27 | all: |
| 28 | echo "libsoft_timer skip build in sdk version" |
| 29 | else |
| 30 | all: $(LIB_STATIC) $(LIB_SHARED) $(LIB_STATIC_SC) $(LIB_SHARED_SC) |
| 31 | endif |
| 32 | |
| 33 | $(LIB_STATIC) : $(OBJS) $(OBJS2) |
| 34 | $(AR) rcs $@ $(OBJS) $(OBJS2) |
| 35 | |
| 36 | $(LIB_SHARED): $(OBJS) $(OBJS2) |
| 37 | $(CC) $(LDFLAGS) -o $@ $(OBJS) $(OBJS2) |
| 38 | |
| 39 | $(LIB_STATIC_SC) : $(OBJS) |
| 40 | $(AR) rcs $@ $(OBJS) |
| 41 | |
| 42 | $(LIB_SHARED_SC): $(OBJS) |
| 43 | $(CC) $(LDFLAGS) -o $@ $(OBJS) |
| 44 | |
| 45 | romfs: |
| 46 | ifeq ($(LIBSOFT_TIMER_API_NEW),yes) |
| 47 | $(ROMFSINST) $(LIB_SHARED_SC) /lib/$(LIB_SHARED_SC) |
| 48 | cd $(ROOTFS_DIR)/lib && rm -f $(LIB_SHARED) && ln -s $(LIB_SHARED_SC) $(LIB_SHARED) |
| 49 | else |
| 50 | |
| 51 | $(ROMFSINST) $(LIB_SHARED) /lib/$(LIB_SHARED) |
| 52 | cd $(ROOTFS_DIR)/lib && rm -f $(LIB_SHARED_SC) && ln -s $(LIB_SHARED) $(LIB_SHARED_SC) |
| 53 | endif |
| 54 | |
| 55 | clean: |
| 56 | ifeq ($(MK_SDK_VERSION),yes) |
| 57 | echo "libsoft_timer skip clean in sdk version" |
| 58 | else |
| 59 | -$(RM) *.a *.o *.so |
| 60 | endif |
| 61 | |