]> git.donarmstrong.com Git - qmk_firmware.git/blob - keyboard/planck/Makefile
ok
[qmk_firmware.git] / keyboard / planck / Makefile
1 #----------------------------------------------------------------------------
2 # On command line:
3 #
4 # make all = Make software.
5 #
6 # make clean = Clean out built project files.
7 #
8 # make coff = Convert ELF to AVR COFF.
9 #
10 # make extcoff = Convert ELF to AVR Extended COFF.
11 #
12 # make program = Download the hex file to the device.
13 #                Please customize your programmer settings(PROGRAM_CMD)
14 #
15 # make teensy = Download the hex file to the device, using teensy_loader_cli.
16 #               (must have teensy_loader_cli installed).
17 #
18 # make dfu = Download the hex file to the device, using dfu-programmer (must
19 #            have dfu-programmer installed).
20 #
21 # make flip = Download the hex file to the device, using Atmel FLIP (must
22 #             have Atmel FLIP installed).
23 #
24 # make dfu-ee = Download the eeprom file to the device, using dfu-programmer
25 #               (must have dfu-programmer installed).
26 #
27 # make flip-ee = Download the eeprom file to the device, using Atmel FLIP
28 #                (must have Atmel FLIP installed).
29 #
30 # make debug = Start either simulavr or avarice as specified for debugging, 
31 #              with avr-gdb or avr-insight as the front end for debugging.
32 #
33 # make filename.s = Just compile filename.c into the assembler code only.
34 #
35 # make filename.i = Create a preprocessed source file for use in submitting
36 #                   bug reports to the GCC project.
37 #
38 # To rebuild project do "make clean" then "make all".
39 #----------------------------------------------------------------------------
40
41 # Target file name (without extension).
42 TARGET = planck_lufa
43
44 # Directory common source filess exist
45 TOP_DIR = ../..
46
47 # Directory keyboard dependent files exist
48 TARGET_DIR = .
49
50
51
52 # # project specific files
53 ifdef COMMON
54
55         SRC = keymap_common.c \
56         led.c \
57         backlight.c \
58         beeps.c 
59
60 ifdef KEYMAP
61     SRC := common_keymaps/keymap_$(KEYMAP).c $(SRC)
62 else
63     SRC := common_keymaps/keymap_jack.c $(SRC)
64 endif
65
66 ifdef MATRIX
67     SRC := matrix_$(MATRIX).c $(SRC)
68 else
69     SRC := matrix_pcb.c $(SRC)
70 endif
71
72 else
73
74 SRC = extended_keymap_common.c \
75         analog.c \
76         led.c \
77         backlight.c \
78         beeps.c 
79
80 ifdef KEYMAP
81     SRC := extended_keymaps/extended_keymap_$(KEYMAP).c $(SRC)
82 else
83     SRC := extended_keymaps/extended_keymap_default.c $(SRC)
84 endif
85
86 ifdef MATRIX
87     SRC := matrix_$(MATRIX).c $(SRC)
88 else
89     SRC := matrix_pcb.c $(SRC)
90 endif
91
92 endif
93
94 CONFIG_H = config.h
95
96 # MCU name
97 #MCU = at90usb1287
98 MCU = atmega32u4
99
100 # Processor frequency.
101 #     This will define a symbol, F_CPU, in all source code files equal to the
102 #     processor frequency in Hz. You can then use this symbol in your source code to
103 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done
104 #     automatically to create a 32-bit value in your source code.
105 #
106 #     This will be an integer division of F_USB below, as it is sourced by
107 #     F_USB after it has run through any CPU prescalers. Note that this value
108 #     does not *change* the processor frequency - it should merely be updated to
109 #     reflect the processor speed set externally so that the code can use accurate
110 #     software delays.
111 F_CPU = 16000000
112
113
114 #
115 # LUFA specific
116 #
117 # Target architecture (see library "Board Types" documentation).
118 ARCH = AVR8
119
120 # Input clock frequency.
121 #     This will define a symbol, F_USB, in all source code files equal to the
122 #     input clock frequency (before any prescaling is performed) in Hz. This value may
123 #     differ from F_CPU if prescaling is used on the latter, and is required as the
124 #     raw input clock is fed directly to the PLL sections of the AVR for high speed
125 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
126 #     at the end, this will be done automatically to create a 32-bit value in your
127 #     source code.
128 #
129 #     If no clock division is performed on the input clock inside the AVR (via the
130 #     CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
131 F_USB = $(F_CPU)
132
133 # Interrupt driven control endpoint task(+60)
134 OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
135
136
137 # Boot Section Size in *bytes*
138 #   Teensy halfKay   512
139 #   Teensy++ halfKay 1024
140 #   Atmel DFU loader 4096
141 #   LUFA bootloader  4096
142 #   USBaspLoader     2048
143 OPT_DEFS += -DBOOTLOADER_SIZE=4096
144
145
146 # Build Options
147 #   comment out to disable the options.
148 #
149 BOOTMAGIC_ENABLE = yes  # Virtual DIP switch configuration(+1000)
150 MOUSEKEY_ENABLE = yes   # Mouse keys(+4700)
151 EXTRAKEY_ENABLE = yes   # Audio control and System control(+450)
152 CONSOLE_ENABLE = yes    # Console for debug(+400)
153 COMMAND_ENABLE = yes    # Commands for debug and configuration
154 # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
155 #SLEEP_LED_ENABLE = yes  # Breathing sleep LED during USB suspend
156 NKRO_ENABLE = yes       # USB Nkey Rollover - not yet supported in LUFA
157 BACKLIGHT_ENABLE = yes  # Enable keyboard backlight functionality
158
159 # Optimize size but this may cause error "relocation truncated to fit"
160 #EXTRALDFLAGS = -Wl,--relax
161
162 # Search Path
163 VPATH += $(TARGET_DIR)
164 VPATH += $(TOP_DIR)
165
166 include $(TOP_DIR)/protocol/lufa.mk
167 include $(TOP_DIR)/common.mk
168 include $(TOP_DIR)/rules.mk