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.
This commit is contained in:
Jim Paris 2010-09-24 18:27:14 -04:00
parent 0c163122da
commit 744b4f4764

View file

@ -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