unwarminder: fix bootloader builds

Change-Id: I045a4c9639ff17c96b514996574d41f586b5bd7c
This commit is contained in:
Marcin Bukat 2012-02-22 09:01:09 +01:00
parent b4eab59951
commit 164cb21fe5

View file

@ -18,15 +18,21 @@ CLEANOBJS += $(BUILDDIR)/bootloader.*
.SECONDEXPANSION:
ifeq (arm,$(ARCH))
UNWARMINDER_LINK := -lunwarminder -L$(BUILDDIR)/lib
else
UNWARMINDER_LINK :=
endif
$(BOOTLINK): $(BOOTLDS) $(CONFIGFILE)
$(call PRINTS,PP $(@F))
$(call preprocess2file,$<,$@,-DLOADADDRESS=$(LOADADDRESS))
$(BUILDDIR)/bootloader.elf: $$(OBJ) $$(FIRMLIB) $$(BOOTLINK)
$(BUILDDIR)/bootloader.elf: $$(OBJ) $$(FIRMLIB) $$(UNWARMINDER) $$(BOOTLINK)
$(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJ) \
$(FIRMLIB) -lgcc -L$(BUILDDIR)/firmware -T$(BOOTLINK) \
$(GLOBAL_LDOPTS) \
-Wl,--gc-sections -Wl,-Map,$(BUILDDIR)/bootloader.map
$(FIRMLIB) $(UNWARMINDER_LINK) -lgcc -L$(BUILDDIR)/firmware \
-T$(BOOTLINK) $(GLOBAL_LDOPTS) \
-Wl,--gc-sections -Wl,-Map,$(BUILDDIR)/bootloader.map
$(BUILDDIR)/bootloader.bin : $(BUILDDIR)/bootloader.elf
$(call PRINTS,OBJCOPY $(@F))$(OC) $(if $(filter yes, $(USE_ELF)), -S -x, -O binary) $< $@