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