Makefile 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547
  1. # Makefile for ATmegaBOOT
  2. # E.Lins, 18.7.2005
  3. # $Id$
  4. #
  5. # Instructions
  6. #
  7. # To make bootloader .hex file:
  8. # make diecimila
  9. # make lilypad
  10. # make ng
  11. # etc...
  12. #
  13. # To burn bootloader .hex file:
  14. # make diecimila_isp
  15. # make lilypad_isp
  16. # make ng_isp
  17. # etc...
  18. #
  19. # Edit History
  20. # 201406xx: WestfW: More Makefile restructuring.
  21. # Split off Makefile.1284, Makefile.extras, Makefile.custom
  22. # So that in theory, the main Makefile contains only the
  23. # official platforms, and does not need to be modified to
  24. # add "less supported" chips and boards.
  25. # 201303xx: WestfW: Major Makefile restructuring.
  26. # Allows options on Make command line "make xx LED=B3"
  27. # (see also pin_defs.h)
  28. # Divide into "chip" targets and "board" targets.
  29. # Most boards are (recursive) board targets with options.
  30. # Move isp target to separate makefile (fixes m8 EFUSE)
  31. # Some (many) targets will now be rebuilt when not
  32. # strictly necessary, so that options will be included.
  33. # (any "make" with options will always compile.)
  34. # Set many variables with ?= so they can be overridden
  35. # Use arduinoISP settings as default for ISP targets
  36. #
  37. #
  38. # * Copyright 2013-2015 by Bill Westfield. Part of Optiboot.
  39. # * This software is licensed under version 2 of the Gnu Public Licence.
  40. # * See optiboot.c for details.
  41. #----------------------------------------------------------------------
  42. #
  43. # program name should not be changed...
  44. PROGRAM = optiboot
  45. # The default behavior is to build using tools that are in the users
  46. # current path variables, but we can also build using an installed
  47. # Arduino user IDE setup, or the Arduino source tree.
  48. # Uncomment this next lines to build within the arduino environment,
  49. # using the arduino-included avrgcc toolset (mac and pc)
  50. # ENV ?= arduino
  51. # ENV ?= arduinodev
  52. # OS ?= macosx
  53. # OS ?= windows
  54. # export symbols to recursive makes (for ISP)
  55. export
  56. # defaults
  57. MCU_TARGET = atmega168
  58. LDSECTIONS = -Wl,--section-start=.text=0x3e00 -Wl,--section-start=.version=0x3ffe
  59. # Build environments
  60. # Start of some ugly makefile-isms to allow optiboot to be built
  61. # in several different environments. See the README.TXT file for
  62. # details.
  63. # default
  64. fixpath = $(1)
  65. SH := bash
  66. ifeq ($(ENV), arduino)
  67. # For Arduino, we assume that we're connected to the optiboot directory
  68. # included with the arduino distribution, which means that the full set
  69. # of avr-tools are "right up there" in standard places.
  70. # (except that in 1.5.x, there's an additional level of "up")
  71. TESTDIR := $(firstword $(wildcard ../../../tools/*))
  72. ifeq (,$(TESTDIR))
  73. # Arduino 1.5.x tool location compared to optiboot dir
  74. TOOLROOT = ../../../../tools
  75. else
  76. # Arduino 1.0 (and earlier) tool location
  77. TOOLROOT = ../../../tools
  78. endif
  79. GCCROOT = $(TOOLROOT)/avr/bin/
  80. ifeq ($(OS), windows)
  81. # On windows, SOME of the tool paths will need to have backslashes instead
  82. # of forward slashes (because they use windows cmd.exe for execution instead
  83. # of a unix/mingw shell?) We also have to ensure that a consistent shell
  84. # is used even if a unix shell is installed (ie as part of WINAVR)
  85. fixpath = $(subst /,\,$1)
  86. SHELL = cmd.exe
  87. SH = sh
  88. endif
  89. else ifeq ($(ENV), arduinodev)
  90. # Arduino IDE source code environment. Use the unpacked compilers created
  91. # by the build (you'll need to do "ant build" first.)
  92. ifeq ($(OS), macosx)
  93. TOOLROOT = ../../../../build/macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools
  94. endif
  95. ifeq ($(OS), windows)
  96. TOOLROOT = ../../../../build/windows/work/hardware/tools
  97. endif
  98. GCCROOT = $(TOOLROOT)/avr/bin/
  99. AVRDUDE_CONF = -C$(TOOLROOT)/avr/etc/avrdude.conf
  100. else
  101. GCCROOT =
  102. AVRDUDE_CONF =
  103. endif
  104. STK500 = "C:\Program Files\Atmel\AVR Tools\STK500\Stk500.exe"
  105. STK500-1 = $(STK500) -e -d$(MCU_TARGET) -pf -vf -if$(PROGRAM)_$(TARGET).hex \
  106. -lFF -LFF -f$(HFUSE)$(LFUSE) -EF8 -ms -q -cUSB -I200kHz -s -wt
  107. STK500-2 = $(STK500) -d$(MCU_TARGET) -ms -q -lCF -LCF -cUSB -I200kHz -s -wt
  108. #
  109. # End of build environment code.
  110. OBJ = $(PROGRAM).o
  111. OPTIMIZE = -Os -fno-split-wide-types -mrelax
  112. DEFS =
  113. #
  114. # platforms support EEPROM and large bootloaders need the eeprom functions that
  115. # are defined in libc, even though we explicity remove it with -nostdlib because
  116. # of the space-savings.
  117. LIBS = -lc
  118. CC = $(GCCROOT)avr-gcc
  119. # Override is only needed by avr-lib build system.
  120. override CFLAGS = -g -Wall $(OPTIMIZE) -mmcu=$(MCU_TARGET) -DF_CPU=$(AVR_FREQ) $(DEFS)
  121. override LDFLAGS = $(LDSECTIONS) -Wl,--relax -nostartfiles -nostdlib
  122. #-Wl,--gc-sections
  123. OBJCOPY = $(GCCROOT)avr-objcopy
  124. OBJDUMP = $(call fixpath,$(GCCROOT)avr-objdump)
  125. SIZE = $(GCCROOT)avr-size
  126. #
  127. # Make command-line Options.
  128. # Permit commands like "make atmega328 LED_START_FLASHES=10" to pass the
  129. # appropriate parameters ("-DLED_START_FLASHES=10") to gcc
  130. #
  131. ifdef BAUD_RATE
  132. BAUD_RATE_CMD = -DBAUD_RATE=$(BAUD_RATE)
  133. dummy = FORCE
  134. else
  135. BAUD_RATE_CMD = -DBAUD_RATE=115200
  136. endif
  137. ifdef LED_START_FLASHES
  138. LED_START_FLASHES_CMD = -DLED_START_FLASHES=$(LED_START_FLASHES)
  139. dummy = FORCE
  140. else
  141. LED_START_FLASHES_CMD = -DLED_START_FLASHES=3
  142. endif
  143. # BIG_BOOT: Include extra features, up to 1K.
  144. ifdef BIGBOOT
  145. BIGBOOT_CMD = -DBIGBOOT=1
  146. dummy = FORCE
  147. endif
  148. ifdef SOFT_UART
  149. SOFT_UART_CMD = -DSOFT_UART=1
  150. dummy = FORCE
  151. endif
  152. ifdef LED_DATA_FLASH
  153. LED_DATA_FLASH_CMD = -DLED_DATA_FLASH=1
  154. dummy = FORCE
  155. endif
  156. ifdef LED
  157. LED_CMD = -DLED=$(LED)
  158. dummy = FORCE
  159. endif
  160. ifdef SINGLESPEED
  161. SS_CMD = -DSINGLESPEED=1
  162. endif
  163. COMMON_OPTIONS = $(BAUD_RATE_CMD) $(LED_START_FLASHES_CMD) $(BIGBOOT_CMD)
  164. COMMON_OPTIONS += $(SOFT_UART_CMD) $(LED_DATA_FLASH_CMD) $(LED_CMD) $(SS_CMD)
  165. #UART is handled separately and only passed for devices with more than one.
  166. ifdef UART
  167. UART_CMD = -DUART=$(UART)
  168. endif
  169. # Not supported yet
  170. # ifdef SUPPORT_EEPROM
  171. # SUPPORT_EEPROM_CMD = -DSUPPORT_EEPROM
  172. # dummy = FORCE
  173. # endif
  174. # Not supported yet
  175. # ifdef TIMEOUT_MS
  176. # TIMEOUT_MS_CMD = -DTIMEOUT_MS=$(TIMEOUT_MS)
  177. # dummy = FORCE
  178. # endif
  179. #
  180. #.PRECIOUS: %.elf
  181. #---------------------------------------------------------------------------
  182. # "Chip-level Platform" targets.
  183. # A "Chip-level Platform" compiles for a particular chip, but probably does
  184. # not have "standard" values for things like clock speed, LED pin, etc.
  185. # Makes for chip-level platforms should usually explicitly define their
  186. # options like: "make atmega1285 AVR_FREQ=16000000L LED=D0"
  187. #---------------------------------------------------------------------------
  188. #
  189. # Note about fuses:
  190. # the efuse should really be 0xf8; since, however, only the lower
  191. # three bits of that byte are used on the atmega168, avrdude gets
  192. # confused if you specify 1's for the higher bits, see:
  193. # http://tinker.it/now/2007/02/24/the-tale-of-avrdude-atmega168-and-extended-bits-fuses/
  194. #
  195. # similarly, the lock bits should be 0xff instead of 0x3f (to
  196. # unlock the bootloader section) and 0xcf instead of 0x2f (to
  197. # lock it), but since the high two bits of the lock byte are
  198. # unused, avrdude would get confused.
  199. #---------------------------------------------------------------------------
  200. #
  201. # Test platforms
  202. # Virtual boot block test
  203. virboot8: TARGET = atmega8
  204. virboot8: MCU_TARGET = atmega8
  205. virboot8: CFLAGS += $(COMMON_OPTIONS) '-DVIRTUAL_BOOT_PARTITION' '-Dsave_vect_num=EE_RDY_vect_num'
  206. virboot8: AVR_FREQ ?= 16000000L
  207. virboot8: LDSECTIONS = -Wl,--section-start=.text=0x1c00 -Wl,--section-start=.version=0x1ffe
  208. virboot8: $(PROGRAM)_virboot8.hex
  209. virboot8: $(PROGRAM)_virboot8.lst
  210. virboot328: TARGET = atmega328
  211. virboot328: MCU_TARGET = atmega328p
  212. virboot328: CFLAGS += $(COMMON_OPTIONS) '-DVIRTUAL_BOOT_PARTITION'
  213. virboot328: AVR_FREQ ?= 16000000L
  214. virboot328: LDSECTIONS = -Wl,--section-start=.text=0x7d80 -Wl,--section-start=.version=0x7ffe
  215. virboot328: $(PROGRAM)_virboot328.hex
  216. virboot328: $(PROGRAM)_virboot328.lst
  217. virboot328_isp: virboot328
  218. virboot328_isp: TARGET = virboot328
  219. virboot328_isp: MCU_TARGET = atmega328p
  220. # no boot section, SPIEN
  221. virboot328_isp: HFUSE ?= DF
  222. # Low power xtal (16MHz) 16KCK/14CK+65ms
  223. virboot328_isp: LFUSE ?= FF
  224. # 2.7V brownout
  225. virboot328_isp: EFUSE ?= 05
  226. virboot328_isp: isp
  227. # Diecimila, Duemilanove with m168, and NG use identical bootloaders
  228. # Call it "atmega168" for generality and clarity, keep "diecimila" for
  229. # backward compatibility of makefile
  230. #
  231. atmega168: TARGET = atmega168
  232. atmega168: MCU_TARGET = atmega168
  233. atmega168: CFLAGS += $(COMMON_OPTIONS)
  234. atmega168: AVR_FREQ ?= 16000000L
  235. atmega168: $(PROGRAM)_atmega168.hex
  236. atmega168: $(PROGRAM)_atmega168.lst
  237. atmega168_isp: atmega168
  238. atmega168_isp: TARGET = atmega168
  239. # 2.7V brownout
  240. atmega168_isp: HFUSE ?= DD
  241. # Full swing (16MHz) 16KCK/14CK+65ms
  242. atmega168_isp: LFUSE ?= F7
  243. # 512 byte boot
  244. atmega168_isp: EFUSE ?= 04
  245. atmega168_isp: isp
  246. atmega16: TARGET = atmega16
  247. atmega16: MCU_TARGET = atmega16
  248. atmega16: CFLAGS += $(COMMON_OPTIONS)
  249. atmega16: AVR_FREQ ?= 16000000L
  250. atmega16: $(PROGRAM)_atmega16.hex
  251. atmega16: $(PROGRAM)_atmega16.lst
  252. atmega328: TARGET = atmega328
  253. atmega328: MCU_TARGET = atmega328p
  254. atmega328: CFLAGS += $(COMMON_OPTIONS)
  255. atmega328: AVR_FREQ ?= 16000000L
  256. atmega328: LDSECTIONS = -Wl,--section-start=.text=0x7e00 -Wl,--section-start=.version=0x7ffe
  257. atmega328: $(PROGRAM)_atmega328.hex
  258. atmega328: $(PROGRAM)_atmega328.lst
  259. atmega328_isp: atmega328
  260. atmega328_isp: TARGET = atmega328
  261. atmega328_isp: MCU_TARGET = atmega328p
  262. # 512 byte boot, SPIEN
  263. atmega328_isp: HFUSE ?= DE
  264. # Low power xtal (16MHz) 16KCK/14CK+65ms
  265. atmega328_isp: LFUSE ?= FF
  266. # 2.7V brownout
  267. atmega328_isp: EFUSE ?= 05
  268. atmega328_isp: isp
  269. #Atmega1280
  270. atmega1280: MCU_TARGET = atmega1280
  271. atmega1280: CFLAGS += $(COMMON_OPTIONS) -DBIGBOOT $(UART_CMD)
  272. atmega1280: AVR_FREQ ?= 16000000L
  273. atmega1280: LDSECTIONS = -Wl,--section-start=.text=0x1fc00 -Wl,--section-start=.version=0x1fffe
  274. atmega1280: $(PROGRAM)_atmega1280.hex
  275. atmega1280: $(PROGRAM)_atmega1280.lst
  276. # ATmega8
  277. #
  278. atmega8: TARGET = atmega8
  279. atmega8: MCU_TARGET = atmega8
  280. atmega8: CFLAGS += $(COMMON_OPTIONS)
  281. atmega8: AVR_FREQ ?= 16000000L
  282. atmega8: LDSECTIONS = -Wl,--section-start=.text=0x1e00 -Wl,--section-start=.version=0x1ffe -Wl,--gc-sections -Wl,--undefined=optiboot_version
  283. atmega8: $(PROGRAM)_atmega8.hex
  284. atmega8: $(PROGRAM)_atmega8.lst
  285. atmega8_isp: atmega8
  286. atmega8_isp: TARGET = atmega8
  287. atmega8_isp: MCU_TARGET = atmega8
  288. # SPIEN, CKOPT (for full swing xtal), Bootsize=512B
  289. atmega8_isp: HFUSE ?= CC
  290. # 2.7V brownout, 16MHz Xtal, 16KCK/14CK+65ms
  291. atmega8_isp: LFUSE ?= BF
  292. atmega8_isp: isp
  293. #---------------------------------------------------------------------------
  294. # "Board-level Platform" targets.
  295. # A "Board-level Platform" implies a manufactured platform with a particular
  296. # AVR_FREQ, LED, and so on. Parameters are not particularly changable from
  297. # the "make" command line.
  298. # Most of the board-level platform builds should envoke make recursively
  299. # appropriate specific options
  300. #---------------------------------------------------------------------------
  301. # 20MHz clocked platforms
  302. #
  303. # These are capable of 230400 baud, or 115200 baud on PC (Arduino Avrdude issue)
  304. #
  305. pro20: TARGET = pro_20mhz
  306. pro20: CHIP = atmega168
  307. pro20:
  308. $(MAKE) atmega168 AVR_FREQ=20000000L LED_START_FLASHES=3
  309. mv $(PROGRAM)_$(CHIP).hex $(PROGRAM)_$(TARGET).hex
  310. mv $(PROGRAM)_$(CHIP).lst $(PROGRAM)_$(TARGET).lst
  311. pro20_isp: pro20
  312. pro20_isp: TARGET = pro_20mhz
  313. # 4.3V brownout (for max speed!)
  314. pro20_isp: HFUSE ?= DC
  315. # Full swing xtal (20MHz) 258CK/14CK+4.1ms
  316. pro20_isp: LFUSE ?= F7
  317. # 512 byte boot
  318. pro20_isp: EFUSE ?= 04
  319. pro20_isp: isp
  320. # 16MHz clocked platforms
  321. #
  322. # These are capable of 230400 baud, or 115200 baud on PC (Arduino Avrdude issue)
  323. #
  324. pro16: TARGET = pro_16MHz
  325. pro16: CHIP = atmega168
  326. pro16:
  327. $(MAKE) $(CHIP) AVR_FREQ=16000000L LED_START_FLASHES=3
  328. mv $(PROGRAM)_$(CHIP).hex $(PROGRAM)_$(TARGET).hex
  329. mv $(PROGRAM)_$(CHIP).lst $(PROGRAM)_$(TARGET).lst
  330. pro16_isp: pro16
  331. pro16_isp: TARGET = pro_16MHz
  332. # 2.7V brownout
  333. pro16_isp: HFUSE ?= DD
  334. # Full swing xtal (20MHz) 258CK/14CK+4.1ms
  335. pro16_isp: LFUSE ?= F7
  336. # 512 byte boot
  337. pro16_isp: EFUSE ?= 04
  338. pro16_isp: isp
  339. diecimila: TARGET = diecimila
  340. diecimila: CHIP = atmega168
  341. diecimila:
  342. $(MAKE) $(CHIP) AVR_FREQ=16000000L LED_START_FLASHES=3
  343. mv $(PROGRAM)_$(CHIP).hex $(PROGRAM)_$(TARGET).hex
  344. mv $(PROGRAM)_$(CHIP).lst $(PROGRAM)_$(TARGET).lst
  345. diecimila_isp: diecimila
  346. diecimila_isp: TARGET = diecimila
  347. # 2.7V brownout
  348. diecimila_isp: HFUSE ?= DD
  349. # Low power xtal (16MHz) 16KCK/14CK+65ms
  350. diecimila_isp: LFUSE ?= F7
  351. # 512 byte boot
  352. diecimila_isp: EFUSE ?= 04
  353. diecimila_isp: isp
  354. # MEGA1280 Board (this is different from the atmega1280 chip platform)
  355. # Mega has a minimum boot size of 1024 bytes, so enable extra functions
  356. # Note that optiboot does not (can not) work on the MEGA2560
  357. #mega: TARGET = atmega1280
  358. mega1280: atmega1280
  359. mega1280_isp: mega1280
  360. mega1280_isp: TARGET = atmega1280
  361. mega1280_isp: MCU_TARGET = atmega1280
  362. # 1024 byte boot
  363. mega1280_isp: HFUSE ?= DE
  364. # Low power xtal (16MHz) 16KCK/14CK+65ms
  365. mega1280_isp: LFUSE ?= FF
  366. # 2.7V brownout; wants F5 for some reason...
  367. mega1280_isp: EFUSE ?= F5
  368. mega1280_isp: isp
  369. # 8MHz clocked platforms
  370. #
  371. # These are capable of 115200 baud
  372. # Note that "new" Arduinos with an AVR as USB/Serial converter will NOT work
  373. # with an 8MHz target Arduino. The bitrate errors are in opposite directions,
  374. # and total too large a number.
  375. #
  376. lilypad: TARGET = $@
  377. lilypad: CHIP = atmega168
  378. lilypad:
  379. $(MAKE) $(CHIP) AVR_FREQ=8000000L LED_START_FLASHES=3
  380. mv $(PROGRAM)_$(CHIP).hex $(PROGRAM)_$(TARGET).hex
  381. mv $(PROGRAM)_$(CHIP).lst $(PROGRAM)_$(TARGET).lst
  382. lilypad_isp: lilypad
  383. lilypad_isp: TARGET = lilypad
  384. # 2.7V brownout
  385. lilypad_isp: HFUSE ?= DD
  386. # Internal 8MHz osc (8MHz) Slow rising power
  387. lilypad_isp: LFUSE ?= E2
  388. # 512 byte boot
  389. lilypad_isp: EFUSE ?= 04
  390. lilypad_isp: isp
  391. # lilypad_resonator is the same as a 8MHz lilypad, except for fuses.
  392. lilypad_resonator: lilypad
  393. lilypad_resonator_isp: lilypad
  394. lilypad_resonator_isp: TARGET = lilypad
  395. # 2.7V brownout
  396. lilypad_resonator_isp: HFUSE ?= DD
  397. # Full swing xtal (20MHz) 258CK/14CK+4.1ms
  398. lilypad_resonator_isp: LFUSE ?= C6
  399. # 512 byte boot
  400. lilypad_resonator_isp: EFUSE ?= 04
  401. lilypad_resonator_isp: isp
  402. pro8: TARGET = pro_8MHz
  403. pro8: CHIP = atmega168
  404. pro8:
  405. $(MAKE) $(CHIP) AVR_FREQ=8000000L LED_START_FLASHES=3
  406. mv $(PROGRAM)_$(CHIP).hex $(PROGRAM)_$(TARGET).hex
  407. mv $(PROGRAM)_$(CHIP).lst $(PROGRAM)_$(TARGET).lst
  408. pro8_isp: pro8
  409. pro8_isp: TARGET = pro_8MHz
  410. # 2.7V brownout
  411. pro8_isp: HFUSE ?= DD
  412. # Full swing xtal (20MHz) 258CK/14CK+4.1ms
  413. pro8_isp: LFUSE ?= C6
  414. # 512 byte boot
  415. pro8_isp: EFUSE ?= 04
  416. pro8_isp: isp
  417. atmega328_pro8: TARGET = atmega328_pro_8MHz
  418. atmega328_pro8: CHIP = atmega328
  419. atmega328_pro8:
  420. $(MAKE) $(CHIP) AVR_FREQ=8000000L LED_START_FLASHES=3
  421. mv $(PROGRAM)_$(CHIP).hex $(PROGRAM)_$(TARGET).hex
  422. mv $(PROGRAM)_$(CHIP).lst $(PROGRAM)_$(TARGET).lst
  423. atmega328_pro8_isp: atmega328_pro8
  424. atmega328_pro8_isp: TARGET = atmega328_pro_8MHz
  425. atmega328_pro8_isp: MCU_TARGET = atmega328p
  426. # 512 byte boot, SPIEN
  427. atmega328_pro8_isp: HFUSE ?= DE
  428. # Low power xtal (16MHz) 16KCK/14CK+65ms
  429. atmega328_pro8_isp: LFUSE ?= FF
  430. # 2.7V brownout
  431. atmega328_pro8_isp: EFUSE ?= 05
  432. atmega328_pro8_isp: isp
  433. #
  434. # Include additional platforms
  435. include Makefile.atmel
  436. include Makefile.extras
  437. include Makefile.1284
  438. include Makefile.custom
  439. #---------------------------------------------------------------------------
  440. #
  441. # Generic build instructions
  442. #
  443. FORCE:
  444. baudcheck: FORCE
  445. - @$(CC) --version
  446. - @$(CC) $(CFLAGS) -E baudcheck.c -o baudcheck.tmp.sh
  447. - @$(SH) baudcheck.tmp.sh
  448. isp: $(TARGET)
  449. $(MAKE) -f Makefile.isp isp TARGET=$(TARGET)
  450. isp-stk500: $(PROGRAM)_$(TARGET).hex
  451. $(STK500-1)
  452. $(STK500-2)
  453. %.elf: $(OBJ) baudcheck $(dummy)
  454. $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS)
  455. $(SIZE) $@
  456. clean:
  457. rm -rf *.o *.elf *.lst *.map *.sym *.lss *.eep *.srec *.bin *.hex *.tmp.sh
  458. %.lst: %.elf
  459. $(OBJDUMP) -h -S $< > $@
  460. %.hex: %.elf
  461. $(OBJCOPY) -j .text -j .data -j .version --set-section-flags .version=alloc,load -O ihex $< $@
  462. %.srec: %.elf
  463. $(OBJCOPY) -j .text -j .data -j .version --set-section-flags .version=alloc,load -O srec $< $@
  464. %.bin: %.elf
  465. $(OBJCOPY) -j .text -j .data -j .version --set-section-flags .version=alloc,load -O binary $< $@