diff --git a/firmware/Makefile b/firmware/Makefile index 9e3b49f..ce7052f 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -120,7 +120,12 @@ SYSTEM += test/tmain.c # Linker Scripts # # +ifdef BOOTLOADER +LINKERS ?= chip/$(shell echo $(TARGET_CHIP) | $(TR) A-Z a-z)_bootloader.ld +else LINKERS ?= chip/$(shell echo $(TARGET_CHIP) | $(TR) A-Z a-z).ld chip/sections.ld +endif +LINKERS += chip/sections.ld # Our compilation target # @@ -162,7 +167,7 @@ all: $(TARGET).elf etags # .d as a target, so that if they stop existing the corresponding # object file will be re-compiled. # -$(OUTPUT_PATH)%.o: %.c +$(OUTPUT_PATH)%.o: %.c Makefile config.mk @$(ECHO) @$(ECHO) 'Compiling $<...' @$(MKDIR) $(OUTPUT_PATH)$(dir $<) diff --git a/firmware/config.mk b/firmware/config.mk index 5cd2f9b..4092b0f 100644 --- a/firmware/config.mk +++ b/firmware/config.mk @@ -30,6 +30,10 @@ PROJECT_NAME := pico # TARGET_CHIP := SAMD20E18 +# Build for bootloader? +# +#BOOTLOADER := true + # Compiliation Flags # # Use this to set the debug level