Keyboard firmwares for Atmel AVR and Cortex-M
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

Makefile.rules 16KB

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