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.

Makefile.common 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  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. # Following variables need to be set in <target>/Makefile:
  42. # TARGET
  43. # COMMON_DIR
  44. # TARGET_DIR
  45. # TARGET_SRC
  46. # MCU
  47. # F_CPU
  48. # List C source files here. (C dependencies are automatically generated.)
  49. SRC = tmk.c \
  50. key_process.c \
  51. usb.c \
  52. usb_keyboard.c \
  53. usb_mouse.c \
  54. usb_debug.c \
  55. jump_bootloader.c \
  56. print.c
  57. SRC += $(TARGET_SRC)
  58. # C source file search path
  59. VPATH = $(TARGET_DIR):$(COMMON_DIR)
  60. # Output format. (can be srec, ihex, binary)
  61. FORMAT = ihex
  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 = .
  66. # List C++ source files here. (C dependencies are automatically generated.)
  67. CPPSRC =
  68. # List Assembler source files here.
  69. # Make them always end in a capital .S. Files ending in a lowercase .s
  70. # will not be considered source files but generated files (assembler
  71. # output from the compiler), and will be deleted upon "make clean"!
  72. # Even though the DOS/Win* filesystem matches both .s and .S the same,
  73. # it will preserve the spelling of the filenames, and gcc itself does
  74. # care about how the name is spelled on its command-line.
  75. ASRC =
  76. # Optimization level, can be [0, 1, 2, 3, s].
  77. # 0 = turn off optimization. s = optimize for size.
  78. # (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
  79. OPT = s
  80. # Debugging format.
  81. # Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
  82. # AVR Studio 4.10 requires dwarf-2.
  83. # AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
  84. DEBUG = dwarf-2
  85. # List any extra directories to look for include files here.
  86. # Each directory must be seperated by a space.
  87. # Use forward slashes for directory separators.
  88. # For a directory that has spaces, enclose it in quotes.
  89. EXTRAINCDIRS = $(TARGET_DIR) $(COMMON_DIR)
  90. # Compiler flag to set the C Standard level.
  91. # c89 = "ANSI" C
  92. # gnu89 = c89 plus GCC extensions
  93. # c99 = ISO C99 standard (not yet fully implemented)
  94. # gnu99 = c99 plus GCC extensions
  95. CSTANDARD = -std=gnu99
  96. # Place -D or -U options here for C sources
  97. CDEFS = -DF_CPU=$(F_CPU)UL
  98. # Place -D or -U options here for ASM sources
  99. ADEFS = -DF_CPU=$(F_CPU)
  100. # Place -D or -U options here for C++ sources
  101. CPPDEFS = -DF_CPU=$(F_CPU)UL
  102. #CPPDEFS += -D__STDC_LIMIT_MACROS
  103. #CPPDEFS += -D__STDC_CONSTANT_MACROS
  104. #---------------- Compiler Options C ----------------
  105. # -g*: generate debugging information
  106. # -O*: optimization level
  107. # -f...: tuning, see GCC manual and avr-libc documentation
  108. # -Wall...: warning level
  109. # -Wa,...: tell GCC to pass this to the assembler.
  110. # -adhlns...: create assembler listing
  111. CFLAGS = -g$(DEBUG)
  112. CFLAGS += $(CDEFS)
  113. CFLAGS += -O$(OPT)
  114. CFLAGS += -funsigned-char
  115. CFLAGS += -funsigned-bitfields
  116. CFLAGS += -ffunction-sections
  117. CFLAGS += -fpack-struct
  118. CFLAGS += -fshort-enums
  119. CFLAGS += -Wall
  120. CFLAGS += -Wstrict-prototypes
  121. #CFLAGS += -mshort-calls
  122. #CFLAGS += -fno-unit-at-a-time
  123. #CFLAGS += -Wundef
  124. #CFLAGS += -Wunreachable-code
  125. #CFLAGS += -Wsign-compare
  126. CFLAGS += -Wa,-adhlns=$(@:%.o=$(OBJDIR)/%.lst)
  127. CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
  128. CFLAGS += $(CSTANDARD)
  129. #---------------- Compiler Options C++ ----------------
  130. # -g*: generate debugging information
  131. # -O*: optimization level
  132. # -f...: tuning, see GCC manual and avr-libc documentation
  133. # -Wall...: warning level
  134. # -Wa,...: tell GCC to pass this to the assembler.
  135. # -adhlns...: create assembler listing
  136. CPPFLAGS = -g$(DEBUG)
  137. CPPFLAGS += $(CPPDEFS)
  138. CPPFLAGS += -O$(OPT)
  139. CPPFLAGS += -funsigned-char
  140. CPPFLAGS += -funsigned-bitfields
  141. CPPFLAGS += -fpack-struct
  142. CPPFLAGS += -fshort-enums
  143. CPPFLAGS += -fno-exceptions
  144. CPPFLAGS += -Wall
  145. CPPFLAGS += -Wundef
  146. #CPPFLAGS += -mshort-calls
  147. #CPPFLAGS += -fno-unit-at-a-time
  148. #CPPFLAGS += -Wstrict-prototypes
  149. #CPPFLAGS += -Wunreachable-code
  150. #CPPFLAGS += -Wsign-compare
  151. CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
  152. CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
  153. #CPPFLAGS += $(CSTANDARD)
  154. #---------------- Assembler Options ----------------
  155. # -Wa,...: tell GCC to pass this to the assembler.
  156. # -adhlns: create listing
  157. # -gstabs: have the assembler create line number information; note that
  158. # for use in COFF files, additional information about filenames
  159. # and function names needs to be present in the assembler source
  160. # files -- see avr-libc docs [FIXME: not yet described there]
  161. # -listing-cont-lines: Sets the maximum number of continuation lines of hex
  162. # dump that will be displayed for a given single line of source input.
  163. ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
  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. LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
  200. LDFLAGS += -Wl,--relax
  201. LDFLAGS += -Wl,--gc-sections
  202. LDFLAGS += $(EXTMEMOPTS)
  203. LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
  204. LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
  205. #LDFLAGS += -T linker_script.x
  206. #---------------- Programming Options (avrdude) ----------------
  207. # Programming hardware
  208. # Type: avrdude -c ?
  209. # to get a full listing.
  210. #
  211. AVRDUDE_PROGRAMMER = stk500v2
  212. # com1 = serial port. Use lpt1 to connect to parallel port.
  213. AVRDUDE_PORT = com1 # programmer connected to serial device
  214. AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
  215. #AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
  216. # Uncomment the following if you want avrdude's erase cycle counter.
  217. # Note that this counter needs to be initialized first using -Yn,
  218. # see avrdude manual.
  219. #AVRDUDE_ERASE_COUNTER = -y
  220. # Uncomment the following if you do /not/ wish a verification to be
  221. # performed after programming the device.
  222. #AVRDUDE_NO_VERIFY = -V
  223. # Increase verbosity level. Please use this when submitting bug
  224. # reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
  225. # to submit bug reports.
  226. #AVRDUDE_VERBOSE = -v -v
  227. AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
  228. AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
  229. AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
  230. AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
  231. #---------------- Debugging Options ----------------
  232. # For simulavr only - target MCU frequency.
  233. DEBUG_MFREQ = $(F_CPU)
  234. # Set the DEBUG_UI to either gdb or insight.
  235. # DEBUG_UI = gdb
  236. DEBUG_UI = insight
  237. # Set the debugging back-end to either avarice, simulavr.
  238. DEBUG_BACKEND = avarice
  239. #DEBUG_BACKEND = simulavr
  240. # GDB Init Filename.
  241. GDBINIT_FILE = __avr_gdbinit
  242. # When using avarice settings for the JTAG
  243. JTAG_DEV = /dev/com1
  244. # Debugging port used to communicate between GDB / avarice / simulavr.
  245. DEBUG_PORT = 4242
  246. # Debugging host used to communicate between GDB / avarice / simulavr, normally
  247. # just set to localhost unless doing some sort of crazy debugging when
  248. # avarice is running on a different computer.
  249. DEBUG_HOST = localhost
  250. #============================================================================
  251. # Define programs and commands.
  252. SHELL = sh
  253. CC = avr-gcc
  254. OBJCOPY = avr-objcopy
  255. OBJDUMP = avr-objdump
  256. SIZE = avr-size
  257. AR = avr-ar rcs
  258. NM = avr-nm
  259. AVRDUDE = avrdude
  260. REMOVE = rm -f
  261. REMOVEDIR = rm -rf
  262. COPY = cp
  263. WINSHELL = cmd
  264. # Define Messages
  265. # English
  266. MSG_ERRORS_NONE = Errors: none
  267. MSG_BEGIN = -------- begin --------
  268. MSG_END = -------- end --------
  269. MSG_SIZE_BEFORE = Size before:
  270. MSG_SIZE_AFTER = Size after:
  271. MSG_COFF = Converting to AVR COFF:
  272. MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
  273. MSG_FLASH = Creating load file for Flash:
  274. MSG_EEPROM = Creating load file for EEPROM:
  275. MSG_EXTENDED_LISTING = Creating Extended Listing:
  276. MSG_SYMBOL_TABLE = Creating Symbol Table:
  277. MSG_LINKING = Linking:
  278. MSG_COMPILING = Compiling C:
  279. MSG_COMPILING_CPP = Compiling C++:
  280. MSG_ASSEMBLING = Assembling:
  281. MSG_CLEANING = Cleaning project:
  282. MSG_CREATING_LIBRARY = Creating library:
  283. # Define all object files.
  284. OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
  285. # Define all listing files.
  286. LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
  287. # Compiler flags to generate dependency files.
  288. GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
  289. # Combine all necessary flags and optional flags.
  290. # Add target processor to flags.
  291. ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
  292. ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
  293. ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
  294. # Default target.
  295. all: begin gccversion sizebefore build sizeafter end
  296. # Change the build target to build a HEX file or a library.
  297. build: elf hex eep lss sym
  298. #build: lib
  299. elf: $(TARGET).elf
  300. hex: $(TARGET).hex
  301. eep: $(TARGET).eep
  302. lss: $(TARGET).lss
  303. sym: $(TARGET).sym
  304. LIBNAME=lib$(TARGET).a
  305. lib: $(LIBNAME)
  306. # Eye candy.
  307. # AVR Studio 3.x does not check make's exit code but relies on
  308. # the following magic strings to be generated by the compile job.
  309. begin:
  310. @echo
  311. @echo $(MSG_BEGIN)
  312. end:
  313. @echo $(MSG_END)
  314. @echo
  315. # Display size of file.
  316. HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
  317. #ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
  318. ELFSIZE = $(SIZE) $(TARGET).elf
  319. sizebefore:
  320. @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
  321. 2>/dev/null; echo; fi
  322. sizeafter:
  323. @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
  324. 2>/dev/null; echo; fi
  325. # Display compiler version information.
  326. gccversion :
  327. @$(CC) --version
  328. # Program the device.
  329. program: $(TARGET).hex $(TARGET).eep
  330. $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
  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. @echo $(MSG_COMPILING) $<
  408. $(CC) -c $(ALL_CFLAGS) $< -o $@
  409. # Compile: create object files from C++ source files.
  410. $(OBJDIR)/%.o : %.cpp
  411. @echo
  412. @echo $(MSG_COMPILING_CPP) $<
  413. $(CC) -c $(ALL_CPPFLAGS) $< -o $@
  414. # Compile: create assembler files from C source files.
  415. %.s : %.c
  416. $(CC) -S $(ALL_CFLAGS) $< -o $@
  417. # Compile: create assembler files from C++ source files.
  418. %.s : %.cpp
  419. $(CC) -S $(ALL_CPPFLAGS) $< -o $@
  420. # Assemble: create object files from assembler source files.
  421. $(OBJDIR)/%.o : %.S
  422. @echo
  423. @echo $(MSG_ASSEMBLING) $<
  424. $(CC) -c $(ALL_ASFLAGS) $< -o $@
  425. # Create preprocessed source for use in sending a bug report.
  426. %.i : %.c
  427. $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
  428. # Target: clean project.
  429. clean: begin clean_list end
  430. clean_list :
  431. @echo
  432. @echo $(MSG_CLEANING)
  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) $(SRC:%.c=$(OBJDIR)/%.o)
  441. $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
  442. $(REMOVE) $(SRC:.c=.s)
  443. $(REMOVE) $(SRC:.c=.d)
  444. $(REMOVE) $(SRC:.c=.i)
  445. $(REMOVEDIR) .dep
  446. # Create object files directory
  447. $(shell mkdir $(OBJDIR) 2>/dev/null)
  448. # Include the dependency files.
  449. -include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
  450. # Listing of phony targets.
  451. .PHONY : all begin finish end sizebefore sizeafter gccversion \
  452. build elf hex eep lss sym coff extcoff \
  453. clean clean_list program debug gdb-config