lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | #******************************************************************************* |
| 2 | # include ZTE library makefile |
| 3 | #******************************************************************************* |
| 4 | include $(COMMON_MK) |
| 5 | |
| 6 | LIB_STATIC = libdemo.a |
| 7 | LIB_SHARED = libdemo.so |
| 8 | |
| 9 | OBJS = demo.o |
| 10 | |
| 11 | #定义宏和头文件目录,要用+=,不要用=,否则会覆盖COMMON_MK里的值 |
| 12 | CFLAGS += -g |
| 13 | #CFLAGS += -I$(APP_DIR)/include |
| 14 | |
| 15 | #下面不要修改 |
| 16 | CFLAGS += -fPIC |
| 17 | LDFLAGS += -shared |
| 18 | |
| 19 | all: $(LIB_STATIC) $(LIB_SHARED) |
| 20 | |
| 21 | $(LIB_STATIC) : $(OBJS) |
| 22 | $(AR) rcs $(LIB_STATIC) $(OBJS) |
| 23 | |
| 24 | $(LIB_SHARED): $(OBJS) |
| 25 | $(CC) $(LDFLAGS) -o $@ $^ |
| 26 | |
| 27 | romfs: |
| 28 | $(ROMFSINST) $(LIB_SHARED) /lib/$(LIB_SHARED) |
| 29 | |
| 30 | clean: |
| 31 | -@rm *.a *.o *.so $(LIB_SHARED) $(LIB_STATIC) $(OBJS) |