unwarminder: fix bootloader builds
Change-Id: I045a4c9639ff17c96b514996574d41f586b5bd7c
diff --git a/bootloader/bootloader.make b/bootloader/bootloader.make
index 78b8b43..f57fac0 100644
--- a/bootloader/bootloader.make
+++ b/bootloader/bootloader.make
@@ -18,15 +18,21 @@
.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) $< $@