]> git.donarmstrong.com Git - qmk_firmware.git/blob - tmk_core/rules.mk
Updated readme to fix a typo and list out hotkey shortcuts
[qmk_firmware.git] / tmk_core / rules.mk
1 # Hey Emacs, this is a -*- makefile -*-
2 #----------------------------------------------------------------------------
3 # WinAVR Makefile Template written by Eric B. Weddington, Jg Wunsch, et al.
4 #
5 # Released to the Public Domain
6 #
7 # Additional material for this makefile was written by:
8 # Peter Fleury
9 # Tim Henigan
10 # Colin O'Flynn
11 # Reiner Patommel
12 # Markus Pfaff
13 # Sander Pool
14 # Frederik Rouleau
15 # Carlos Lamas
16 #
17 #----------------------------------------------------------------------------
18 # On command line:
19 #
20 # make all = Make software.
21 #
22 # make clean = Clean out built project files.
23 #
24 # make coff = Convert ELF to AVR COFF.
25 #
26 # make extcoff = Convert ELF to AVR Extended COFF.
27 #
28 # make program = Download the hex file to the device.
29 #                Please customize your programmer settings(PROGRAM_CMD)
30 #
31 # make teensy = Download the hex file to the device, using teensy_loader_cli.
32 #               (must have teensy_loader_cli installed).
33 #
34 # make dfu = Download the hex file to the device, using dfu-programmer (must
35 #            have dfu-programmer installed).
36 #
37 # make flip = Download the hex file to the device, using Atmel FLIP (must
38 #             have Atmel FLIP installed).
39 #
40 # make dfu-ee = Download the eeprom file to the device, using dfu-programmer
41 #               (must have dfu-programmer installed).
42 #
43 # make flip-ee = Download the eeprom file to the device, using Atmel FLIP
44 #                (must have Atmel FLIP installed).
45 #
46 # make debug = Start either simulavr or avarice as specified for debugging, 
47 #              with avr-gdb or avr-insight as the front end for debugging.
48 #
49 # make filename.s = Just compile filename.c into the assembler code only.
50 #
51 # make filename.i = Create a preprocessed source file for use in submitting
52 #                   bug reports to the GCC project.
53 #
54 # To rebuild project do "make clean" then "make all".
55 #----------------------------------------------------------------------------
56
57
58 # Output format. (can be srec, ihex, binary)
59 FORMAT = ihex
60
61
62 # Object files directory
63 #     To put object files in current directory, use a dot (.), do NOT make
64 #     this an empty or blank macro!
65 OBJDIR = obj_$(TARGET)
66
67
68 # Optimization level, can be [0, 1, 2, 3, s]. 
69 #     0 = turn off optimization. s = optimize for size.
70 #     (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
71 OPT = s
72
73
74 # Debugging format.
75 #     Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
76 #     AVR Studio 4.10 requires dwarf-2.
77 #     AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
78 DEBUG = dwarf-2
79
80
81 # List any extra directories to look for include files here.
82 #     Each directory must be seperated by a space.
83 #     Use forward slashes for directory separators.
84 #     For a directory that has spaces, enclose it in quotes.
85 EXTRAINCDIRS = $(subst :, ,$(VPATH))
86
87
88 # Compiler flag to set the C Standard level.
89 #     c89   = "ANSI" C
90 #     gnu89 = c89 plus GCC extensions
91 #     c99   = ISO C99 standard (not yet fully implemented)
92 #     gnu99 = c99 plus GCC extensions
93 CSTANDARD = -std=gnu99
94
95
96 # Place -D or -U options here for C sources
97 CDEFS = -DF_CPU=$(F_CPU)UL
98 CDEFS += $(OPT_DEFS)
99
100
101 # Place -D or -U options here for ASM sources
102 ADEFS = -DF_CPU=$(F_CPU)
103 ADEFS += $(OPT_DEFS)
104
105
106 # Place -D or -U options here for C++ sources
107 CPPDEFS = -DF_CPU=$(F_CPU)UL
108 #CPPDEFS += -D__STDC_LIMIT_MACROS
109 #CPPDEFS += -D__STDC_CONSTANT_MACROS
110 CPPDEFS += $(OPT_DEFS)
111
112
113
114 #---------------- Compiler Options C ----------------
115 #  -g*:          generate debugging information
116 #  -O*:          optimization level
117 #  -f...:        tuning, see GCC manual and avr-libc documentation
118 #  -Wall...:     warning level
119 #  -Wa,...:      tell GCC to pass this to the assembler.
120 #    -adhlns...: create assembler listing
121 CFLAGS = -g$(DEBUG)
122 CFLAGS += $(CDEFS)
123 CFLAGS += -O$(OPT)
124 CFLAGS += -funsigned-char
125 CFLAGS += -funsigned-bitfields
126 CFLAGS += -ffunction-sections
127 CFLAGS += -fdata-sections
128 CFLAGS += -fno-inline-small-functions
129 CFLAGS += -fpack-struct
130 CFLAGS += -fshort-enums
131 CFLAGS += -fno-strict-aliasing
132 CFLAGS += -Wall
133 CFLAGS += -Wstrict-prototypes
134 #CFLAGS += -mshort-calls
135 #CFLAGS += -fno-unit-at-a-time
136 #CFLAGS += -Wundef
137 #CFLAGS += -Wunreachable-code
138 #CFLAGS += -Wsign-compare
139 CFLAGS += -Wa,-adhlns=$(@:%.o=%.lst)
140 CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
141 CFLAGS += $(CSTANDARD)
142 ifdef CONFIG_H
143     CFLAGS += -include $(CONFIG_H)
144 endif
145 ifdef CONFIG_USER_H
146     CFLAGS += -include $(CONFIG_USER_H)
147 endif
148
149
150 #---------------- Compiler Options C++ ----------------
151 #  -g*:          generate debugging information
152 #  -O*:          optimization level
153 #  -f...:        tuning, see GCC manual and avr-libc documentation
154 #  -Wall...:     warning level
155 #  -Wa,...:      tell GCC to pass this to the assembler.
156 #    -adhlns...: create assembler listing
157 CPPFLAGS = -g$(DEBUG)
158 CPPFLAGS += $(CPPDEFS)
159 CPPFLAGS += -O$(OPT)
160 CPPFLAGS += -funsigned-char
161 CPPFLAGS += -funsigned-bitfields
162 CPPFLAGS += -fpack-struct
163 CPPFLAGS += -fshort-enums
164 CPPFLAGS += -fno-exceptions
165 CPPFLAGS += -ffunction-sections
166 CPPFLAGS += -fdata-sections
167 # to supress "warning: only initialized variables can be placed into program memory area"
168 CPPFLAGS += -w
169 CPPFLAGS += -Wall
170 CPPFLAGS += -Wundef
171 #CPPFLAGS += -mshort-calls
172 #CPPFLAGS += -fno-unit-at-a-time
173 #CPPFLAGS += -Wstrict-prototypes
174 #CPPFLAGS += -Wunreachable-code
175 #CPPFLAGS += -Wsign-compare
176 CPPFLAGS += -Wa,-adhlns=$(@:%.o=%.lst)
177 CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
178 #CPPFLAGS += $(CSTANDARD)
179 ifdef CONFIG_H
180     CPPFLAGS += -include $(CONFIG_H)
181 endif
182 ifdef CONFIG_USER_H
183     CPPFLAGS += -include $(CONFIG_USER_H)
184 endif
185
186
187 #---------------- Assembler Options ----------------
188 #  -Wa,...:   tell GCC to pass this to the assembler.
189 #  -adhlns:   create listing
190 #  -gstabs:   have the assembler create line number information; note that
191 #             for use in COFF files, additional information about filenames
192 #             and function names needs to be present in the assembler source
193 #             files -- see avr-libc docs [FIXME: not yet described there]
194 #  -listing-cont-lines: Sets the maximum number of continuation lines of hex 
195 #       dump that will be displayed for a given single line of source input.
196 ASFLAGS = $(ADEFS) -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100
197 ASFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
198 ifdef CONFIG_H
199     ASFLAGS += -include $(CONFIG_H)
200 endif
201 ifdef CONFIG_USER_H
202     ASFLAGS += -include $(CONFIG_USER_H)
203 endif
204
205
206 #---------------- Library Options ----------------
207 # Minimalistic printf version
208 PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
209
210 # Floating point printf version (requires MATH_LIB = -lm below)
211 PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
212
213 # If this is left blank, then it will use the Standard printf version.
214 PRINTF_LIB = 
215 #PRINTF_LIB = $(PRINTF_LIB_MIN)
216 #PRINTF_LIB = $(PRINTF_LIB_FLOAT)
217
218
219 # Minimalistic scanf version
220 SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
221
222 # Floating point + %[ scanf version (requires MATH_LIB = -lm below)
223 SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
224
225 # If this is left blank, then it will use the Standard scanf version.
226 SCANF_LIB = 
227 #SCANF_LIB = $(SCANF_LIB_MIN)
228 #SCANF_LIB = $(SCANF_LIB_FLOAT)
229
230
231 MATH_LIB = -lm
232
233
234 # List any extra directories to look for libraries here.
235 #     Each directory must be seperated by a space.
236 #     Use forward slashes for directory separators.
237 #     For a directory that has spaces, enclose it in quotes.
238 EXTRALIBDIRS = 
239
240
241
242 #---------------- External Memory Options ----------------
243
244 # 64 KB of external RAM, starting after internal RAM (ATmega128!),
245 # used for variables (.data/.bss) and heap (malloc()).
246 #EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
247
248 # 64 KB of external RAM, starting after internal RAM (ATmega128!),
249 # only used for heap (malloc()).
250 #EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
251
252 EXTMEMOPTS =
253
254
255
256 #---------------- Linker Options ----------------
257 #  -Wl,...:     tell GCC to pass this to linker.
258 #    -Map:      create map file
259 #    --cref:    add cross reference to  map file
260 #
261 # Comennt out "--relax" option to avoid a error such:
262 #       (.vectors+0x30): relocation truncated to fit: R_AVR_13_PCREL against symbol `__vector_12'
263 #
264 LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
265 #LDFLAGS += -Wl,--relax
266 LDFLAGS += -Wl,--gc-sections
267 LDFLAGS += $(EXTMEMOPTS)
268 LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
269 LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
270 #LDFLAGS += -T linker_script.x
271 # You can give EXTRALDFLAGS at 'make' command line.
272 LDFLAGS += $(EXTRALDFLAGS)
273
274
275
276 #---------------- Debugging Options ----------------
277
278 # For simulavr only - target MCU frequency.
279 DEBUG_MFREQ = $(F_CPU)
280
281 # Set the DEBUG_UI to either gdb or insight.
282 # DEBUG_UI = gdb
283 DEBUG_UI = insight
284
285 # Set the debugging back-end to either avarice, simulavr.
286 DEBUG_BACKEND = avarice
287 #DEBUG_BACKEND = simulavr
288
289 # GDB Init Filename.
290 GDBINIT_FILE = __avr_gdbinit
291
292 # When using avarice settings for the JTAG
293 JTAG_DEV = /dev/com1
294
295 # Debugging port used to communicate between GDB / avarice / simulavr.
296 DEBUG_PORT = 4242
297
298 # Debugging host used to communicate between GDB / avarice / simulavr, normally
299 #     just set to localhost unless doing some sort of crazy debugging when 
300 #     avarice is running on a different computer.
301 DEBUG_HOST = localhost
302
303
304
305 #============================================================================
306
307
308 # Define programs and commands.
309 SHELL = sh
310 CC = avr-gcc
311 OBJCOPY = avr-objcopy
312 OBJDUMP = avr-objdump
313 SIZE = avr-size
314 AR = avr-ar rcs
315 NM = avr-nm
316 REMOVE = rm -f
317 REMOVEDIR = rmdir
318 COPY = cp
319 WINSHELL = cmd
320
321
322 # Define Messages
323 # English
324 MSG_ERRORS_NONE = Errors: none
325 MSG_BEGIN = -------- begin --------
326 MSG_END = --------  end  --------
327 MSG_SIZE_BEFORE = Size before: 
328 MSG_SIZE_AFTER = Size after:
329 MSG_COFF = Converting to AVR COFF:
330 MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
331 MSG_FLASH = Creating load file for Flash:
332 MSG_EEPROM = Creating load file for EEPROM:
333 MSG_EXTENDED_LISTING = Creating Extended Listing:
334 MSG_SYMBOL_TABLE = Creating Symbol Table:
335 MSG_LINKING = Linking:
336 MSG_COMPILING = Compiling C:
337 MSG_COMPILING_CPP = Compiling C++:
338 MSG_ASSEMBLING = Assembling:
339 MSG_CLEANING = Cleaning project:
340 MSG_CREATING_LIBRARY = Creating library:
341
342
343
344
345 # Define all object files.
346 OBJ = $(patsubst %.c,$(OBJDIR)/%.o,$(patsubst %.cpp,$(OBJDIR)/%.o,$(patsubst %.S,$(OBJDIR)/%.o,$(SRC))))
347
348 # Define all listing files.
349 LST = $(patsubst %.c,$(OBJDIR)/%.lst,$(patsubst %.cpp,$(OBJDIR)/%.lst,$(patsubst %.S,$(OBJDIR)/%.lst,$(SRC))))
350
351
352 # Compiler flags to generate dependency files.
353 #GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
354 GENDEPFLAGS = -MMD -MP -MF .dep/$(subst /,_,$@).d
355
356
357 # Combine all necessary flags and optional flags.
358 # Add target processor to flags.
359 # You can give extra flags at 'make' command line like: make EXTRAFLAGS=-DFOO=bar
360 ALL_CFLAGS = -mmcu=$(MCU) $(CFLAGS) $(GENDEPFLAGS) $(EXTRAFLAGS)
361 ALL_CPPFLAGS = -mmcu=$(MCU) -x c++ $(CPPFLAGS) $(GENDEPFLAGS) $(EXTRAFLAGS)
362 ALL_ASFLAGS = -mmcu=$(MCU) -x assembler-with-cpp $(ASFLAGS) $(EXTRAFLAGS)
363
364
365
366
367
368 # Default target.
369 all: 
370         $(MAKE) begin 
371         $(MAKE) gccversion 
372         $(MAKE) sizebefore 
373         $(MAKE) build 
374         $(MAKE) sizeafter 
375         $(MAKE) end
376
377 # Change the build target to build a HEX file or a library.
378 build: elf hex eep lss sym
379 #build: lib
380
381
382 elf: $(TARGET).elf
383 hex: $(TARGET).hex
384 eep: $(TARGET).eep
385 lss: $(TARGET).lss
386 sym: $(TARGET).sym
387 LIBNAME=lib$(TARGET).a
388 lib: $(LIBNAME)
389
390
391
392 # Eye candy.
393 # AVR Studio 3.x does not check make's exit code but relies on
394 # the following magic strings to be generated by the compile job.
395 begin:
396         @echo $(MSG_BEGIN)
397
398 end:
399         @echo $(MSG_END)
400
401
402 # Display size of file.
403 HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
404 #ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
405 ELFSIZE = $(SIZE) $(TARGET).elf
406
407 sizebefore:
408         @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
409         2>/dev/null; echo; fi
410
411 sizeafter:
412         @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
413         2>/dev/null; echo; fi
414
415
416
417 # Display compiler version information.
418 gccversion : 
419         @$(CC) --version
420
421
422
423 # Program the device.  
424 program: $(TARGET).hex $(TARGET).eep
425         $(PROGRAM_CMD)
426
427 teensy: $(TARGET).hex
428         teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex
429
430 flip: $(TARGET).hex
431         batchisp -hardware usb -device $(MCU) -operation erase f
432         batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
433         batchisp -hardware usb -device $(MCU) -operation start reset 0
434
435 dfu: $(TARGET).hex sizeafter
436 ifneq (, $(findstring 0.7, $(shell dfu-programmer --version 2>&1)))
437         dfu-programmer $(MCU) erase --force
438 else
439         dfu-programmer $(MCU) erase
440 endif
441         dfu-programmer $(MCU) erase
442         dfu-programmer $(MCU) flash $(TARGET).hex
443         dfu-programmer $(MCU) reset
444         
445 dfu-start:
446         dfu-programmer $(MCU) reset
447         dfu-programmer $(MCU) start
448
449 flip-ee: $(TARGET).hex $(TARGET).eep
450         $(COPY) $(TARGET).eep $(TARGET)eep.hex
451         batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
452         batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
453         batchisp -hardware usb -device $(MCU) -operation start reset 0
454         $(REMOVE) $(TARGET)eep.hex
455
456 dfu-ee: $(TARGET).hex $(TARGET).eep
457 ifneq (, $(findstring 0.7, $(shell dfu-programmer --version 2>&1)))
458         dfu-programmer $(MCU) flash --eeprom $(TARGET).eep
459 else
460         dfu-programmer $(MCU) flash-eeprom $(TARGET).eep
461 endif
462         dfu-programmer $(MCU) reset
463
464
465 # Generate avr-gdb config/init file which does the following:
466 #     define the reset signal, load the target file, connect to target, and set 
467 #     a breakpoint at main().
468 gdb-config: 
469         @$(REMOVE) $(GDBINIT_FILE)
470         @echo define reset >> $(GDBINIT_FILE)
471         @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
472         @echo end >> $(GDBINIT_FILE)
473         @echo file $(TARGET).elf >> $(GDBINIT_FILE)
474         @echo target remote $(DEBUG_HOST):$(DEBUG_PORT)  >> $(GDBINIT_FILE)
475 ifeq ($(DEBUG_BACKEND),simulavr)
476         @echo load  >> $(GDBINIT_FILE)
477 endif
478         @echo break main >> $(GDBINIT_FILE)
479
480 debug: gdb-config $(TARGET).elf
481 ifeq ($(DEBUG_BACKEND), avarice)
482         @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
483         @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
484         $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
485         @$(WINSHELL) /c pause
486
487 else
488         @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
489         $(DEBUG_MFREQ) --port $(DEBUG_PORT)
490 endif
491         @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
492
493
494
495
496 # Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
497 COFFCONVERT = $(OBJCOPY) --debugging
498 COFFCONVERT += --change-section-address .data-0x800000
499 COFFCONVERT += --change-section-address .bss-0x800000
500 COFFCONVERT += --change-section-address .noinit-0x800000
501 COFFCONVERT += --change-section-address .eeprom-0x810000
502
503
504
505 coff: $(TARGET).elf
506         @echo $(MSG_COFF) $(TARGET).cof
507         $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
508
509
510 extcoff: $(TARGET).elf
511         @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
512         $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
513
514
515
516 # Create final output files (.hex, .eep) from ELF output file.
517 %.hex: %.elf
518         @echo $(MSG_FLASH) $@
519         $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock -R .signature $< $@
520
521 %.eep: %.elf
522         @echo $(MSG_EEPROM) $@
523         -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
524         --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
525
526 # Create extended listing file from ELF output file.
527 %.lss: %.elf
528         @echo $(MSG_EXTENDED_LISTING) $@
529         $(OBJDUMP) -h -S -z $< > $@
530
531 # Create a symbol table from ELF output file.
532 %.sym: %.elf
533         @echo $(MSG_SYMBOL_TABLE) $@
534         $(NM) -n $< > $@
535
536
537
538 # Create library from object files.
539 .SECONDARY : $(TARGET).a
540 .PRECIOUS : $(OBJ)
541 %.a: $(OBJ)
542         @echo $(MSG_CREATING_LIBRARY) $@
543         $(AR) $@ $(OBJ)
544
545
546 # Link: create ELF output file from object files.
547 .SECONDARY : $(TARGET).elf
548 .PRECIOUS : $(OBJ)
549 %.elf: $(OBJ)
550         @echo $(MSG_LINKING) $@
551         $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
552
553
554 # Compile: create object files from C source files.
555 $(OBJDIR)/%.o : %.c
556         mkdir -p $(@D)
557         @echo $(MSG_COMPILING) $<
558         $(CC) -c $(ALL_CFLAGS) $< -o $@ 
559
560
561 # Compile: create object files from C++ source files.
562 $(OBJDIR)/%.o : %.cpp
563         mkdir -p $(@D)
564         @echo $(MSG_COMPILING_CPP) $<
565         $(CC) -c $(ALL_CPPFLAGS) $< -o $@ 
566
567
568 # Compile: create assembler files from C source files.
569 %.s : %.c
570         $(CC) -S $(ALL_CFLAGS) $< -o $@
571
572
573 # Compile: create assembler files from C++ source files.
574 %.s : %.cpp
575         $(CC) -S $(ALL_CPPFLAGS) $< -o $@
576
577
578 # Assemble: create object files from assembler source files.
579 $(OBJDIR)/%.o : %.S
580         mkdir -p $(@D)
581         @echo $(MSG_ASSEMBLING) $<
582         $(CC) -c $(ALL_ASFLAGS) $< -o $@
583
584
585 # Create preprocessed source for use in sending a bug report.
586 %.i : %.c
587         $(CC) -E -mmcu=$(MCU) $(CFLAGS) $< -o $@ 
588
589
590 # Target: clean project.
591 clean: begin clean_list end
592
593 clean_list :
594         $(REMOVE) $(TARGET).hex
595         $(REMOVE) $(TARGET).eep
596         $(REMOVE) $(TARGET).cof
597         $(REMOVE) $(TARGET).elf
598         $(REMOVE) $(TARGET).map
599         $(REMOVE) $(TARGET).sym
600         $(REMOVE) $(TARGET).lss
601         $(REMOVE) $(OBJ)
602         $(REMOVE) $(LST)
603         $(REMOVE) $(OBJ:.o=.s)
604         $(REMOVE) $(OBJ:.o=.i)
605         $(REMOVE) -r .dep
606         $(REMOVE) -r $(OBJDIR)
607
608 show_path:
609         @echo VPATH=$(VPATH)
610         @echo SRC=$(SRC)
611
612
613 # Create object files directory
614 $(shell mkdir $(OBJDIR) 2>/dev/null)
615
616
617 # Include the dependency files.
618 -include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
619
620
621 # Listing of phony targets.
622 .PHONY : all begin finish end sizebefore sizeafter gccversion \
623 build elf hex eep lss sym coff extcoff \
624 clean clean_list debug gdb-config show_path \
625 program teensy dfu flip dfu-ee flip-ee dfu-start