Non-Arduino keyMatrix library with Arduino support.

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. # MCU name
  42. MCU = atmega328p
  43. # Processor frequency.
  44. # This will define a symbol, F_CPU, in all source code files equal to the
  45. # processor frequency. You can then use this symbol in your source code to
  46. # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
  47. # automatically to create a 32-bit value in your source code.
  48. # Typical values are:
  49. # F_CPU = 1000000
  50. # F_CPU = 1843200
  51. # F_CPU = 2000000
  52. # F_CPU = 3686400
  53. # F_CPU = 4000000
  54. # F_CPU = 7372800
  55. # F_CPU = 8000000
  56. # F_CPU = 11059200
  57. # F_CPU = 14745600
  58. # F_CPU = 16000000
  59. # F_CPU = 18432000
  60. # F_CPU = 20000000
  61. F_CPU = 16000000
  62. # Output format. (can be srec, ihex, binary)
  63. FORMAT = ihex
  64. # Target file name (without extension).
  65. TARGET = noarduino
  66. # Object files directory
  67. # To put object files in current directory, use a dot (.), do NOT make
  68. # this an empty or blank macro!
  69. OBJDIR = .
  70. # List C source files here. (C dependencies are automatically generated.)
  71. SRC = $(TARGET).c keymatrix.c
  72. # List C++ source files here. (C dependencies are automatically generated.)
  73. CPPSRC =
  74. # List Assembler source files here.
  75. # Make them always end in a capital .S. Files ending in a lowercase .s
  76. # will not be considered source files but generated files (assembler
  77. # output from the compiler), and will be deleted upon "make clean"!
  78. # Even though the DOS/Win* filesystem matches both .s and .S the same,
  79. # it will preserve the spelling of the filenames, and gcc itself does
  80. # care about how the name is spelled on its command-line.
  81. ASRC =
  82. # Optimization level, can be [0, 1, 2, 3, s].
  83. # 0 = turn off optimization. s = optimize for size.
  84. # (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
  85. OPT = s
  86. # Debugging format.
  87. # Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
  88. # AVR Studio 4.10 requires dwarf-2.
  89. # AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
  90. DEBUG = dwarf-2
  91. # List any extra directories to look for include files here.
  92. # Each directory must be seperated by a space.
  93. # Use forward slashes for directory separators.
  94. # For a directory that has spaces, enclose it in quotes.
  95. EXTRAINCDIRS = /opt/winavr/include
  96. # Compiler flag to set the C Standard level.
  97. # c89 = "ANSI" C
  98. # gnu89 = c89 plus GCC extensions
  99. # c99 = ISO C99 standard (not yet fully implemented)
  100. # gnu99 = c99 plus GCC extensions
  101. CSTANDARD = -std=gnu99
  102. # Place -D or -U options here for C sources
  103. CDEFS = -DF_CPU=$(F_CPU)UL
  104. # Place -D or -U options here for ASM sources
  105. ADEFS = -DF_CPU=$(F_CPU)
  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. #---------------- Compiler Options C ----------------
  111. # -g*: generate debugging information
  112. # -O*: optimization level
  113. # -f...: tuning, see GCC manual and avr-libc documentation
  114. # -Wall...: warning level
  115. # -Wa,...: tell GCC to pass this to the assembler.
  116. # -adhlns...: create assembler listing
  117. CFLAGS = -g$(DEBUG)
  118. CFLAGS += $(CDEFS)
  119. CFLAGS += -O$(OPT)
  120. CFLAGS += -funsigned-char
  121. CFLAGS += -funsigned-bitfields
  122. CFLAGS += -fpack-struct
  123. CFLAGS += -fshort-enums
  124. CFLAGS += -Wall
  125. CFLAGS += -Wstrict-prototypes
  126. #CFLAGS += -mshort-calls
  127. #CFLAGS += -fno-unit-at-a-time
  128. #CFLAGS += -Wundef
  129. #CFLAGS += -Wunreachable-code
  130. #CFLAGS += -Wsign-compare
  131. CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
  132. CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
  133. CFLAGS += $(CSTANDARD)
  134. #---------------- Compiler Options C++ ----------------
  135. # -g*: generate debugging information
  136. # -O*: optimization level
  137. # -f...: tuning, see GCC manual and avr-libc documentation
  138. # -Wall...: warning level
  139. # -Wa,...: tell GCC to pass this to the assembler.
  140. # -adhlns...: create assembler listing
  141. CPPFLAGS = -g$(DEBUG)
  142. CPPFLAGS += $(CPPDEFS)
  143. CPPFLAGS += -O$(OPT)
  144. CPPFLAGS += -funsigned-char
  145. CPPFLAGS += -funsigned-bitfields
  146. CPPFLAGS += -fpack-struct
  147. CPPFLAGS += -fshort-enums
  148. CPPFLAGS += -fno-exceptions
  149. CPPFLAGS += -Wall
  150. CPPFLAGS += -Wundef
  151. #CPPFLAGS += -mshort-calls
  152. #CPPFLAGS += -fno-unit-at-a-time
  153. #CPPFLAGS += -Wstrict-prototypes
  154. #CPPFLAGS += -Wunreachable-code
  155. #CPPFLAGS += -Wsign-compare
  156. CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
  157. CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
  158. #CPPFLAGS += $(CSTANDARD)
  159. #---------------- Assembler Options ----------------
  160. # -Wa,...: tell GCC to pass this to the assembler.
  161. # -adhlns: create listing
  162. # -gstabs: have the assembler create line number information; note that
  163. # for use in COFF files, additional information about filenames
  164. # and function names needs to be present in the assembler source
  165. # files -- see avr-libc docs [FIXME: not yet described there]
  166. # -listing-cont-lines: Sets the maximum number of continuation lines of hex
  167. # dump that will be displayed for a given single line of source input.
  168. ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
  169. #---------------- Library Options ----------------
  170. # Minimalistic printf version
  171. PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
  172. # Floating point printf version (requires MATH_LIB = -lm below)
  173. PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
  174. # If this is left blank, then it will use the Standard printf version.
  175. PRINTF_LIB =
  176. #PRINTF_LIB = $(PRINTF_LIB_MIN)
  177. #PRINTF_LIB = $(PRINTF_LIB_FLOAT)
  178. # Minimalistic scanf version
  179. SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
  180. # Floating point + %[ scanf version (requires MATH_LIB = -lm below)
  181. SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
  182. # If this is left blank, then it will use the Standard scanf version.
  183. SCANF_LIB =
  184. #SCANF_LIB = $(SCANF_LIB_MIN)
  185. #SCANF_LIB = $(SCANF_LIB_FLOAT)
  186. MATH_LIB = -lm
  187. # List any extra directories to look for libraries here.
  188. # Each directory must be seperated by a space.
  189. # Use forward slashes for directory separators.
  190. # For a directory that has spaces, enclose it in quotes.
  191. EXTRALIBDIRS =
  192. #---------------- External Memory Options ----------------
  193. # 64 KB of external RAM, starting after internal RAM (ATmega128!),
  194. # used for variables (.data/.bss) and heap (malloc()).
  195. #EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
  196. # 64 KB of external RAM, starting after internal RAM (ATmega128!),
  197. # only used for heap (malloc()).
  198. #EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
  199. EXTMEMOPTS =
  200. #---------------- Linker Options ----------------
  201. # -Wl,...: tell GCC to pass this to linker.
  202. # -Map: create map file
  203. # --cref: add cross reference to map file
  204. LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
  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 = avrisp
  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. sizebefore:
  322. @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
  323. 2>/dev/null; echo; fi
  324. sizeafter:
  325. @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
  326. 2>/dev/null; echo; fi
  327. # Display compiler version information.
  328. gccversion :
  329. @$(CC) --version
  330. # Program the device.
  331. program: $(TARGET).hex $(TARGET).eep
  332. $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
  333. # Generate avr-gdb config/init file which does the following:
  334. # define the reset signal, load the target file, connect to target, and set
  335. # a breakpoint at main().
  336. gdb-config:
  337. @$(REMOVE) $(GDBINIT_FILE)
  338. @echo define reset >> $(GDBINIT_FILE)
  339. @echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
  340. @echo end >> $(GDBINIT_FILE)
  341. @echo file $(TARGET).elf >> $(GDBINIT_FILE)
  342. @echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
  343. ifeq ($(DEBUG_BACKEND),simulavr)
  344. @echo load >> $(GDBINIT_FILE)
  345. endif
  346. @echo break main >> $(GDBINIT_FILE)
  347. debug: gdb-config $(TARGET).elf
  348. ifeq ($(DEBUG_BACKEND), avarice)
  349. @echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
  350. @$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
  351. $(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
  352. @$(WINSHELL) /c pause
  353. else
  354. @$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
  355. $(DEBUG_MFREQ) --port $(DEBUG_PORT)
  356. endif
  357. @$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
  358. # Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
  359. COFFCONVERT = $(OBJCOPY) --debugging
  360. COFFCONVERT += --change-section-address .data-0x800000
  361. COFFCONVERT += --change-section-address .bss-0x800000
  362. COFFCONVERT += --change-section-address .noinit-0x800000
  363. COFFCONVERT += --change-section-address .eeprom-0x810000
  364. coff: $(TARGET).elf
  365. @echo
  366. @echo $(MSG_COFF) $(TARGET).cof
  367. $(COFFCONVERT) -O coff-avr $< $(TARGET).cof
  368. extcoff: $(TARGET).elf
  369. @echo
  370. @echo $(MSG_EXTENDED_COFF) $(TARGET).cof
  371. $(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
  372. # Create final output files (.hex, .eep) from ELF output file.
  373. %.hex: %.elf
  374. @echo
  375. @echo $(MSG_FLASH) $@
  376. $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock -R .signature $< $@
  377. %.eep: %.elf
  378. @echo
  379. @echo $(MSG_EEPROM) $@
  380. -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
  381. --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
  382. # Create extended listing file from ELF output file.
  383. %.lss: %.elf
  384. @echo
  385. @echo $(MSG_EXTENDED_LISTING) $@
  386. $(OBJDUMP) -h -S -z $< > $@
  387. # Create a symbol table from ELF output file.
  388. %.sym: %.elf
  389. @echo
  390. @echo $(MSG_SYMBOL_TABLE) $@
  391. $(NM) -n $< > $@
  392. # Create library from object files.
  393. .SECONDARY : $(TARGET).a
  394. .PRECIOUS : $(OBJ)
  395. %.a: $(OBJ)
  396. @echo
  397. @echo $(MSG_CREATING_LIBRARY) $@
  398. $(AR) $@ $(OBJ)
  399. # Link: create ELF output file from object files.
  400. .SECONDARY : $(TARGET).elf
  401. .PRECIOUS : $(OBJ)
  402. %.elf: $(OBJ)
  403. @echo
  404. @echo $(MSG_LINKING) $@
  405. $(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
  406. # Compile: create object files from C source files.
  407. $(OBJDIR)/%.o : %.c
  408. @echo
  409. @echo $(MSG_COMPILING) $<
  410. $(CC) -c $(ALL_CFLAGS) $< -o $@
  411. # Compile: create object files from C++ source files.
  412. $(OBJDIR)/%.o : %.cpp
  413. @echo
  414. @echo $(MSG_COMPILING_CPP) $<
  415. $(CC) -c $(ALL_CPPFLAGS) $< -o $@
  416. # Compile: create assembler files from C source files.
  417. %.s : %.c
  418. $(CC) -S $(ALL_CFLAGS) $< -o $@
  419. # Compile: create assembler files from C++ source files.
  420. %.s : %.cpp
  421. $(CC) -S $(ALL_CPPFLAGS) $< -o $@
  422. # Assemble: create object files from assembler source files.
  423. $(OBJDIR)/%.o : %.S
  424. @echo
  425. @echo $(MSG_ASSEMBLING) $<
  426. $(CC) -c $(ALL_ASFLAGS) $< -o $@
  427. # Create preprocessed source for use in sending a bug report.
  428. %.i : %.c
  429. $(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
  430. # Target: clean project.
  431. clean: begin clean_list end
  432. clean_list :
  433. @echo
  434. @echo $(MSG_CLEANING)
  435. $(REMOVE) $(TARGET).hex
  436. $(REMOVE) $(TARGET).eep
  437. $(REMOVE) $(TARGET).cof
  438. $(REMOVE) $(TARGET).elf
  439. $(REMOVE) $(TARGET).map
  440. $(REMOVE) $(TARGET).sym
  441. $(REMOVE) $(TARGET).lss
  442. $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
  443. $(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
  444. $(REMOVE) $(SRC:.c=.s)
  445. $(REMOVE) $(SRC:.c=.d)
  446. $(REMOVE) $(SRC:.c=.i)
  447. $(REMOVEDIR) .dep
  448. # Create object files directory
  449. $(shell mkdir $(OBJDIR) 2>/dev/null)
  450. # Include the dependency files.
  451. -include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
  452. # Listing of phony targets.
  453. .PHONY : all begin finish end sizebefore sizeafter gccversion \
  454. build elf hex eep lss sym coff extcoff \
  455. clean clean_list program debug gdb-config