]> git.donarmstrong.com Git - qmk_firmware.git/blob - tmk_core/rules.mk
Merge pull request #364 from techtomas/techtomas
[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 # Autodecct teensy loader
321 ifneq (, $(shell which teensy-loader-cli 2>/dev/null))
322   TEENSY_LOADER_CLI = teensy-loader-cli
323 else
324   TEENSY_LOADER_CLI = teensy_loader_cli
325 endif
326
327 # Define Messages
328 # English
329 MSG_ERRORS_NONE = Errors: none
330 MSG_BEGIN = -------- begin --------
331 MSG_END = --------  end  --------
332 MSG_SIZE_BEFORE = Size before: 
333 MSG_SIZE_AFTER = Size after:
334 MSG_COFF = Converting to AVR COFF:
335 MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
336 MSG_FLASH = Creating load file for Flash:
337 MSG_EEPROM = Creating load file for EEPROM:
338 MSG_EXTENDED_LISTING = Creating Extended Listing:
339 MSG_SYMBOL_TABLE = Creating Symbol Table:
340 MSG_LINKING = Linking:
341 MSG_COMPILING = Compiling C:
342 MSG_COMPILING_CPP = Compiling C++:
343 MSG_ASSEMBLING = Assembling:
344 MSG_CLEANING = Cleaning project:
345 MSG_CREATING_LIBRARY = Creating library:
346
347
348
349
350 # Define all object files.
351 OBJ = $(patsubst %.c,$(OBJDIR)/%.o,$(patsubst %.cpp,$(OBJDIR)/%.o,$(patsubst %.S,$(OBJDIR)/%.o,$(SRC))))
352
353 # Define all listing files.
354 LST = $(patsubst %.c,$(OBJDIR)/%.lst,$(patsubst %.cpp,$(OBJDIR)/%.lst,$(patsubst %.S,$(OBJDIR)/%.lst,$(SRC))))
355
356
357 # Compiler flags to generate dependency files.
358 #GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
359 GENDEPFLAGS = -MMD -MP -MF .dep/$(subst /,_,$@).d
360
361
362 # Combine all necessary flags and optional flags.
363 # Add target processor to flags.
364 # You can give extra flags at 'make' command line like: make EXTRAFLAGS=-DFOO=bar
365 ALL_CFLAGS = -mmcu=$(MCU) $(CFLAGS) $(GENDEPFLAGS) $(EXTRAFLAGS)
366 ALL_CPPFLAGS = -mmcu=$(MCU) -x c++ $(CPPFLAGS) $(GENDEPFLAGS) $(EXTRAFLAGS)
367 ALL_ASFLAGS = -mmcu=$(MCU) -x assembler-with-cpp $(ASFLAGS) $(EXTRAFLAGS)
368
369
370
371
372
373 # Default target.
374 all: 
375         $(MAKE) begin 
376         $(MAKE) gccversion 
377         $(MAKE) sizebefore 
378         $(MAKE) build 
379         $(MAKE) sizeafter 
380         $(MAKE) end
381
382 # Change the build target to build a HEX file or a library.
383 build: elf hex eep lss sym
384 #build: lib
385
386
387 elf: $(TARGET).elf
388 hex: $(TARGET).hex
389 eep: $(TARGET).eep
390 lss: $(TARGET).lss
391 sym: $(TARGET).sym
392 LIBNAME=lib$(TARGET).a
393 lib: $(LIBNAME)
394
395
396
397 # Eye candy.
398 # AVR Studio 3.x does not check make's exit code but relies on
399 # the following magic strings to be generated by the compile job.
400 begin:
401         @echo $(MSG_BEGIN)
402
403 end:
404         @echo $(MSG_END)
405
406
407 # Display size of file.
408 HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
409 #ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
410 ELFSIZE = $(SIZE) $(TARGET).elf
411
412 sizebefore:
413         @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
414         2>/dev/null; echo; fi
415
416 sizeafter:
417         @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
418         2>/dev/null; echo; fi
419
420
421
422 # Display compiler version information.
423 gccversion : 
424         @$(CC) --version
425
426
427
428 # Program the device.  
429 program: $(TARGET).hex $(TARGET).eep
430         $(PROGRAM_CMD)
431
432 teensy: $(TARGET).hex
433         $(TEENSY_LOADER_CLI) -mmcu=$(MCU) -w -v $(TARGET).hex
434
435 flip: $(TARGET).hex
436         batchisp -hardware usb -device $(MCU) -operation erase f
437         batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
438         batchisp -hardware usb -device $(MCU) -operation start reset 0
439
440 dfu: $(TARGET).hex sizeafter
441 ifneq (, $(findstring 0.7, $(shell dfu-programmer --version 2>&1)))
442         dfu-programmer $(MCU) erase --force
443 else
444         dfu-programmer $(MCU) erase
445 endif
446         dfu-programmer $(MCU) erase
447         dfu-programmer $(MCU) flash $(TARGET).hex
448         dfu-programmer $(MCU) reset
449         
450 dfu-start:
451         dfu-programmer $(MCU) reset
452         dfu-programmer $(MCU) start
453
454 flip-ee: $(TARGET).hex $(TARGET).eep
455         $(COPY) $(TARGET).eep $(TARGET)eep.hex
456         batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
457         batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
458         batchisp -hardware usb -device $(MCU) -operation start reset 0
459         $(REMOVE) $(TARGET)eep.hex
460
461 dfu-ee: $(TARGET).hex $(TARGET).eep
462 ifneq (, $(findstring 0.7, $(shell dfu-programmer --version 2>&1)))
463         dfu-programmer $(MCU) flash --eeprom $(TARGET).eep
464 else
465         dfu-programmer $(MCU) flash-eeprom $(TARGET).eep
466 endif
467         dfu-programmer $(MCU) reset
468
469
470 # Generate avr-gdb config/init file which does the following:
471 #     define the reset signal, load the target file, connect to target, and set 
472 #     a breakpoint at main().
473 gdb-config: 
474         @$(REMOVE) $(GDBINIT_FILE)
475         @echo define reset >> $(GDBINIT_FILE)
476         @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
477         @echo end >> $(GDBINIT_FILE)
478         @echo file $(TARGET).elf >> $(GDBINIT_FILE)
479         @echo target remote $(DEBUG_HOST):$(DEBUG_PORT)  >> $(GDBINIT_FILE)
480 ifeq ($(DEBUG_BACKEND),simulavr)
481         @echo load  >> $(GDBINIT_FILE)
482 endif
483         @echo break main >> $(GDBINIT_FILE)
484
485 debug: gdb-config $(TARGET).elf
486 ifeq ($(DEBUG_BACKEND), avarice)
487         @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
488         @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
489         $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
490         @$(WINSHELL) /c pause
491
492 else
493         @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
494         $(DEBUG_MFREQ) --port $(DEBUG_PORT)
495 endif
496         @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
497
498
499
500
501 # Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
502 COFFCONVERT = $(OBJCOPY) --debugging
503 COFFCONVERT += --change-section-address .data-0x800000
504 COFFCONVERT += --change-section-address .bss-0x800000
505 COFFCONVERT += --change-section-address .noinit-0x800000
506 COFFCONVERT += --change-section-address .eeprom-0x810000
507
508
509
510 coff: $(TARGET).elf
511         @echo $(MSG_COFF) $(TARGET).cof
512         $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
513
514
515 extcoff: $(TARGET).elf
516         @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
517         $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
518
519
520
521 # Create final output files (.hex, .eep) from ELF output file.
522 %.hex: %.elf
523         @echo $(MSG_FLASH) $@
524         $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock -R .signature $< $@
525
526 %.eep: %.elf
527         @echo $(MSG_EEPROM) $@
528         -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
529         --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
530
531 # Create extended listing file from ELF output file.
532 %.lss: %.elf
533         @echo $(MSG_EXTENDED_LISTING) $@
534         $(OBJDUMP) -h -S -z $< > $@
535
536 # Create a symbol table from ELF output file.
537 %.sym: %.elf
538         @echo $(MSG_SYMBOL_TABLE) $@
539         $(NM) -n $< > $@
540
541
542
543 # Create library from object files.
544 .SECONDARY : $(TARGET).a
545 .PRECIOUS : $(OBJ)
546 %.a: $(OBJ)
547         @echo $(MSG_CREATING_LIBRARY) $@
548         $(AR) $@ $(OBJ)
549
550
551 # Link: create ELF output file from object files.
552 .SECONDARY : $(TARGET).elf
553 .PRECIOUS : $(OBJ)
554 %.elf: $(OBJ)
555         @echo $(MSG_LINKING) $@
556         $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
557
558
559 # Compile: create object files from C source files.
560 $(OBJDIR)/%.o : %.c
561         mkdir -p $(@D)
562         @echo $(MSG_COMPILING) $<
563         $(CC) -c $(ALL_CFLAGS) $< -o $@ 
564
565
566 # Compile: create object files from C++ source files.
567 $(OBJDIR)/%.o : %.cpp
568         mkdir -p $(@D)
569         @echo $(MSG_COMPILING_CPP) $<
570         $(CC) -c $(ALL_CPPFLAGS) $< -o $@ 
571
572
573 # Compile: create assembler files from C source files.
574 %.s : %.c
575         $(CC) -S $(ALL_CFLAGS) $< -o $@
576
577
578 # Compile: create assembler files from C++ source files.
579 %.s : %.cpp
580         $(CC) -S $(ALL_CPPFLAGS) $< -o $@
581
582
583 # Assemble: create object files from assembler source files.
584 $(OBJDIR)/%.o : %.S
585         mkdir -p $(@D)
586         @echo $(MSG_ASSEMBLING) $<
587         $(CC) -c $(ALL_ASFLAGS) $< -o $@
588
589
590 # Create preprocessed source for use in sending a bug report.
591 %.i : %.c
592         $(CC) -E -mmcu=$(MCU) $(CFLAGS) $< -o $@ 
593
594
595 # Target: clean project.
596 clean: begin clean_list end
597
598 clean_list :
599         $(REMOVE) $(TARGET).hex
600         $(REMOVE) $(TARGET).eep
601         $(REMOVE) $(TARGET).cof
602         $(REMOVE) $(TARGET).elf
603         $(REMOVE) $(TARGET).map
604         $(REMOVE) $(TARGET).sym
605         $(REMOVE) $(TARGET).lss
606         $(REMOVE) $(OBJ)
607         $(REMOVE) $(LST)
608         $(REMOVE) $(OBJ:.o=.s)
609         $(REMOVE) $(OBJ:.o=.i)
610         $(REMOVE) -r .dep
611         $(REMOVE) -r $(OBJDIR)
612
613 show_path:
614         @echo VPATH=$(VPATH)
615         @echo SRC=$(SRC)
616
617
618 # Create object files directory
619 $(shell mkdir $(OBJDIR) 2>/dev/null)
620
621
622 # Include the dependency files.
623 -include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
624
625
626 # Listing of phony targets.
627 .PHONY : all begin finish end sizebefore sizeafter gccversion \
628 build elf hex eep lss sym coff extcoff \
629 clean clean_list debug gdb-config show_path \
630 program teensy dfu flip dfu-ee flip-ee dfu-start