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.*
|
|
|
|
|
|
|
|
.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 \
|
|
|
|
-L$(BUILDDIR)/lib $(call a2lnk, $(CORE_LIBS)) \
|
|
|
|
-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) $< $@
|