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