Kiibohd Controller
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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

Makefile 17KB

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