Makefile 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  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. # program name should not be changed...
  19. PROGRAM = optiboot
  20. # The default behavior is to build using tools that are in the users
  21. # current path variables, but we can also build using an installed
  22. # Arduino user IDE setup, or the Arduino source tree.
  23. # Uncomment this next lines to build within the arduino environment,
  24. # using the arduino-included avrgcc toolset (mac and pc)
  25. # ENV ?= arduino
  26. # ENV ?= arduinodev
  27. # OS ?= macosx
  28. # OS ?= windows
  29. # enter the parameters for the avrdude isp tool
  30. ISPTOOL = avrisp
  31. ISPPORT = /dev/ttyUSB0
  32. ISPSPEED = -b 19200
  33. MCU_TARGET = atmega168
  34. LDSECTIONS = -Wl,--section-start=.text=0x3e00 -Wl,--section-start=.version=0x3ffe
  35. # Build environments
  36. # Start of some ugly makefile-isms to allow optiboot to be built
  37. # in several different environments. See the README.TXT file for
  38. # details.
  39. # default
  40. fixpath = $(1)
  41. ifeq ($(ENV), arduino)
  42. # For Arduino, we assume that we're connected to the optiboot directory
  43. # included with the arduino distribution, which means that the full set
  44. # of avr-tools are "right up there" in standard places.
  45. TOOLROOT = ../../../tools
  46. GCCROOT = $(TOOLROOT)/avr/bin/
  47. AVRDUDE_CONF = -C$(TOOLROOT)/avr/etc/avrdude.conf
  48. ifeq ($(OS), windows)
  49. # On windows, SOME of the tool paths will need to have backslashes instead
  50. # of forward slashes (because they use windows cmd.exe for execution instead
  51. # of a unix/mingw shell?) We also have to ensure that a consistent shell
  52. # is used even if a unix shell is installed (ie as part of WINAVR)
  53. fixpath = $(subst /,\,$1)
  54. SHELL = cmd.exe
  55. endif
  56. else ifeq ($(ENV), arduinodev)
  57. # Arduino IDE source code environment. Use the unpacked compilers created
  58. # by the build (you'll need to do "ant build" first.)
  59. ifeq ($(OS), macosx)
  60. TOOLROOT = ../../../../build/macosx/work/Arduino.app/Contents/Resources/Java/hardware/tools
  61. endif
  62. ifeq ($(OS), windows)
  63. TOOLROOT = ../../../../build/windows/work/hardware/tools
  64. endif
  65. GCCROOT = $(TOOLROOT)/avr/bin/
  66. AVRDUDE_CONF = -C$(TOOLROOT)/avr/etc/avrdude.conf
  67. else
  68. GCCROOT = /usr/local/avr/bin/
  69. AVRDUDE_CONF =
  70. AVRDUDE_ROOT = /usr/local/bin/
  71. endif
  72. #
  73. # End of build environment code.
  74. # the efuse should really be 0xf8; since, however, only the lower
  75. # three bits of that byte are used on the atmega168, avrdude gets
  76. # confused if you specify 1's for the higher bits, see:
  77. # http://tinker.it/now/2007/02/24/the-tale-of-avrdude-atmega168-and-extended-bits-fuses/
  78. #
  79. # similarly, the lock bits should be 0xff instead of 0x3f (to
  80. # unlock the bootloader section) and 0xcf instead of 0x2f (to
  81. # lock it), but since the high two bits of the lock byte are
  82. # unused, avrdude would get confused.
  83. ISPFUSES = $(AVRDUDE_ROOT)avrdude $(AVRDUDE_CONF) -c $(ISPTOOL) \
  84. -p $(MCU_TARGET) -P $(ISPPORT) $(ISPSPEED) \
  85. -e -u -U lock:w:0x3f:m -U efuse:w:0x$(EFUSE):m \
  86. -U hfuse:w:0x$(HFUSE):m -U lfuse:w:0x$(LFUSE):m
  87. ISPFLASH = $(AVRDUDE_ROOT)avrdude $(AVRDUDE_CONF) -c $(ISPTOOL) \
  88. -p $(MCU_TARGET) -P $(ISPPORT) $(ISPSPEED) -V \
  89. -U flash:w:$(PROGRAM)_$(TARGET).hex -U lock:w:0x2f:m
  90. STK500 = "C:\Program Files\Atmel\AVR Tools\STK500\Stk500.exe"
  91. STK500-1 = $(STK500) -e -d$(MCU_TARGET) -pf -vf -if$(PROGRAM)_$(TARGET).hex \
  92. -lFF -LFF -f$(HFUSE)$(LFUSE) -EF8 -ms -q -cUSB -I200kHz -s -wt
  93. STK500-2 = $(STK500) -d$(MCU_TARGET) -ms -q -lCF -LCF -cUSB -I200kHz -s -wt
  94. OBJ = $(PROGRAM).o
  95. OPTIMIZE = -Os -fno-inline-small-functions -fno-split-wide-types -mshort-calls
  96. DEFS =
  97. LIBS =
  98. CC = $(GCCROOT)avr-gcc
  99. # Override is only needed by avr-lib build system.
  100. override CFLAGS = -g -Wall $(OPTIMIZE) -mmcu=$(MCU_TARGET) -DF_CPU=$(AVR_FREQ) $(DEFS)
  101. override LDFLAGS = $(LDSECTIONS) -Wl,--relax -Wl,--gc-sections -nostartfiles -nostdlib
  102. OBJCOPY = $(GCCROOT)avr-objcopy
  103. OBJDUMP = $(call fixpath,$(GCCROOT)avr-objdump)
  104. SIZE = $(GCCROOT)avr-size
  105. # Test platforms
  106. # Virtual boot block test
  107. virboot328: TARGET = atmega328
  108. virboot328: MCU_TARGET = atmega328p
  109. virboot328: CFLAGS += '-DLED_START_FLASHES=3' '-DBAUD_RATE=115200' '-DVIRTUAL_BOOT'
  110. virboot328: AVR_FREQ = 16000000L
  111. virboot328: LDSECTIONS = -Wl,--section-start=.text=0x7e00 -Wl,--section-start=.version=0x7ffe
  112. virboot328: $(PROGRAM)_atmega328.hex
  113. virboot328: $(PROGRAM)_atmega328.lst
  114. # 20MHz clocked platforms
  115. #
  116. # These are capable of 230400 baud, or 115200 baud on PC (Arduino Avrdude issue)
  117. #
  118. pro20: TARGET = pro_20mhz
  119. pro20: MCU_TARGET = atmega168
  120. pro20: CFLAGS += '-DLED_START_FLASHES=3' '-DBAUD_RATE=115200'
  121. pro20: AVR_FREQ = 20000000L
  122. pro20: $(PROGRAM)_pro_20mhz.hex
  123. pro20: $(PROGRAM)_pro_20mhz.lst
  124. pro20_isp: pro20
  125. pro20_isp: TARGET = pro_20mhz
  126. # 2.7V brownout
  127. pro20_isp: HFUSE = DD
  128. # Full swing xtal (20MHz) 258CK/14CK+4.1ms
  129. pro20_isp: LFUSE = C6
  130. # 512 byte boot
  131. pro20_isp: EFUSE = 04
  132. pro20_isp: isp
  133. # 16MHz clocked platforms
  134. #
  135. # These are capable of 230400 baud, or 115200 baud on PC (Arduino Avrdude issue)
  136. #
  137. pro16: TARGET = pro_16MHz
  138. pro16: MCU_TARGET = atmega168
  139. pro16: CFLAGS += '-DLED_START_FLASHES=3' '-DBAUD_RATE=115200'
  140. pro16: AVR_FREQ = 16000000L
  141. pro16: $(PROGRAM)_pro_16MHz.hex
  142. pro16: $(PROGRAM)_pro_16MHz.lst
  143. pro16_isp: pro16
  144. pro16_isp: TARGET = pro_16MHz
  145. # 2.7V brownout
  146. pro16_isp: HFUSE = DD
  147. # Full swing xtal (20MHz) 258CK/14CK+4.1ms
  148. pro16_isp: LFUSE = C6
  149. # 512 byte boot
  150. pro16_isp: EFUSE = 04
  151. pro16_isp: isp
  152. # Diecimila, Duemilanove with m168, and NG use identical bootloaders
  153. # Call it "atmega168" for generality and clarity, keep "diecimila" for
  154. # backward compatibility of makefile
  155. #
  156. atmega168: TARGET = atmega168
  157. atmega168: MCU_TARGET = atmega168
  158. atmega168: CFLAGS += '-DLED_START_FLASHES=3' '-DBAUD_RATE=115200'
  159. atmega168: AVR_FREQ = 16000000L
  160. atmega168: $(PROGRAM)_atmega168.hex
  161. atmega168: $(PROGRAM)_atmega168.lst
  162. atmega168_isp: atmega168
  163. atmega168_isp: TARGET = atmega168
  164. # 2.7V brownout
  165. atmega168_isp: HFUSE = DD
  166. # Low power xtal (16MHz) 16KCK/14CK+65ms
  167. atmega168_isp: LFUSE = FF
  168. # 512 byte boot
  169. atmega168_isp: EFUSE = 04
  170. atmega168_isp: isp
  171. diecimila: TARGET = diecimila
  172. diecimila: MCU_TARGET = atmega168
  173. diecimila: CFLAGS += '-DLED_START_FLASHES=3' '-DBAUD_RATE=115200'
  174. diecimila: AVR_FREQ = 16000000L
  175. diecimila: $(PROGRAM)_diecimila.hex
  176. diecimila: $(PROGRAM)_diecimila.lst
  177. diecimila_isp: diecimila
  178. diecimila_isp: TARGET = diecimila
  179. # 2.7V brownout
  180. diecimila_isp: HFUSE = DD
  181. # Low power xtal (16MHz) 16KCK/14CK+65ms
  182. diecimila_isp: LFUSE = FF
  183. # 512 byte boot
  184. diecimila_isp: EFUSE = 04
  185. diecimila_isp: isp
  186. atmega328: TARGET = atmega328
  187. atmega328: MCU_TARGET = atmega328p
  188. atmega328: CFLAGS += '-DLED_START_FLASHES=3' '-DBAUD_RATE=115200'
  189. atmega328: AVR_FREQ = 16000000L
  190. atmega328: LDSECTIONS = -Wl,--section-start=.text=0x7e00 -Wl,--section-start=.version=0x7ffe
  191. atmega328: $(PROGRAM)_atmega328.hex
  192. atmega328: $(PROGRAM)_atmega328.lst
  193. atmega328_isp: atmega328
  194. atmega328_isp: TARGET = atmega328
  195. atmega328_isp: MCU_TARGET = atmega328p
  196. # 512 byte boot, SPIEN
  197. atmega328_isp: HFUSE = DE
  198. # Low power xtal (16MHz) 16KCK/14CK+65ms
  199. atmega328_isp: LFUSE = FF
  200. # 2.7V brownout
  201. atmega328_isp: EFUSE = 05
  202. atmega328_isp: isp
  203. atmega1284: TARGET = atmega1284p
  204. atmega1284: MCU_TARGET = atmega1284p
  205. atmega1284: CFLAGS += '-DLED_START_FLASHES=3' '-DBAUD_RATE=115200' '-DBIGBOOT'
  206. atmega1284: AVR_FREQ = 16000000L
  207. atmega1284: LDSECTIONS = -Wl,--section-start=.text=0x1fc00
  208. atmega1284: $(PROGRAM)_atmega1284p.hex
  209. atmega1284: $(PROGRAM)_atmega1284p.lst
  210. atmega1284_isp: atmega1284
  211. atmega1284_isp: TARGET = atmega1284p
  212. atmega1284_isp: MCU_TARGET = atmega1284p
  213. # 1024 byte boot
  214. atmega1284_isp: HFUSE = DE
  215. # Low power xtal (16MHz) 16KCK/14CK+65ms
  216. atmega1284_isp: LFUSE = FF
  217. # 2.7V brownout
  218. atmega1284_isp: EFUSE = FD
  219. atmega1284_isp: isp
  220. atmega1284_slow: TARGET = atmega1284p_slow
  221. atmega1284_slow: MCU_TARGET = atmega1284p
  222. atmega1284_slow: CFLAGS += '-DLED_START_FLASHES=3' '-DBAUD_RATE=19200' '-DBIGBOOT'
  223. atmega1284_slow: AVR_FREQ = 16000000L
  224. atmega1284_slow: LDSECTIONS = -Wl,--section-start=.text=0x1fc00
  225. atmega1284_slow: $(PROGRAM)_atmega1284p_slow.hex
  226. atmega1284_slow: $(PROGRAM)_atmega1284p_slow.lst
  227. atmega1284_slow_isp: atmega1284_slow
  228. atmega1284_slow_isp: TARGET = atmega1284p_slow
  229. atmega1284_slow_isp: MCU_TARGET = atmega1284p
  230. # 1024 byte boot
  231. atmega1284_slow_isp: HFUSE = DE
  232. # Low power xtal (16MHz) 16KCK/14CK+65ms
  233. atmega1284_slow_isp: LFUSE = FF
  234. # 2.7V brownout
  235. atmega1284_slow_isp: EFUSE = FD
  236. atmega1284_slow_isp: isp
  237. # Sanguino has a minimum boot size of 1024 bytes, so enable extra functions
  238. #
  239. sanguino: TARGET = atmega644p
  240. sanguino: MCU_TARGET = atmega644p
  241. sanguino: CFLAGS += '-DLED_START_FLASHES=3' '-DBAUD_RATE=115200' '-DBIGBOOT'
  242. sanguino: AVR_FREQ = 16000000L
  243. sanguino: LDSECTIONS = -Wl,--section-start=.text=0xfc00
  244. sanguino: $(PROGRAM)_atmega644p.hex
  245. sanguino: $(PROGRAM)_atmega644p.lst
  246. sanguino_isp: sanguino
  247. sanguino_isp: TARGET = atmega644p
  248. sanguino_isp: MCU_TARGET = atmega644p
  249. # 1024 byte boot
  250. sanguino_isp: HFUSE = DE
  251. # Low power xtal (16MHz) 16KCK/14CK+65ms
  252. sanguino_isp: LFUSE = FF
  253. # 2.7V brownout
  254. sanguino_isp: EFUSE = 05
  255. sanguino_isp: isp
  256. # Mega has a minimum boot size of 1024 bytes, so enable extra functions
  257. #mega: TARGET = atmega1280
  258. mega: MCU_TARGET = atmega1280
  259. mega: CFLAGS += '-DLED_START_FLASHES=3' '-DBAUD_RATE=115200' '-DBIGBOOT'
  260. mega: AVR_FREQ = 16000000L
  261. mega: LDSECTIONS = -Wl,--section-start=.text=0x1fc00
  262. mega: $(PROGRAM)_atmega1280.hex
  263. mega: $(PROGRAM)_atmega1280.lst
  264. mega_isp: mega
  265. mega_isp: TARGET = atmega1280
  266. mega_isp: MCU_TARGET = atmega1280
  267. # 1024 byte boot
  268. mega_isp: HFUSE = DE
  269. # Low power xtal (16MHz) 16KCK/14CK+65ms
  270. mega_isp: LFUSE = FF
  271. # 2.7V brownout
  272. mega_isp: EFUSE = 05
  273. mega_isp: isp
  274. # ATmega8
  275. #
  276. atmega8: TARGET = atmega8
  277. atmega8: MCU_TARGET = atmega8
  278. atmega8: CFLAGS += '-DLED_START_FLASHES=3' '-DBAUD_RATE=115200'
  279. atmega8: AVR_FREQ = 16000000L
  280. atmega8: LDSECTIONS = -Wl,--section-start=.text=0x1e00 -Wl,--section-start=.version=0x1ffe
  281. atmega8: $(PROGRAM)_atmega8.hex
  282. atmega8: $(PROGRAM)_atmega8.lst
  283. atmega8_isp: atmega8
  284. atmega8_isp: TARGET = atmega8
  285. atmega8_isp: MCU_TARGET = atmega8
  286. # SPIEN, CKOPT, Bootsize=512B
  287. atmega8_isp: HFUSE = CC
  288. # 2.7V brownout, Low power xtal (16MHz) 16KCK/14CK+65ms
  289. atmega8_isp: LFUSE = BF
  290. atmega8_isp: isp
  291. # ATmega88
  292. #
  293. atmega88: TARGET = atmega88
  294. atmega88: MCU_TARGET = atmega88
  295. atmega88: CFLAGS += '-DLED_START_FLASHES=3' '-DBAUD_RATE=115200'
  296. atmega88: AVR_FREQ = 16000000L
  297. atmega88: LDSECTIONS = -Wl,--section-start=.text=0x1e00 -Wl,--section-start=.version=0x1ffe
  298. atmega88: $(PROGRAM)_atmega88.hex
  299. atmega88: $(PROGRAM)_atmega88.lst
  300. atmega88_isp: atmega88
  301. atmega88_isp: TARGET = atmega88
  302. atmega88_isp: MCU_TARGET = atmega88
  303. # 2.7V brownout
  304. atmega88_isp: HFUSE = DD
  305. # Low power xtal (16MHz) 16KCK/14CK+65ms
  306. atemga88_isp: LFUSE = FF
  307. # 512 byte boot
  308. atmega88_isp: EFUSE = 04
  309. atmega88_isp: isp
  310. # 8MHz clocked platforms
  311. #
  312. # These are capable of 115200 baud
  313. #
  314. lilypad: TARGET = lilypad
  315. lilypad: MCU_TARGET = atmega168
  316. lilypad: CFLAGS += '-DLED_START_FLASHES=3' '-DBAUD_RATE=115200'
  317. lilypad: AVR_FREQ = 8000000L
  318. lilypad: $(PROGRAM)_lilypad.hex
  319. lilypad: $(PROGRAM)_lilypad.lst
  320. lilypad_isp: lilypad
  321. lilypad_isp: TARGET = lilypad
  322. # 2.7V brownout
  323. lilypad_isp: HFUSE = DD
  324. # Internal 8MHz osc (8MHz) Slow rising power
  325. lilypad_isp: LFUSE = E2
  326. # 512 byte boot
  327. lilypad_isp: EFUSE = 04
  328. lilypad_isp: isp
  329. lilypad_resonator: TARGET = lilypad_resonator
  330. lilypad_resonator: MCU_TARGET = atmega168
  331. lilypad_resonator: CFLAGS += '-DLED_START_FLASHES=3' '-DBAUD_RATE=115200'
  332. lilypad_resonator: AVR_FREQ = 8000000L
  333. lilypad_resonator: $(PROGRAM)_lilypad_resonator.hex
  334. lilypad_resonator: $(PROGRAM)_lilypad_resonator.lst
  335. lilypad_resonator_isp: lilypad_resonator
  336. lilypad_resonator_isp: TARGET = lilypad_resonator
  337. # 2.7V brownout
  338. lilypad_resonator_isp: HFUSE = DD
  339. # Full swing xtal (20MHz) 258CK/14CK+4.1ms
  340. lilypad_resonator_isp: LFUSE = C6
  341. # 512 byte boot
  342. lilypad_resonator_isp: EFUSE = 04
  343. lilypad_resonator_isp: isp
  344. pro8: TARGET = pro_8MHz
  345. pro8: MCU_TARGET = atmega168
  346. pro8: CFLAGS += '-DLED_START_FLASHES=3' '-DBAUD_RATE=115200'
  347. pro8: AVR_FREQ = 8000000L
  348. pro8: $(PROGRAM)_pro_8MHz.hex
  349. pro8: $(PROGRAM)_pro_8MHz.lst
  350. pro8_isp: pro8
  351. pro8_isp: TARGET = pro_8MHz
  352. # 2.7V brownout
  353. pro8_isp: HFUSE = DD
  354. # Full swing xtal (20MHz) 258CK/14CK+4.1ms
  355. pro8_isp: LFUSE = C6
  356. # 512 byte boot
  357. pro8_isp: EFUSE = 04
  358. pro8_isp: isp
  359. atmega328_pro8: TARGET = atmega328_pro_8MHz
  360. atmega328_pro8: MCU_TARGET = atmega328p
  361. atmega328_pro8: CFLAGS += '-DLED_START_FLASHES=3' '-DBAUD_RATE=115200'
  362. atmega328_pro8: AVR_FREQ = 8000000L
  363. atmega328_pro8: LDSECTIONS = -Wl,--section-start=.text=0x7e00 -Wl,--section-start=.version=0x7ffe
  364. atmega328_pro8: $(PROGRAM)_atmega328_pro_8MHz.hex
  365. atmega328_pro8: $(PROGRAM)_atmega328_pro_8MHz.lst
  366. atmega328_pro8_isp: atmega328_pro8
  367. atmega328_pro8_isp: TARGET = atmega328_pro_8MHz
  368. atmega328_pro8_isp: MCU_TARGET = atmega328p
  369. # 512 byte boot, SPIEN
  370. atmega328_pro8_isp: HFUSE = DE
  371. # Low power xtal (16MHz) 16KCK/14CK+65ms
  372. atmega328_pro8_isp: LFUSE = FF
  373. # 2.7V brownout
  374. atmega328_pro8_isp: EFUSE = 05
  375. atmega328_pro8_isp: isp
  376. # 1MHz clocked platforms
  377. #
  378. # These are capable of 9600 baud
  379. #
  380. luminet: TARGET = luminet
  381. luminet: MCU_TARGET = attiny84
  382. luminet: CFLAGS += '-DLED_START_FLASHES=3' '-DSOFT_UART' '-DBAUD_RATE=9600'
  383. luminet: CFLAGS += '-DVIRTUAL_BOOT_PARTITION'
  384. luminet: AVR_FREQ = 1000000L
  385. luminet: LDSECTIONS = -Wl,--section-start=.text=0x1d00 -Wl,--section-start=.version=0x1efe
  386. luminet: $(PROGRAM)_luminet.hex
  387. luminet: $(PROGRAM)_luminet.lst
  388. luminet_isp: luminet
  389. luminet_isp: TARGET = luminet
  390. luminet_isp: MCU_TARGET = attiny84
  391. # Brownout disabled
  392. luminet_isp: HFUSE = DF
  393. # 1MHz internal oscillator, slowly rising power
  394. luminet_isp: LFUSE = 62
  395. # Self-programming enable
  396. luminet_isp: EFUSE = FE
  397. luminet_isp: isp
  398. #
  399. # Generic build instructions
  400. #
  401. #
  402. isp: $(TARGET)
  403. $(ISPFUSES)
  404. $(ISPFLASH)
  405. isp-stk500: $(PROGRAM)_$(TARGET).hex
  406. $(STK500-1)
  407. $(STK500-2)
  408. %.elf: $(OBJ)
  409. $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
  410. $(SIZE) $@
  411. clean:
  412. rm -rf *.o *.elf *.lst *.map *.sym *.lss *.eep *.srec *.bin *.hex
  413. %.lst: %.elf
  414. $(OBJDUMP) -h -S $< > $@
  415. %.hex: %.elf
  416. $(OBJCOPY) -j .text -j .data -j .version --set-section-flags .version=alloc,load -O ihex $< $@
  417. %.srec: %.elf
  418. $(OBJCOPY) -j .text -j .data -j .version --set-section-flags .version=alloc,load -O srec $< $@
  419. %.bin: %.elf
  420. $(OBJCOPY) -j .text -j .data -j .version --set-section-flags .version=alloc,load -O binary $< $@