3 # Copyright (C) Dean Camera, 2012.
5 # dean [at] fourwalledcubicle [dot] com
9 LUFA_BUILD_MODULES += AVRDUDE
10 LUFA_BUILD_TARGETS += program
12 # -----------------------------------------------------------------------------
13 # LUFA DFU Bootloader Buildsystem Makefile Module.
14 # -----------------------------------------------------------------------------
16 # Provides a set of targets to re-program a device using the open source
18 # -----------------------------------------------------------------------------
21 # program - Program target with application using avr-dude
23 # MANDATORY PARAMETERS:
25 # MCU - Microcontroller device model name
26 # TARGET - Application name
28 # OPTIONAL PARAMETERS:
30 # AVRDUDE_PROGRAMMER - Name of programming hardware to use
31 # AVRDUDE_PORT - Name of communication port to use
32 # AVRDUDE_FLAGS - Flags to pass to avr-dude
34 # -----------------------------------------------------------------------------
37 MSG_AVRDUDE_CMD = ' [AVRDUDE] :'
39 # Default values of user-supplied variables
40 AVRDUDE_PROGRAMMER ?= jtagicemkii
42 AVRDUDE_FLAGS ?= -U flash:w:$(TARGET).hex
44 # Sanity check the user MCU and TARGET makefile options
46 $(error Makefile MCU value not set.)
49 $(error Makefile TARGET value not set.)
52 program: $(TARGET).hex
53 @echo $(MSG_AVRDUDE_CMD) Programming device \"$(MCU)\" with settings \"$(AVRDUDE_FLAGS)\" using \"$(AVRDUDE_PROGRAMMER)\" on port \"$(AVRDUDE_PORT)\"
54 avrdude -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) $(AVRDUDE_FLAGS)