Replace architecture specific makefiles in the BuildTests with the new common build...
[pub/USBasp.git] / LUFA / Build / lufa.avrdude.in
1 #
2 # LUFA Library
3 # Copyright (C) Dean Camera, 2012.
4 #
5 # dean [at] fourwalledcubicle [dot] com
6 # www.lufa-lib.org
7 #
8
9 LUFA_BUILD_MODULES += AVRDUDE
10 LUFA_BUILD_TARGETS += program
11
12 # -----------------------------------------------------------------------------
13 # LUFA DFU Bootloader Buildsystem Makefile Module.
14 # -----------------------------------------------------------------------------
15 # DESCRIPTION:
16 # Provides a set of targets to re-program a device using the open source
17 # avr-dude utility.
18 # -----------------------------------------------------------------------------
19 # TARGETS:
20 #
21 # program - Program target with application using avr-dude
22 #
23 # MANDATORY PARAMETERS:
24 #
25 # MCU - Microcontroller device model name
26 # TARGET - Application name
27 #
28 # OPTIONAL PARAMETERS:
29 #
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
33 #
34 # -----------------------------------------------------------------------------
35
36 # Output Messages
37 MSG_AVRDUDE_CMD = ' [AVRDUDE] :'
38
39 # Default values of user-supplied variables
40 AVRDUDE_PROGRAMMER ?= jtagicemkii
41 AVRDUDE_PORT ?= usb
42 AVRDUDE_FLAGS ?= -U flash:w:$(TARGET).hex
43
44 # Sanity check the user MCU and TARGET makefile options
45 ifeq ($(MCU),)
46 $(error Makefile MCU value not set.)
47 endif
48 ifeq ($(TARGET),)
49 $(error Makefile TARGET value not set.)
50 endif
51
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)