2008-11-20 11:27:31 +00:00
|
|
|
# __________ __ ___.
|
|
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
# \/ \/ \/ \/ \/
|
2008-11-25 19:54:23 +00:00
|
|
|
# $Id$
|
2008-11-20 11:27:31 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
INCLUDES += -I$(APPSDIR)
|
|
|
|
SRC += $(call preprocess, $(APPSDIR)/SOURCES)
|
|
|
|
|
2011-06-19 17:23:18 +00:00
|
|
|
CONFIGFILE := $(FIRMDIR)/export/config/$(MODELNAME).h
|
2008-11-20 11:27:31 +00:00
|
|
|
BOOTLDS := $(FIRMDIR)/target/$(CPU)/$(MANUFACTURER)/boot.lds
|
|
|
|
BOOTLINK := $(BUILDDIR)/boot.link
|
|
|
|
|
|
|
|
CLEANOBJS += $(BUILDDIR)/bootloader.*
|
|
|
|
|
2020-10-13 23:02:27 +00:00
|
|
|
# FIXME: PP arm targets need this, otherwise we can't find __div0
|
|
|
|
EXTRA_SPECIAL_LIBS = $(call a2lnk, $(CORE_LIBS))
|
|
|
|
|
2008-11-20 11:27:31 +00:00
|
|
|
.SECONDEXPANSION:
|
|
|
|
|
2011-06-19 17:23:18 +00:00
|
|
|
$(BOOTLINK): $(BOOTLDS) $(CONFIGFILE)
|
2008-11-20 11:27:31 +00:00
|
|
|
$(call PRINTS,PP $(@F))
|
|
|
|
$(call preprocess2file,$<,$@,-DLOADADDRESS=$(LOADADDRESS))
|
|
|
|
|
2012-03-26 21:55:02 +00:00
|
|
|
$(BUILDDIR)/bootloader.elf: $$(OBJ) $(FIRMLIB) $(CORE_LIBS) $$(BOOTLINK)
|
2008-11-20 11:27:31 +00:00
|
|
|
$(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJ) \
|
2012-03-26 21:55:02 +00:00
|
|
|
-L$(BUILDDIR)/firmware -lfirmware \
|
2020-10-13 23:02:27 +00:00
|
|
|
-L$(BUILDDIR)/lib $(call a2lnk, $(CORE_LIBS)) $(EXTRA_SPECIAL_LIBS) \
|
2012-03-26 21:55:02 +00:00
|
|
|
-lgcc -T$(BOOTLINK) $(GLOBAL_LDOPTS) \
|
2012-02-22 08:01:09 +00:00
|
|
|
-Wl,--gc-sections -Wl,-Map,$(BUILDDIR)/bootloader.map
|
2008-11-20 11:27:31 +00:00
|
|
|
|
|
|
|
$(BUILDDIR)/bootloader.bin : $(BUILDDIR)/bootloader.elf
|
2012-04-04 19:43:22 +00:00
|
|
|
$(call PRINTS,OC $(@F))$(call objcopy,$<,$@)
|
2008-11-20 11:27:31 +00:00
|
|
|
|
|
|
|
$(BUILDDIR)/$(BINARY) : $(BUILDDIR)/bootloader.bin
|
|
|
|
$(call PRINTS,Build bootloader file)$(MKFIRMWARE) $< $@
|