lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 1 | #******************************************************************************* |
| 2 | # include build/common makefile |
| 3 | # 以生成两个应用为例,如果只有一个删除EXEC2 OBJS2即可 |
| 4 | #******************************************************************************* |
| 5 | include $(COMMON_MK) |
| 6 | |
| 7 | EXEC = nxp_rxintorxout |
| 8 | OBJS = nxp_rxintorxout.o |
| 9 | #EXEC 特有的LIB参数 |
| 10 | #LDLIBS_demo1 = -lnvram_sc -L$(LIB_DIR)/libnvram |
| 11 | |
| 12 | |
| 13 | #宏和头文件目录在CFLAGS里定义,要用+=,不要用=,否则会覆盖COMMON_MK里的值 |
| 14 | #CFLAGS += -I$(APP_DIR)/include |
| 15 | |
| 16 | #EXEC EXEC2 公共LIB参数,第一行定义LDLIBS用=,不要用+=,应用连接的库都在本Makefile定义 |
| 17 | LDLIBS = -lpthread |
| 18 | |
| 19 | #******************************************************************************* |
| 20 | # targets |
| 21 | #******************************************************************************* |
| 22 | all: $(EXEC) |
| 23 | |
| 24 | $(EXEC): $(OBJS) |
| 25 | $(CC) $(LDFLAGS) -o $@ $^ -Wl,--start-group $(LDLIBS) $(LDLIBS_$@) -Wl,--end-group |
| 26 | @cp $@ $@.elf |
| 27 | |
| 28 | romfs: |
| 29 | cp -v $(EXEC) $(APP_DIR)/test_tools/ |
| 30 | |
| 31 | clean: |
| 32 | -@rm -f $(EXEC) *.elf *.gdb *.o |