]> git.donarmstrong.com Git - qmk_firmware.git/blob - keyboard/planck/Makefile
Merge branch 'master' of https://github.com/jackhumbert/tmk_keyboard into smarkefile
[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
43
44
45 # Directory common source filess exist
46 TOP_DIR = ../..
47 TMK_DIR = ../../tmk_core
48
49 # Directory keyboard dependent files exist
50 TARGET_DIR = .
51
52 # # project specific files
53 SRC = planck.c \
54         backlight.c 
55
56 ifdef keymap
57         KEYMAP = $(keymap)
58 endif
59
60 ifdef KEYMAP
61 ifneq ("$(wildcard keymaps/$(KEYMAP).c)","")
62         KEYMAP_FILE = keymaps/$(KEYMAP).c
63 else
64 ifneq ("$(wildcard keymaps/$(KEYMAP)/keymap.c)","")
65         KEYMAP_FILE = keymaps/$(KEYMAP)/keymap.c
66 else
67 $(error Keymap file does not exist)
68 endif
69 endif
70 else
71 ifneq ("$(wildcard keymaps/default.c)","")
72         KEYMAP_FILE = keymaps/default.c
73 else
74         KEYMAP_FILE = keymaps/default/keymap.c
75 endif
76 endif
77 SRC := $(KEYMAP_FILE) $(SRC)
78
79 CONFIG_H = config.h
80
81 # MCU name
82 #MCU = at90usb1287
83 MCU = atmega32u4
84
85 # Processor frequency.
86 #     This will define a symbol, F_CPU, in all source code files equal to the
87 #     processor frequency in Hz. You can then use this symbol in your source code to
88 #     calculate timings. Do NOT tack on a 'UL' at the end, this will be done
89 #     automatically to create a 32-bit value in your source code.
90 #
91 #     This will be an integer division of F_USB below, as it is sourced by
92 #     F_USB after it has run through any CPU prescalers. Note that this value
93 #     does not *change* the processor frequency - it should merely be updated to
94 #     reflect the processor speed set externally so that the code can use accurate
95 #     software delays.
96 F_CPU = 16000000
97
98
99 #
100 # LUFA specific
101 #
102 # Target architecture (see library "Board Types" documentation).
103 ARCH = AVR8
104
105 # Input clock frequency.
106 #     This will define a symbol, F_USB, in all source code files equal to the
107 #     input clock frequency (before any prescaling is performed) in Hz. This value may
108 #     differ from F_CPU if prescaling is used on the latter, and is required as the
109 #     raw input clock is fed directly to the PLL sections of the AVR for high speed
110 #     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
111 #     at the end, this will be done automatically to create a 32-bit value in your
112 #     source code.
113 #
114 #     If no clock division is performed on the input clock inside the AVR (via the
115 #     CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
116 F_USB = $(F_CPU)
117
118 # Interrupt driven control endpoint task(+60)
119 OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
120
121
122 # Boot Section Size in *bytes*
123 #   Teensy halfKay   512
124 #   Teensy++ halfKay 1024
125 #   Atmel DFU loader 4096
126 #   LUFA bootloader  4096
127 #   USBaspLoader     2048
128 OPT_DEFS += -DBOOTLOADER_SIZE=4096
129
130
131 # Build Options
132 #   comment out to disable the options.
133 #
134 BOOTMAGIC_ENABLE = yes  # Virtual DIP switch configuration(+1000)
135 MOUSEKEY_ENABLE = yes   # Mouse keys(+4700)
136 EXTRAKEY_ENABLE = yes   # Audio control and System control(+450)
137 CONSOLE_ENABLE = yes    # Console for debug(+400)
138 COMMAND_ENABLE = yes    # Commands for debug and configuration
139 # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
140 # SLEEP_LED_ENABLE = yes  # Breathing sleep LED during USB suspend
141 # NKRO_ENABLE = yes             # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
142 BACKLIGHT_ENABLE = yes  # Enable keyboard backlight functionality
143 # MIDI_ENABLE = YES             # MIDI controls
144 # UNICODE_ENABLE = YES          # Unicode
145 # BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID
146
147
148 # Optimize size but this may cause error "relocation truncated to fit"
149 #EXTRALDFLAGS = -Wl,--relax
150
151 # Search Path
152 VPATH += $(TARGET_DIR)
153 VPATH += $(TOP_DIR)
154 VPATH += $(TMK_DIR)
155
156 include $(TOP_DIR)/quantum/quantum.mk
157