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:
parent
0c163122da
commit
744b4f4764
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
# Set up a default target in case the user didn't already have one.
|
# 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" 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
|
.PHONY: all
|
||||||
|
|
||||||
# Pretty print output. Use "make Q=" to see full commands
|
# Pretty print output. Use "make Q=" to see full commands
|
||||||
|
@ -61,17 +61,22 @@ include $(MC1322X)/lib/Makefile.lib
|
||||||
include $(MC1322X)/src/Makefile.src
|
include $(MC1322X)/src/Makefile.src
|
||||||
|
|
||||||
#####
|
#####
|
||||||
# Rule for building ELF files. We generate both a wildcard rule
|
# Rule for building ELF files. We use both a wildcard rule that links
|
||||||
# that links $(SRCLIB) as well as target-specific rules that link $(SRCLIB_ROMVARS)
|
# $(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
|
define build_elf_rule
|
||||||
$(1)_$$(BOARD).elf: $$(OBJDIR)/$(1).o $$(OBJDIR)/board.a $$(MC1322X)/lib/libmc1322x.a $(2)
|
$(1)_$$(BOARD).elf: $$(OBJDIR)/$(1).o $$(OBJDIR)/board.a $$(MC1322X)/lib/libmc1322x.a $$(SRCLIB_ROMVARS)
|
||||||
$$(call pretty,LINK,$$@)
|
$$(call pretty,LINK (romvars),$$@)
|
||||||
$$Q$$(CC) $$(LDFLAGS) -o $$@ -Wl,--start-group $$^ -lm -Wl,--end-group
|
$$Q$$(CC) $$(LDFLAGS) -o $$@ -Wl,--start-group $$^ -lm -Wl,--end-group
|
||||||
endef
|
endef
|
||||||
# Targets that need space for rom variables:
|
$(foreach t, $(TARGETS_WITH_ROM_VARS), $(eval $(call build_elf_rule,$(t))))
|
||||||
$(foreach t, $(TARGETS_ROMVARS), $(eval $(call build_elf_rule,$(t),$(SRCLIB_ROMVARS))))
|
|
||||||
# All other targets (wildcard rule):
|
|
||||||
$(eval $(call build_elf_rule,%,$(SRCLIB)))
|
|
||||||
|
|
||||||
# Generic rules
|
# Generic rules
|
||||||
%.srec: %.elf
|
%.srec: %.elf
|
||||||
|
@ -115,7 +120,6 @@ endef
|
||||||
|
|
||||||
clean::
|
clean::
|
||||||
rm -f *.{o,d,a,bin,elf,ihex,srec,dis,map,bak} *~
|
rm -f *.{o,d,a,bin,elf,ihex,srec,dis,map,bak} *~
|
||||||
rm -rf obj_*
|
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue