Arduino 1K Bootloader Makefile

The bootloader is based originally on the Diecimilla bootloader that shipped with Arduino 13 (although 13 wasn't out yet), then gutted and turned inside out until it was small enough.

The Make File

The Makefile requires only a few changes to set compilation options and set the new EFUSE and LDSECTION. The patch is repeated below, or you can grab the full make file.

28c28
< LDSECTION  = --section-start=.text=0x3800
---
> LDSECTION  = --section-start=.text=0x3C00
52c52
< OPTIMIZE   = -O2
---
> OPTIMIZE   = -Os -funsigned-char -fno-split-wide-types -fno-inline-small-functions -mcall-prologues -ffunction-sections -fdata-sections
62c62
< override LDFLAGS       = -Wl,$(LDSECTION)
---
> override LDFLAGS       = -Wl,$(LDSECTION) -Wl,--relax -nostartfiles -Wl,-gc-sections
79c79
< lilypad_isp: EFUSE = 00
---
> lilypad_isp: EFUSE = 02
91c91
< lilypad_resonator_isp: EFUSE = 00
---
> lilypad_resonator_isp: EFUSE = 02
103c103
< pro8_isp: EFUSE = 00
---
> pro8_isp: EFUSE = 02
115c115
< pro16_isp: EFUSE = 00
---
> pro16_isp: EFUSE = 02
127c127
< pro20_isp: EFUSE = 00
---
> pro20_isp: EFUSE = 02
139c139
< diecimila_isp: EFUSE = 00
---
> diecimila_isp: EFUSE = 02
151c151
< ng_isp: EFUSE = 00
---
> ng_isp: EFUSE = 02
158c158
< atmega328: LDSECTION  = --section-start=.text=0x7800
---
> atmega328: LDSECTION  = --section-start=.text=0x7C00
164c164
< atmega328_isp: HFUSE = DA
---
> atmega328_isp: HFUSE = DC