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 17KB

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