Keyboard firmwares for Atmel AVR and Cortex-M
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

rules.mk 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  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. # Output format. (can be srec, ihex, binary)
  57. FORMAT = ihex
  58. # Object files directory
  59. # To put object files in current directory, use a dot (.), do NOT make
  60. # this an empty or blank macro!
  61. OBJDIR = obj_$(TARGET)
  62. # Optimization level, can be [0, 1, 2, 3, s].
  63. # 0 = turn off optimization. s = optimize for size.
  64. # (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
  65. OPT = s
  66. # Debugging format.
  67. # Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
  68. # AVR Studio 4.10 requires dwarf-2.
  69. # AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
  70. DEBUG = dwarf-2
  71. # List any extra directories to look for include files here.
  72. # Each directory must be seperated by a space.
  73. # Use forward slashes for directory separators.
  74. # For a directory that has spaces, enclose it in quotes.
  75. EXTRAINCDIRS = $(subst :, ,$(VPATH))
  76. # Compiler flag to set the C Standard level.
  77. # c89 = "ANSI" C
  78. # gnu89 = c89 plus GCC extensions
  79. # c99 = ISO C99 standard (not yet fully implemented)
  80. # gnu99 = c99 plus GCC extensions
  81. CSTANDARD = -std=gnu99
  82. # Place -D or -U options here for C sources
  83. CDEFS = -DF_CPU=$(F_CPU)UL
  84. CDEFS += $(OPT_DEFS)
  85. # Place -D or -U options here for ASM sources
  86. ADEFS = -DF_CPU=$(F_CPU)
  87. ADEFS += $(OPT_DEFS)
  88. # Place -D or -U options here for C++ sources
  89. CPPDEFS = -DF_CPU=$(F_CPU)UL
  90. #CPPDEFS += -D__STDC_LIMIT_MACROS
  91. #CPPDEFS += -D__STDC_CONSTANT_MACROS
  92. CPPDEFS += $(OPT_DEFS)
  93. #---------------- Compiler Options C ----------------
  94. # -g*: generate debugging information
  95. # -O*: optimization level
  96. # -f...: tuning, see GCC manual and avr-libc documentation
  97. # -Wall...: warning level
  98. # -Wa,...: tell GCC to pass this to the assembler.
  99. # -adhlns...: create assembler listing
  100. CFLAGS = -g$(DEBUG)
  101. CFLAGS += $(CDEFS)
  102. CFLAGS += -O$(OPT)
  103. CFLAGS += -funsigned-char
  104. CFLAGS += -funsigned-bitfields
  105. CFLAGS += -ffunction-sections
  106. CFLAGS += -fno-inline-small-functions
  107. CFLAGS += -fpack-struct
  108. CFLAGS += -fshort-enums
  109. CFLAGS += -fno-strict-aliasing
  110. CFLAGS += -Wall
  111. CFLAGS += -Wstrict-prototypes
  112. #CFLAGS += -mshort-calls
  113. #CFLAGS += -fno-unit-at-a-time
  114. #CFLAGS += -Wundef
  115. #CFLAGS += -Wunreachable-code
  116. #CFLAGS += -Wsign-compare
  117. CFLAGS += -Wa,-adhlns=$(@:%.o=%.lst)
  118. CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
  119. CFLAGS += $(CSTANDARD)
  120. ifdef CONFIG_H
  121. CFLAGS += -include $(CONFIG_H)
  122. endif
  123. #---------------- Compiler Options C++ ----------------
  124. # -g*: generate debugging information
  125. # -O*: optimization level
  126. # -f...: tuning, see GCC manual and avr-libc documentation
  127. # -Wall...: warning level
  128. # -Wa,...: tell GCC to pass this to the assembler.
  129. # -adhlns...: create assembler listing
  130. CPPFLAGS = -g$(DEBUG)
  131. CPPFLAGS += $(CPPDEFS)
  132. CPPFLAGS += -O$(OPT)
  133. CPPFLAGS += -funsigned-char
  134. CPPFLAGS += -funsigned-bitfields
  135. CPPFLAGS += -fpack-struct
  136. CPPFLAGS += -fshort-enums
  137. CPPFLAGS += -fno-exceptions
  138. CPPFLAGS += -Wall
  139. CPPFLAGS += -Wundef
  140. #CPPFLAGS += -mshort-calls
  141. #CPPFLAGS += -fno-unit-at-a-time
  142. #CPPFLAGS += -Wstrict-prototypes
  143. #CPPFLAGS += -Wunreachable-code
  144. #CPPFLAGS += -Wsign-compare
  145. CPPFLAGS += -Wa,-adhlns=$(@:%.o=%.lst)
  146. CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
  147. #CPPFLAGS += $(CSTANDARD)
  148. ifdef CONFIG_H
  149. CPPFLAGS += -include $(CONFIG_H)
  150. endif
  151. #---------------- Assembler Options ----------------
  152. # -Wa,...: tell GCC to pass this to the assembler.
  153. # -adhlns: create listing
  154. # -gstabs: have the assembler create line number information; note that
  155. # for use in COFF files, additional information about filenames
  156. # and function names needs to be present in the assembler source
  157. # files -- see avr-libc docs [FIXME: not yet described there]
  158. # -listing-cont-lines: Sets the maximum number of continuation lines of hex
  159. # dump that will be displayed for a given single line of source input.
  160. ASFLAGS = $(ADEFS) -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100
  161. ifdef CONFIG_H
  162. ASFLAGS += -include $(CONFIG_H)
  163. endif
  164. #---------------- Library Options ----------------
  165. # Minimalistic printf version
  166. PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
  167. # Floating point printf version (requires MATH_LIB = -lm below)
  168. PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
  169. # If this is left blank, then it will use the Standard printf version.
  170. PRINTF_LIB =
  171. #PRINTF_LIB = $(PRINTF_LIB_MIN)
  172. #PRINTF_LIB = $(PRINTF_LIB_FLOAT)
  173. # Minimalistic scanf version
  174. SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
  175. # Floating point + %[ scanf version (requires MATH_LIB = -lm below)
  176. SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
  177. # If this is left blank, then it will use the Standard scanf version.
  178. SCANF_LIB =
  179. #SCANF_LIB = $(SCANF_LIB_MIN)
  180. #SCANF_LIB = $(SCANF_LIB_FLOAT)
  181. MATH_LIB = -lm
  182. # List any extra directories to look for libraries here.
  183. # Each directory must be seperated by a space.
  184. # Use forward slashes for directory separators.
  185. # For a directory that has spaces, enclose it in quotes.
  186. EXTRALIBDIRS =
  187. #---------------- External Memory Options ----------------
  188. # 64 KB of external RAM, starting after internal RAM (ATmega128!),
  189. # used for variables (.data/.bss) and heap (malloc()).
  190. #EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
  191. # 64 KB of external RAM, starting after internal RAM (ATmega128!),
  192. # only used for heap (malloc()).
  193. #EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
  194. EXTMEMOPTS =
  195. #---------------- Linker Options ----------------
  196. # -Wl,...: tell GCC to pass this to linker.
  197. # -Map: create map file
  198. # --cref: add cross reference to map file
  199. #
  200. # Comennt out "--relax" option to avoid a error such:
  201. # (.vectors+0x30): relocation truncated to fit: R_AVR_13_PCREL against symbol `__vector_12'
  202. #
  203. LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
  204. LDFLAGS += -Wl,--relax
  205. LDFLAGS += -Wl,--gc-sections
  206. LDFLAGS += $(EXTMEMOPTS)
  207. LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
  208. LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
  209. #LDFLAGS += -T linker_script.x
  210. # You can give EXTRALDFLAGS at 'make' command line.
  211. LDFLAGS += $(EXTRALDFLAGS)
  212. #---------------- Debugging Options ----------------
  213. # For simulavr only - target MCU frequency.
  214. DEBUG_MFREQ = $(F_CPU)
  215. # Set the DEBUG_UI to either gdb or insight.
  216. # DEBUG_UI = gdb
  217. DEBUG_UI = insight
  218. # Set the debugging back-end to either avarice, simulavr.
  219. DEBUG_BACKEND = avarice
  220. #DEBUG_BACKEND = simulavr
  221. # GDB Init Filename.
  222. GDBINIT_FILE = __avr_gdbinit
  223. # When using avarice settings for the JTAG
  224. JTAG_DEV = /dev/com1
  225. # Debugging port used to communicate between GDB / avarice / simulavr.
  226. DEBUG_PORT = 4242
  227. # Debugging host used to communicate between GDB / avarice / simulavr, normally
  228. # just set to localhost unless doing some sort of crazy debugging when
  229. # avarice is running on a different computer.
  230. DEBUG_HOST = localhost
  231. #============================================================================
  232. # Define programs and commands.
  233. SHELL = sh
  234. CC = avr-gcc
  235. OBJCOPY = avr-objcopy
  236. OBJDUMP = avr-objdump
  237. SIZE = avr-size
  238. AR = avr-ar rcs
  239. NM = avr-nm
  240. REMOVE = rm -f
  241. REMOVEDIR = rmdir
  242. COPY = cp
  243. WINSHELL = cmd
  244. # Define Messages
  245. # English
  246. MSG_ERRORS_NONE = Errors: none
  247. MSG_BEGIN = -------- begin --------
  248. MSG_END = -------- end --------
  249. MSG_SIZE_BEFORE = Size before:
  250. MSG_SIZE_AFTER = Size after:
  251. MSG_COFF = Converting to AVR COFF:
  252. MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
  253. MSG_FLASH = Creating load file for Flash:
  254. MSG_EEPROM = Creating load file for EEPROM:
  255. MSG_EXTENDED_LISTING = Creating Extended Listing:
  256. MSG_SYMBOL_TABLE = Creating Symbol Table:
  257. MSG_LINKING = Linking:
  258. MSG_COMPILING = Compiling C:
  259. MSG_COMPILING_CPP = Compiling C++:
  260. MSG_ASSEMBLING = Assembling:
  261. MSG_CLEANING = Cleaning project:
  262. MSG_CREATING_LIBRARY = Creating library:
  263. # Define all object files.
  264. OBJ = $(patsubst %.c,$(OBJDIR)/%.o,$(patsubst %.cpp,$(OBJDIR)/%.o,$(patsubst %.S,$(OBJDIR)/%.o,$(SRC))))
  265. # Define all listing files.
  266. LST = $(patsubst %.c,$(OBJDIR)/%.lst,$(patsubst %.cpp,$(OBJDIR)/%.lst,$(patsubst %.S,$(OBJDIR)/%.lst,$(SRC))))
  267. # Compiler flags to generate dependency files.
  268. GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
  269. # Combine all necessary flags and optional flags.
  270. # Add target processor to flags.
  271. # You can give extra flags at 'make' command line like: make EXTRAFLAGS=-DFOO=bar
  272. ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS) $(EXTRAFLAGS)
  273. ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS) $(EXTRAFLAGS)
  274. ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) $(EXTRAFLAGS)
  275. # Default target.
  276. all: begin gccversion sizebefore build sizeafter end
  277. # Change the build target to build a HEX file or a library.
  278. build: elf hex eep lss sym
  279. #build: lib
  280. elf: $(TARGET).elf
  281. hex: $(TARGET).hex
  282. eep: $(TARGET).eep
  283. lss: $(TARGET).lss
  284. sym: $(TARGET).sym
  285. LIBNAME=lib$(TARGET).a
  286. lib: $(LIBNAME)
  287. # Eye candy.
  288. # AVR Studio 3.x does not check make's exit code but relies on
  289. # the following magic strings to be generated by the compile job.
  290. begin:
  291. @echo
  292. @echo $(MSG_BEGIN)
  293. end:
  294. @echo $(MSG_END)
  295. @echo
  296. # Display size of file.
  297. HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
  298. #ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
  299. ELFSIZE = $(SIZE) $(TARGET).elf
  300. sizebefore:
  301. @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
  302. 2>/dev/null; echo; fi
  303. sizeafter:
  304. @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
  305. 2>/dev/null; echo; fi
  306. # Display compiler version information.
  307. gccversion :
  308. @$(CC) --version
  309. # Program the device.
  310. program: $(TARGET).hex $(TARGET).eep
  311. $(PROGRAM_CMD)
  312. teensy: $(TARGET).hex
  313. teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex
  314. flip: $(TARGET).hex
  315. batchisp -hardware usb -device $(MCU) -operation erase f
  316. batchisp -hardware usb -device $(MCU) -operation loadbuffer $(TARGET).hex program
  317. batchisp -hardware usb -device $(MCU) -operation start reset 0
  318. dfu: $(TARGET).hex
  319. dfu-programmer $(MCU) erase
  320. dfu-programmer $(MCU) flash $(TARGET).hex
  321. dfu-programmer $(MCU) reset
  322. flip-ee: $(TARGET).hex $(TARGET).eep
  323. $(COPY) $(TARGET).eep $(TARGET)eep.hex
  324. batchisp -hardware usb -device $(MCU) -operation memory EEPROM erase
  325. batchisp -hardware usb -device $(MCU) -operation memory EEPROM loadbuffer $(TARGET)eep.hex program
  326. batchisp -hardware usb -device $(MCU) -operation start reset 0
  327. $(REMOVE) $(TARGET)eep.hex
  328. dfu-ee: $(TARGET).hex $(TARGET).eep
  329. dfu-programmer $(MCU) eeprom-flash $(TARGET).eep
  330. dfu-programmer $(MCU) reset
  331. # Generate avr-gdb config/init file which does the following:
  332. # define the reset signal, load the target file, connect to target, and set
  333. # a breakpoint at main().
  334. gdb-config:
  335. @$(REMOVE) $(GDBINIT_FILE)
  336. @echo define reset >> $(GDBINIT_FILE)
  337. @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
  338. @echo end >> $(GDBINIT_FILE)
  339. @echo file $(TARGET).elf >> $(GDBINIT_FILE)
  340. @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
  341. ifeq ($(DEBUG_BACKEND),simulavr)
  342. @echo load >> $(GDBINIT_FILE)
  343. endif
  344. @echo break main >> $(GDBINIT_FILE)
  345. debug: gdb-config $(TARGET).elf
  346. ifeq ($(DEBUG_BACKEND), avarice)
  347. @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
  348. @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
  349. $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
  350. @$(WINSHELL) /c pause
  351. else
  352. @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
  353. $(DEBUG_MFREQ) --port $(DEBUG_PORT)
  354. endif
  355. @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
  356. # Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
  357. COFFCONVERT = $(OBJCOPY) --debugging
  358. COFFCONVERT += --change-section-address .data-0x800000
  359. COFFCONVERT += --change-section-address .bss-0x800000
  360. COFFCONVERT += --change-section-address .noinit-0x800000
  361. COFFCONVERT += --change-section-address .eeprom-0x810000
  362. coff: $(TARGET).elf
  363. @echo
  364. @echo $(MSG_COFF) $(TARGET).cof
  365. $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
  366. extcoff: $(TARGET).elf
  367. @echo
  368. @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
  369. $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
  370. # Create final output files (.hex, .eep) from ELF output file.
  371. %.hex: %.elf
  372. @echo
  373. @echo $(MSG_FLASH) $@
  374. $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock -R .signature $< $@
  375. %.eep: %.elf
  376. @echo
  377. @echo $(MSG_EEPROM) $@
  378. -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
  379. --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
  380. # Create extended listing file from ELF output file.
  381. %.lss: %.elf
  382. @echo
  383. @echo $(MSG_EXTENDED_LISTING) $@
  384. $(OBJDUMP) -h -S -z $< > $@
  385. # Create a symbol table from ELF output file.
  386. %.sym: %.elf
  387. @echo
  388. @echo $(MSG_SYMBOL_TABLE) $@
  389. $(NM) -n $< > $@
  390. # Create library from object files.
  391. .SECONDARY : $(TARGET).a
  392. .PRECIOUS : $(OBJ)
  393. %.a: $(OBJ)
  394. @echo
  395. @echo $(MSG_CREATING_LIBRARY) $@
  396. $(AR) $@ $(OBJ)
  397. # Link: create ELF output file from object files.
  398. .SECONDARY : $(TARGET).elf
  399. .PRECIOUS : $(OBJ)
  400. %.elf: $(OBJ)
  401. @echo
  402. @echo $(MSG_LINKING) $@
  403. $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
  404. # Compile: create object files from C source files.
  405. $(OBJDIR)/%.o : %.c
  406. @echo
  407. mkdir -p $(@D)
  408. @echo $(MSG_COMPILING) $<
  409. $(CC) -c $(ALL_CFLAGS) $< -o $@
  410. # Compile: create object files from C++ source files.
  411. $(OBJDIR)/%.o : %.cpp
  412. @echo
  413. @echo $(MSG_COMPILING_CPP) $<
  414. $(CC) -c $(ALL_CPPFLAGS) $< -o $@
  415. # Compile: create assembler files from C source files.
  416. %.s : %.c
  417. $(CC) -S $(ALL_CFLAGS) $< -o $@
  418. # Compile: create assembler files from C++ source files.
  419. %.s : %.cpp
  420. $(CC) -S $(ALL_CPPFLAGS) $< -o $@
  421. # Assemble: create object files from assembler source files.
  422. $(OBJDIR)/%.o : %.S
  423. @echo
  424. @echo $(MSG_ASSEMBLING) $<
  425. $(CC) -c $(ALL_ASFLAGS) $< -o $@
  426. # Create preprocessed source for use in sending a bug report.
  427. %.i : %.c
  428. $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
  429. # Target: clean project.
  430. clean: begin clean_list end
  431. clean_list :
  432. @echo
  433. $(REMOVE) $(TARGET).hex
  434. $(REMOVE) $(TARGET).eep
  435. $(REMOVE) $(TARGET).cof
  436. $(REMOVE) $(TARGET).elf
  437. $(REMOVE) $(TARGET).map
  438. $(REMOVE) $(TARGET).sym
  439. $(REMOVE) $(TARGET).lss
  440. $(REMOVE) $(OBJ)
  441. $(REMOVE) $(LST)
  442. $(REMOVE) $(OBJ:.o=.s)
  443. $(REMOVE) $(OBJ:.o=.i)
  444. $(REMOVE) -r .dep
  445. $(REMOVE) -r $(OBJDIR)
  446. show_path:
  447. @echo VPATH=$(VPATH)
  448. @echo SRC=$(SRC)
  449. # Create object files directory
  450. $(shell mkdir $(OBJDIR) 2>/dev/null)
  451. # Include the dependency files.
  452. -include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
  453. # Listing of phony targets.
  454. .PHONY : all begin finish end sizebefore sizeafter gccversion \
  455. build elf hex eep lss sym coff extcoff \
  456. clean clean_list debug gdb-config show_path \
  457. program teensy dfu flip dfu-ee flip-ee