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