]> git.gir.st - tmk_keyboard.git/blob - keyboard/lufa/Makefile
initial attempt for LUFA.
[tmk_keyboard.git] / keyboard / lufa / Makefile
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. <<
5 #
6 # Released to the Public Domain
7 #
8 # Additional material for this makefile was written by:
9 # Peter Fleury
10 # Tim Henigan
11 # Colin O'Flynn
12 # Reiner Patommel
13 # Markus Pfaff
14 # Sander Pool
15 # Frederik Rouleau
16 # Carlos Lamas
17 # Dean Camera
18 # Opendous Inc.
19 # Denver Gingerich
20 #
21 #----------------------------------------------------------------------------
22 # On command line:
23 #
24 # make all = Make software.
25 #
26 # make clean = Clean out built project files.
27 #
28 # make coff = Convert ELF to AVR COFF.
29 #
30 # make extcoff = Convert ELF to AVR Extended COFF.
31 #
32 # make program = Download the hex file to the device, using avrdude.
33 # Please customize the avrdude settings below first!
34 #
35 # make dfu = Download the hex file to the device, using dfu-programmer (must
36 # have dfu-programmer installed).
37 #
38 # make flip = Download the hex file to the device, using Atmel FLIP (must
39 # have Atmel FLIP installed).
40 #
41 # make dfu-ee = Download the eeprom file to the device, using dfu-programmer
42 # (must have dfu-programmer installed).
43 #
44 # make flip-ee = Download the eeprom file to the device, using Atmel FLIP
45 # (must have Atmel FLIP installed).
46 #
47 # make doxygen = Generate DoxyGen documentation for the project (must have
48 # DoxyGen installed)
49 #
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.
52 #
53 # make filename.s = Just compile filename.c into the assembler code only.
54 #
55 # make filename.i = Create a preprocessed source file for use in submitting
56 # bug reports to the GCC project.
57 #
58 # To rebuild project do "make clean" then "make all".
59 #----------------------------------------------------------------------------
60
61 # Directory common source filess exist
62 TOP_DIR = ../..
63
64 # Directory keyboard dependent files exist
65 TARGET_DIR = .
66
67 # MCU name
68 #MCU = at90usb1287
69 MCU = atmega32u4
70
71
72 # Target architecture (see library "Board Types" documentation).
73 ARCH = AVR8
74
75
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.
79 BOARD = USBKEY
80
81
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.
87 #
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
92 # software delays.
93 F_CPU = 16000000
94
95
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
103 # source code.
104 #
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.
107 F_USB = $(F_CPU)
108
109
110 # Target file name (without extension).
111 TARGET = lufa
112
113
114 # Path to the LUFA library
115 LUFA_PATH = ../../protocol
116
117 # Create the LUFA source path variables by including the LUFA root makefile
118 include $(LUFA_PATH)/LUFA/makefile
119
120
121
122 # List C source files here. (C dependencies are automatically generated.)
123 LSRC = $(TARGET).c \
124 Descriptors.c \
125 $(LUFA_SRC_USB) \
126 $(LUFA_SRC_USBCLASS)
127
128 SRC = $(subst $(LUFA_PATH)/LUFA/,,$(LSRC))
129 SRC += keymap.c \
130 matrix.c \
131 led.c \
132 sendchar_null.c
133 CONFIG_H = config.h
134
135
136
137 # LUFA library compile-time options and predefined tokens
138 LUFA_OPTS = -D USB_DEVICE_ONLY
139 LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
140 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
141 LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
142 LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
143
144 OPT_DEFS = -DF_CPU=$(F_CPU)UL
145 OPT_DEFS += -DF_USB=$(F_USB)UL
146 OPT_DEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH)
147 OPT_DEFS += $(LUFA_OPTS)
148
149
150
151 # Search Path
152 VPATH += $(TARGET_DIR)
153 VPATH += $(LUFA_PATH)/LUFA
154
155
156 include $(TOP_DIR)/protocol.mk
157 include $(TOP_DIR)/common.mk
158 include $(TOP_DIR)/rules.mk
159
160 test:
161 echo $(SRC)
Imprint / Impressum