1 # Hey Emacs, this is a -*- makefile -*-
\r
2 #----------------------------------------------------------------------------
\r
3 # WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
\r
4 # >> Modified for use with the LUFA project. <<
\r
6 # Released to the Public Domain
\r
8 # Additional material for this makefile was written by:
\r
21 #----------------------------------------------------------------------------
\r
24 # make all = Make software.
\r
26 # make clean = Clean out built project files.
\r
28 # make coff = Convert ELF to AVR COFF.
\r
30 # make extcoff = Convert ELF to AVR Extended COFF.
\r
32 # make program = Download the hex file to the device, using avrdude.
\r
33 # Please customize the avrdude settings below first!
\r
35 # make dfu = Download the hex file to the device, using dfu-programmer (must
\r
36 # have dfu-programmer installed).
\r
38 # make flip = Download the hex file to the device, using Atmel FLIP (must
\r
39 # have Atmel FLIP installed).
\r
41 # make dfu-ee = Download the eeprom file to the device, using dfu-programmer
\r
42 # (must have dfu-programmer installed).
\r
44 # make flip-ee = Download the eeprom file to the device, using Atmel FLIP
\r
45 # (must have Atmel FLIP installed).
\r
47 # make doxygen = Generate DoxyGen documentation for the project (must have
\r
48 # DoxyGen installed)
\r
50 # make debug = Start either simulavr or avarice as specified for debugging,
\r
51 # with avr-gdb or avr-insight as the front end for debugging.
\r
53 # make filename.s = Just compile filename.c into the assembler code only.
\r
55 # make filename.i = Create a preprocessed source file for use in submitting
\r
56 # bug reports to the GCC project.
\r
58 # To rebuild project do "make clean" then "make all".
\r
59 #----------------------------------------------------------------------------
\r
61 # Directory common source filess exist
\r
64 # Directory keyboard dependent files exist
\r
72 # Target architecture (see library "Board Types" documentation).
\r
76 # Target board (see library "Board Types" documentation, NONE for projects not requiring
\r
77 # LUFA board drivers). If USER is selected, put custom board drivers in a directory called
\r
78 # "Board" inside the application directory.
\r
82 # Processor frequency.
\r
83 # This will define a symbol, F_CPU, in all source code files equal to the
\r
84 # processor frequency in Hz. You can then use this symbol in your source code to
\r
85 # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
\r
86 # automatically to create a 32-bit value in your source code.
\r
88 # This will be an integer division of F_USB below, as it is sourced by
\r
89 # F_USB after it has run through any CPU prescalers. Note that this value
\r
90 # does not *change* the processor frequency - it should merely be updated to
\r
91 # reflect the processor speed set externally so that the code can use accurate
\r
96 # Input clock frequency.
\r
97 # This will define a symbol, F_USB, in all source code files equal to the
\r
98 # input clock frequency (before any prescaling is performed) in Hz. This value may
\r
99 # differ from F_CPU if prescaling is used on the latter, and is required as the
\r
100 # raw input clock is fed directly to the PLL sections of the AVR for high speed
\r
101 # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
\r
102 # at the end, this will be done automatically to create a 32-bit value in your
\r
105 # If no clock division is performed on the input clock inside the AVR (via the
\r
106 # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
\r
110 # Target file name (without extension).
\r
114 # Path to the LUFA library
\r
115 LUFA_PATH = ../../protocol
\r
117 # Create the LUFA source path variables by including the LUFA root makefile
\r
118 include $(LUFA_PATH)/LUFA/makefile
\r
122 # List C source files here. (C dependencies are automatically generated.)
\r
123 LSRC = $(TARGET).c \
\r
126 $(LUFA_SRC_USBCLASS)
\r
128 SRC = $(subst $(LUFA_PATH)/LUFA/,,$(LSRC))
\r
132 CONFIG_H = config.h
\r
136 # LUFA library compile-time options and predefined tokens
\r
137 LUFA_OPTS = -D USB_DEVICE_ONLY
\r
138 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
\r
139 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
\r
140 LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
\r
141 LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
\r
143 OPT_DEFS = -DF_CPU=$(F_CPU)UL
\r
144 OPT_DEFS += -DF_USB=$(F_USB)UL
\r
145 OPT_DEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH)
\r
146 OPT_DEFS += $(LUFA_OPTS)
\r
151 VPATH += $(TARGET_DIR)
\r
152 VPATH += $(LUFA_PATH)/LUFA
\r
155 include $(TOP_DIR)/protocol.mk
\r
156 include $(TOP_DIR)/common.mk
\r
157 include $(TOP_DIR)/rules.mk
\r