分类:
2012-03-16 17:31:36
原文地址:vivi情景分析(一): 配置管理(十一) 作者:qrskc
7 #.PHONY目标表明不需要真正创建一个名字为“dummy”的文件 8 .PHONY: dummy 177 # A rule to do nothing # 空规则,不需要任何动作,定义dummy的主要目的是之执行dummy下的命令 # 例如 A: dummy # do some thing # 在执行make A时将直接执行“do some thing” 179 dummy: 34 # 35 # Get things started. 36 # # 真正的执行从这里开始 37 first_rule: sub_dirs 38 $(MAKE) all_targets # SUB_DIRS := $(subdir-y) 133 subdir-list = $(sort $(patsubst %,_subdir_%,$(SUB_DIRS))) 134 sub_dirs: dummy $(subdir-list) 136 ifdef SUB_DIRS 137 $(subdir-list) : dummy 138 $(MAKE) -C $(patsubst _subdir_%,%,$@) 139 endif 80 all_targets: $(O_TARGET) $(L_TARGET) 83 # Rule to compile a set of .o files into one .o file 85 ifdef O_TARGET 86 $(O_TARGET): $(obj-y) 87 rm -f $@ 88 ifneq "$(strip $(obj-y))" "" #如果$(obj-y)不为空,则进行连接 89 $(LD) $(EXTRA_LDFLAGS) -r -o $@ $(filter $(obj-y), $^) 90 else #如果$(obj-y)为空,则创建一个名字为$(O_TARGET)的空目标文件 91 $(AR) rcs $@ 92 endif 93 @ ( \ 94 echo 'ifeq ($(strip $(subst $(comma),:,$(EXTRA_LDFLAGS) $(obj-y))),$$(strip $$(subst $$(comma),:,$$(EXTRA_LDFL AGS) $$(obj-y))))' ; \ 95 echo 'FILES_FLAGS_UP_TO_DATE += $@' ; \ 96 echo 'endif' \ 97 ) > $(dir $@)/.$(notdir $@).flags 98 endif |
$(LD) -v $(LINKFLAGS) \ $(HEAD) \ $(CORE_FILES) \ $(DRIVERS) \ $(LIBS) \ -o vivi-elf $(CLIBS) $(NM) -v -l vivi-elf > vivi.map $(OBJCOPY) -O binary -S vivi-elf vivi $(OBJCOPYFLAGS) |