mirror of
https://gitee.com/dlmu-cone/bf_original_balance_chassis
synced 2026-07-24 19:47:44 +08:00
update tutorial for makefile
This commit is contained in:
2
Makefile
2
Makefile
@@ -285,7 +285,7 @@ $(BUILD_DIR):
|
|||||||
# clean up
|
# clean up
|
||||||
#######################################
|
#######################################
|
||||||
clean:
|
clean:
|
||||||
rm -r $(BUILD_DIR)
|
-rm -r $(BUILD_DIR)
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
# dependencies
|
# dependencies
|
||||||
|
|||||||
@@ -706,7 +706,8 @@ all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET
|
|||||||
# list of objects
|
# list of objects
|
||||||
# OBJECTS保存了所有.c文件的文件名(不包含后缀),可以理解为一个文件名列表.notdir会判断是否是文件夹
|
# OBJECTS保存了所有.c文件的文件名(不包含后缀),可以理解为一个文件名列表.notdir会判断是否是文件夹
|
||||||
OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o)))
|
OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o)))
|
||||||
vpath %.c $(sort $(dir $(C_SOURCES))) # 对.c文件进行排序,百分号%是通配符,意为所有.c文件
|
vpath %.c $(sort $(dir $(C_SOURCES))) # 对.c文件进行排序,百分号%是通配符,意为所有.c文件vpath是makefile会搜索的文件的路径.如果最终找不到编译中产生的依赖文件所在的路径且不指定搜索路径,makefile会报错没有规则制定目标(no rule to build target)
|
||||||
|
|
||||||
# list of ASM program objects
|
# list of ASM program objects
|
||||||
# 把所有.s文件的文件名加到OBJECTS里面
|
# 把所有.s文件的文件名加到OBJECTS里面
|
||||||
OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o)))
|
OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o)))
|
||||||
@@ -743,6 +744,7 @@ $(BUILD_DIR): # 如果makefile所处的文件目录下没有build文件夹,这
|
|||||||
clean:
|
clean:
|
||||||
rm -r $(BUILD_DIR)
|
rm -r $(BUILD_DIR)
|
||||||
|
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
# dependencies
|
# dependencies
|
||||||
#######################################
|
#######################################
|
||||||
|
|||||||
Reference in New Issue
Block a user