From 744b4f4764297883f0a4b70adab0d8e91bd8b842 Mon Sep 17 00:00:00 2001 From: Jim Paris Date: Fri, 24 Sep 2010 18:27:14 -0400 Subject: [PATCH] Fix typo, used wrong name for TARGETS_WITH_ROM_VARS. Also makes the pretty print output specify whether we're linking against romvars or not. --- Makefile.include | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/Makefile.include b/Makefile.include index 709714894..8419be117 100644 --- a/Makefile.include +++ b/Makefile.include @@ -2,7 +2,7 @@ # Set up a default target in case the user didn't already have one. # "all" means to build .bin for all defined targets for the currently-defined board -all: $(addsuffix _$(BOARD).bin, $(TARGETS) $(TARGETS_ROMVARS)) +all: $(addsuffix _$(BOARD).bin, $(TARGETS) $(TARGETS_WITH_ROM_VARS)) .PHONY: all # Pretty print output. Use "make Q=" to see full commands @@ -61,17 +61,22 @@ include $(MC1322X)/lib/Makefile.lib include $(MC1322X)/src/Makefile.src ##### -# Rule for building ELF files. We generate both a wildcard rule -# that links $(SRCLIB) as well as target-specific rules that link $(SRCLIB_ROMVARS) +# Rule for building ELF files. We use both a wildcard rule that links +# $(SRCLIB) as well as target-specific rules that link $(SRCLIB_ROMVARS) + +# Normal targets (wildcard rule): +%_$(BOARD).elf: $(OBJDIR)/%.o $(OBJDIR)/board.a $(MC1322X)/lib/libmc1322x.a $(SRCLIB) + $(call pretty,LINK,$@) + $Q$(CC) $(LDFLAGS) -o $@ -Wl,--start-group $^ -lm -Wl,--end-group + +# Targets that need space for rom variables: define build_elf_rule -$(1)_$$(BOARD).elf: $$(OBJDIR)/$(1).o $$(OBJDIR)/board.a $$(MC1322X)/lib/libmc1322x.a $(2) - $$(call pretty,LINK,$$@) +$(1)_$$(BOARD).elf: $$(OBJDIR)/$(1).o $$(OBJDIR)/board.a $$(MC1322X)/lib/libmc1322x.a $$(SRCLIB_ROMVARS) + $$(call pretty,LINK (romvars),$$@) $$Q$$(CC) $$(LDFLAGS) -o $$@ -Wl,--start-group $$^ -lm -Wl,--end-group endef -# Targets that need space for rom variables: -$(foreach t, $(TARGETS_ROMVARS), $(eval $(call build_elf_rule,$(t),$(SRCLIB_ROMVARS)))) -# All other targets (wildcard rule): -$(eval $(call build_elf_rule,%,$(SRCLIB))) +$(foreach t, $(TARGETS_WITH_ROM_VARS), $(eval $(call build_elf_rule,$(t)))) + # Generic rules %.srec: %.elf @@ -115,7 +120,6 @@ endef clean:: rm -f *.{o,d,a,bin,elf,ihex,srec,dis,map,bak} *~ - rm -rf obj_* .PHONY: clean