My Marlin configs for Fabrikator Mini and CTC i3 Pro B
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

Makefile 29KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865
  1. # Marlin Firmware Arduino Project Makefile
  2. #
  3. # Makefile Based on:
  4. # Arduino 0011 Makefile
  5. # Arduino adaptation by mellis, eighthave, oli.keller
  6. # Marlin adaption by Daid
  7. # Marlin 2.0 support and RELOC_WORKAROUND by @marcio-ao
  8. #
  9. # This has been tested with Arduino 0022.
  10. #
  11. # This makefile allows you to build sketches from the command line
  12. # without the Arduino environment (or Java).
  13. #
  14. # Detailed instructions for using the makefile:
  15. #
  16. # 1. Modify the line containing "ARDUINO_INSTALL_DIR" to point to the directory that
  17. # contains the Arduino installation (for example, under Mac OS X, this
  18. # might be /Applications/Arduino.app/Contents/Resources/Java).
  19. #
  20. # 2. Modify the line containing "UPLOAD_PORT" to refer to the filename
  21. # representing the USB or serial connection to your Arduino board
  22. # (e.g. UPLOAD_PORT = /dev/tty.USB0). If the exact name of this file
  23. # changes, you can use * as a wild card (e.g. UPLOAD_PORT = /dev/tty.usb*).
  24. #
  25. # 3. Set the line containing "MCU" to match your board's processor.
  26. # Older one's are atmega8 based, newer ones like Arduino Mini, Bluetooth
  27. # or Diecimila have the atmega168. If you're using a LilyPad Arduino,
  28. # change F_CPU to 8000000. If you are using Gen7 electronics, you
  29. # probably need to use 20000000. Either way, you must regenerate
  30. # the speed lookup table with create_speed_lookuptable.py.
  31. #
  32. # 4. Type "make" and press enter to compile/verify your program.
  33. #
  34. # 5. Type "make upload", reset your Arduino board, and press enter to
  35. # upload your program to the Arduino board.
  36. #
  37. # Note that all settings at the top of this file can be overriden from
  38. # the command line with, for example, "make HARDWARE_MOTHERBOARD=71"
  39. #
  40. # To compile for RAMPS (atmega2560) with Arduino 1.6.9 at root/arduino you would use...
  41. #
  42. # make ARDUINO_VERSION=10609 AVR_TOOLS_PATH=/root/arduino/hardware/tools/avr/bin/ \
  43. # HARDWARE_MOTHERBOARD=33 ARDUINO_INSTALL_DIR=/root/arduino
  44. #
  45. # To compile and upload simply add "upload" to the end of the line...
  46. #
  47. # make ARDUINO_VERSION=10609 AVR_TOOLS_PATH=/root/arduino/hardware/tools/avr/bin/ \
  48. # HARDWARE_MOTHERBOARD=33 ARDUINO_INSTALL_DIR=/root/arduino upload
  49. #
  50. # If uploading doesn't work try adding the parameter "AVRDUDE_PROGRAMMER=wiring" or
  51. # start upload manually (using stk500) like so:
  52. #
  53. # avrdude -C /root/arduino/hardware/tools/avr/etc/avrdude.conf -v -p m2560 -c stk500 \
  54. # -U flash:w:applet/Marlin.hex:i -P /dev/ttyUSB0
  55. #
  56. # Or, try disconnecting USB to power down and then reconnecting before running avrdude.
  57. #
  58. # This defines the board to compile for (see boards.h for your board's ID)
  59. HARDWARE_MOTHERBOARD ?= 11
  60. # Arduino source install directory, and version number
  61. # On most linuxes this will be /usr/share/arduino
  62. ARDUINO_INSTALL_DIR ?= ${HOME}/Arduino
  63. ARDUINO_VERSION ?= 106
  64. # The installed Libraries are in the User folder
  65. ARDUINO_USER_DIR ?= ${HOME}/Arduino
  66. # You can optionally set a path to the avr-gcc tools. Requires a trailing slash. (ex: /usr/local/avr-gcc/bin)
  67. AVR_TOOLS_PATH ?=
  68. #Programmer configuration
  69. UPLOAD_RATE ?= 57600
  70. AVRDUDE_PROGRAMMER ?= arduino
  71. # on most linuxes this will be /dev/ttyACM0 or /dev/ttyACM1
  72. UPLOAD_PORT ?= /dev/ttyUSB0
  73. #Directory used to build files in, contains all the build files, from object files to the final hex file
  74. #on linux it is best to put an absolute path like /home/username/tmp .
  75. BUILD_DIR ?= applet
  76. # This defines whether Liquid_TWI2 support will be built
  77. LIQUID_TWI2 ?= 0
  78. # this defines if Wire is needed
  79. WIRE ?= 0
  80. # this defines if U8GLIB is needed (may require RELOC_WORKAROUND)
  81. U8GLIB ?= 1
  82. # this defines whether to include the Trinamic TMCStepper library
  83. TMC ?= 1
  84. ############
  85. # Try to automatically determine whether RELOC_WORKAROUND is needed based
  86. # on GCC versions:
  87. # http://www.avrfreaks.net/comment/1789106#comment-1789106
  88. CC_MAJ:=$(shell $(CC) -dM -E - < /dev/null | grep __GNUC__ | cut -f3 -d\ )
  89. CC_MIN:=$(shell $(CC) -dM -E - < /dev/null | grep __GNUC_MINOR__ | cut -f3 -d\ )
  90. CC_PATCHLEVEL:=$(shell $(CC) -dM -E - < /dev/null | grep __GNUC_PATCHLEVEL__ | cut -f3 -d\ )
  91. CC_VER:=$(shell echo $$(( $(CC_MAJ) * 10000 + $(CC_MIN) * 100 + $(CC_PATCHLEVEL) )))
  92. ifeq ($(shell test $(CC_VER) -lt 40901 && echo 1),1)
  93. @echo This version of GCC is likely broken. Enabling relocation workaround.
  94. RELOC_WORKAROUND = 1
  95. endif
  96. ############################################################################
  97. # Below here nothing should be changed...
  98. # Here the Arduino variant is selected by the board type
  99. # HARDWARE_VARIANT = "arduino", "Sanguino", "Gen7", ...
  100. # MCU = "atmega1280", "Mega2560", "atmega2560", "atmega644p", ...
  101. ifeq ($(HARDWARE_MOTHERBOARD),0)
  102. # No motherboard selected
  103. #
  104. # RAMPS 1.3 / 1.4 - ATmega1280, ATmega2560
  105. #
  106. # MEGA/RAMPS up to 1.2
  107. else ifeq ($(HARDWARE_MOTHERBOARD),1000)
  108. # RAMPS 1.3 (Power outputs: Hotend, Fan, Bed)
  109. else ifeq ($(HARDWARE_MOTHERBOARD),1010)
  110. # RAMPS 1.3 (Power outputs: Hotend0, Hotend1, Bed)
  111. else ifeq ($(HARDWARE_MOTHERBOARD),1011)
  112. # RAMPS 1.3 (Power outputs: Hotend, Fan0, Fan1)
  113. else ifeq ($(HARDWARE_MOTHERBOARD),1012)
  114. # RAMPS 1.3 (Power outputs: Hotend0, Hotend1, Fan)
  115. else ifeq ($(HARDWARE_MOTHERBOARD),1013)
  116. # RAMPS 1.3 (Power outputs: Spindle, Controller Fan)
  117. else ifeq ($(HARDWARE_MOTHERBOARD),1014)
  118. # RAMPS 1.4 (Power outputs: Hotend, Fan, Bed)
  119. else ifeq ($(HARDWARE_MOTHERBOARD),1020)
  120. # RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Bed)
  121. else ifeq ($(HARDWARE_MOTHERBOARD),1021)
  122. # RAMPS 1.4 (Power outputs: Hotend, Fan0, Fan1)
  123. else ifeq ($(HARDWARE_MOTHERBOARD),1022)
  124. # RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Fan)
  125. else ifeq ($(HARDWARE_MOTHERBOARD),1023)
  126. # RAMPS 1.4 (Power outputs: Spindle, Controller Fan)
  127. else ifeq ($(HARDWARE_MOTHERBOARD),1024)
  128. # RAMPS Plus 3DYMY (Power outputs: Hotend, Fan, Bed)
  129. else ifeq ($(HARDWARE_MOTHERBOARD),1030)
  130. # RAMPS Plus 3DYMY (Power outputs: Hotend0, Hotend1, Bed)
  131. else ifeq ($(HARDWARE_MOTHERBOARD),1031)
  132. # RAMPS Plus 3DYMY (Power outputs: Hotend, Fan0, Fan1)
  133. else ifeq ($(HARDWARE_MOTHERBOARD),1032)
  134. # RAMPS Plus 3DYMY (Power outputs: Hotend0, Hotend1, Fan)
  135. else ifeq ($(HARDWARE_MOTHERBOARD),1033)
  136. # RAMPS Plus 3DYMY (Power outputs: Spindle, Controller Fan)
  137. else ifeq ($(HARDWARE_MOTHERBOARD),1034)
  138. #
  139. # RAMPS Derivatives - ATmega1280, ATmega2560
  140. #
  141. # 3Drag Controller
  142. else ifeq ($(HARDWARE_MOTHERBOARD),1100)
  143. # Velleman K8200 Controller (derived from 3Drag Controller)
  144. else ifeq ($(HARDWARE_MOTHERBOARD),1101)
  145. # Velleman K8400 Controller (derived from 3Drag Controller)
  146. else ifeq ($(HARDWARE_MOTHERBOARD),1102)
  147. # 2PrintBeta BAM&DICE with STK drivers
  148. else ifeq ($(HARDWARE_MOTHERBOARD),1103)
  149. # 2PrintBeta BAM&DICE Due with STK drivers
  150. else ifeq ($(HARDWARE_MOTHERBOARD),1104)
  151. # MKS BASE v1.0
  152. else ifeq ($(HARDWARE_MOTHERBOARD),1105)
  153. # MKS v1.4 with A4982 stepper drivers
  154. else ifeq ($(HARDWARE_MOTHERBOARD),1106)
  155. # MKS v1.5 with Allegro A4982 stepper drivers
  156. else ifeq ($(HARDWARE_MOTHERBOARD),1107)
  157. # MKS BASE 1.0 with Heroic HR4982 stepper drivers
  158. else ifeq ($(HARDWARE_MOTHERBOARD),1108)
  159. # MKS GEN v1.3 or 1.4
  160. else ifeq ($(HARDWARE_MOTHERBOARD),1109)
  161. # MKS GEN L
  162. else ifeq ($(HARDWARE_MOTHERBOARD),1110)
  163. # zrib V2.0 control board (Chinese knock off RAMPS replica)
  164. else ifeq ($(HARDWARE_MOTHERBOARD),1111)
  165. # Bigtreetech or BIQU KFB2.0
  166. else ifeq ($(HARDWARE_MOTHERBOARD),1112)
  167. # Felix 2.0+ Electronics Board (RAMPS like)
  168. else ifeq ($(HARDWARE_MOTHERBOARD),1113)
  169. # Invent-A-Part RigidBoard
  170. else ifeq ($(HARDWARE_MOTHERBOARD),1114)
  171. # Invent-A-Part RigidBoard V2
  172. else ifeq ($(HARDWARE_MOTHERBOARD),1115)
  173. # Sainsmart 2-in-1 board
  174. else ifeq ($(HARDWARE_MOTHERBOARD),1116)
  175. # Ultimaker
  176. else ifeq ($(HARDWARE_MOTHERBOARD),1117)
  177. # Ultimaker (Older electronics. Pre 1.5.4. This is rare)
  178. else ifeq ($(HARDWARE_MOTHERBOARD),1118)
  179. MCU ?= atmega1280
  180. # Azteeg X3
  181. else ifeq ($(HARDWARE_MOTHERBOARD),1119)
  182. # Azteeg X3 Pro
  183. else ifeq ($(HARDWARE_MOTHERBOARD),1120)
  184. # Ultimainboard 2.x (Uses TEMP_SENSOR 20)
  185. else ifeq ($(HARDWARE_MOTHERBOARD),1121)
  186. # Rumba
  187. else ifeq ($(HARDWARE_MOTHERBOARD),1122)
  188. # Raise3D Rumba
  189. else ifeq ($(HARDWARE_MOTHERBOARD),1123)
  190. # Rapide Lite RL200 Rumba
  191. else ifeq ($(HARDWARE_MOTHERBOARD),1124)
  192. # Formbot T-Rex 2 Plus
  193. else ifeq ($(HARDWARE_MOTHERBOARD),1125)
  194. # Formbot T-Rex 3
  195. else ifeq ($(HARDWARE_MOTHERBOARD),1126)
  196. # Formbot Raptor
  197. else ifeq ($(HARDWARE_MOTHERBOARD),1127)
  198. # Formbot Raptor 2
  199. else ifeq ($(HARDWARE_MOTHERBOARD),1128)
  200. # bq ZUM Mega 3D
  201. else ifeq ($(HARDWARE_MOTHERBOARD),1129)
  202. # MakeBoard Mini v2.1.2 is a control board sold by MicroMake
  203. else ifeq ($(HARDWARE_MOTHERBOARD),1130)
  204. # TriGorilla Anycubic version 1.3 based on RAMPS EFB
  205. else ifeq ($(HARDWARE_MOTHERBOARD),1131)
  206. # TriGorilla Anycubic version 1.4 based on RAMPS EFB
  207. else ifeq ($(HARDWARE_MOTHERBOARD),1132)
  208. # TriGorilla Anycubic version 1.4 Rev 1.1
  209. else ifeq ($(HARDWARE_MOTHERBOARD),1133)
  210. # Creality: Ender-4, CR-8
  211. else ifeq ($(HARDWARE_MOTHERBOARD),1134)
  212. # Creality: CR10S, CR20, CR-X
  213. else ifeq ($(HARDWARE_MOTHERBOARD),1135)
  214. # Dagoma F5
  215. else ifeq ($(HARDWARE_MOTHERBOARD),1136)
  216. # FYSETC F6
  217. else ifeq ($(HARDWARE_MOTHERBOARD),1137)
  218. # Duplicator i3 Plus
  219. else ifeq ($(HARDWARE_MOTHERBOARD),1138)
  220. # VORON
  221. else ifeq ($(HARDWARE_MOTHERBOARD),1139)
  222. # TRONXY V3 1.0
  223. else ifeq ($(HARDWARE_MOTHERBOARD),1140)
  224. # Z-Bolt X Series
  225. else ifeq ($(HARDWARE_MOTHERBOARD),1141)
  226. #
  227. # RAMBo and derivatives
  228. #
  229. # Rambo
  230. else ifeq ($(HARDWARE_MOTHERBOARD),1200)
  231. # Mini-Rambo
  232. else ifeq ($(HARDWARE_MOTHERBOARD),1201)
  233. # Mini-Rambo 1.0a
  234. else ifeq ($(HARDWARE_MOTHERBOARD),1202)
  235. # Einsy Rambo
  236. else ifeq ($(HARDWARE_MOTHERBOARD),1203)
  237. # Einsy Retro
  238. else ifeq ($(HARDWARE_MOTHERBOARD),1204)
  239. # abee Scoovo X9H
  240. else ifeq ($(HARDWARE_MOTHERBOARD),1205)
  241. #
  242. # Other ATmega1280, ATmega2560
  243. #
  244. # Cartesio CN Controls V11
  245. else ifeq ($(HARDWARE_MOTHERBOARD),1300)
  246. # Cartesio CN Controls V12
  247. else ifeq ($(HARDWARE_MOTHERBOARD),1301)
  248. # Cheaptronic v1.0
  249. else ifeq ($(HARDWARE_MOTHERBOARD),1302)
  250. # Cheaptronic v2.0
  251. else ifeq ($(HARDWARE_MOTHERBOARD),1303)
  252. # Makerbot Mightyboard Revision E
  253. else ifeq ($(HARDWARE_MOTHERBOARD),1304)
  254. # Megatronics
  255. else ifeq ($(HARDWARE_MOTHERBOARD),1305)
  256. # Megatronics v2.0
  257. else ifeq ($(HARDWARE_MOTHERBOARD),1306)
  258. # Megatronics v3.0
  259. else ifeq ($(HARDWARE_MOTHERBOARD),1307)
  260. # Megatronics v3.1
  261. else ifeq ($(HARDWARE_MOTHERBOARD),1308)
  262. # Megatronics v3.2
  263. else ifeq ($(HARDWARE_MOTHERBOARD),1309)
  264. # Elefu Ra Board (v3)
  265. else ifeq ($(HARDWARE_MOTHERBOARD),1310)
  266. # Leapfrog
  267. else ifeq ($(HARDWARE_MOTHERBOARD),1311)
  268. # Mega controller
  269. else ifeq ($(HARDWARE_MOTHERBOARD),1312)
  270. # Geeetech GT2560 Rev B for Mecreator2
  271. else ifeq ($(HARDWARE_MOTHERBOARD),1313)
  272. # Geeetech GT2560 Rev. A
  273. else ifeq ($(HARDWARE_MOTHERBOARD),1314)
  274. # Geeetech GT2560 Rev. A+ (with auto level probe)
  275. else ifeq ($(HARDWARE_MOTHERBOARD),1315)
  276. # Geeetech GT2560 Rev B for A10(M/D)
  277. else ifeq ($(HARDWARE_MOTHERBOARD),1316)
  278. # Geeetech GT2560 Rev B for A20(M/D)
  279. else ifeq ($(HARDWARE_MOTHERBOARD),1317)
  280. # Einstart retrofit
  281. else ifeq ($(HARDWARE_MOTHERBOARD),1318)
  282. # Wanhao 0ne+ i3 Mini
  283. else ifeq ($(HARDWARE_MOTHERBOARD),1319)
  284. #
  285. # ATmega1281, ATmega2561
  286. #
  287. else ifeq ($(HARDWARE_MOTHERBOARD),1400)
  288. MCU ?= atmega1281
  289. else ifeq ($(HARDWARE_MOTHERBOARD),1410)
  290. MCU ?= atmega1281
  291. #
  292. # Sanguinololu and Derivatives - ATmega644P, ATmega1284P
  293. #
  294. # Sanguinololu < 1.2
  295. else ifeq ($(HARDWARE_MOTHERBOARD),1500)
  296. HARDWARE_VARIANT ?= Sanguino
  297. MCU ?= atmega644p
  298. # Sanguinololu 1.2 and above
  299. else ifeq ($(HARDWARE_MOTHERBOARD),1501)
  300. HARDWARE_VARIANT ?= Sanguino
  301. MCU ?= atmega644p
  302. # Melzi
  303. else ifeq ($(HARDWARE_MOTHERBOARD),1502)
  304. HARDWARE_VARIANT ?= Sanguino
  305. MCU ?= atmega644p
  306. # Melzi with ATmega1284 (MaKr3d version)
  307. else ifeq ($(HARDWARE_MOTHERBOARD),1503)
  308. HARDWARE_VARIANT ?= Sanguino
  309. MCU ?= atmega1284p
  310. # Melzi Creality3D board (for CR-10 etc)
  311. else ifeq ($(HARDWARE_MOTHERBOARD),1504)
  312. HARDWARE_VARIANT ?= Sanguino
  313. MCU ?= atmega1284p
  314. # Melzi Malyan M150 board
  315. else ifeq ($(HARDWARE_MOTHERBOARD),1505)
  316. HARDWARE_VARIANT ?= Sanguino
  317. MCU ?= atmega1284p
  318. # Tronxy X5S
  319. else ifeq ($(HARDWARE_MOTHERBOARD),1506)
  320. HARDWARE_VARIANT ?= Sanguino
  321. MCU ?= atmega1284p
  322. # STB V1.1
  323. else ifeq ($(HARDWARE_MOTHERBOARD),1507)
  324. HARDWARE_VARIANT ?= Sanguino
  325. MCU ?= atmega1284p
  326. # Azteeg X1
  327. else ifeq ($(HARDWARE_MOTHERBOARD),1508)
  328. HARDWARE_VARIANT ?= Sanguino
  329. MCU ?= atmega1284p
  330. # Anet 1.0 (Melzi clone)
  331. else ifeq ($(HARDWARE_MOTHERBOARD),1509)
  332. HARDWARE_VARIANT ?= Sanguino
  333. MCU ?= atmega1284p
  334. #
  335. # Other ATmega644P, ATmega644, ATmega1284P
  336. #
  337. # Gen3 Monolithic Electronics
  338. else ifeq ($(HARDWARE_MOTHERBOARD),1600)
  339. HARDWARE_VARIANT ?= Sanguino
  340. MCU ?= atmega644p
  341. # Gen3+
  342. else ifeq ($(HARDWARE_MOTHERBOARD),1601)
  343. HARDWARE_VARIANT ?= Sanguino
  344. MCU ?= atmega644p
  345. # Gen6
  346. else ifeq ($(HARDWARE_MOTHERBOARD),1602)
  347. HARDWARE_VARIANT ?= Gen6
  348. MCU ?= atmega644p
  349. # Gen6 deluxe
  350. else ifeq ($(HARDWARE_MOTHERBOARD),1603)
  351. HARDWARE_VARIANT ?= Gen6
  352. MCU ?= atmega644p
  353. # Gen7 custom (Alfons3 Version)
  354. else ifeq ($(HARDWARE_MOTHERBOARD),1604)
  355. HARDWARE_VARIANT ?= Gen7
  356. MCU ?= atmega644
  357. F_CPU ?= 20000000
  358. # Gen7 v1.1, v1.2
  359. else ifeq ($(HARDWARE_MOTHERBOARD),1605)
  360. HARDWARE_VARIANT ?= Gen7
  361. MCU ?= atmega644p
  362. F_CPU ?= 20000000
  363. # Gen7 v1.3
  364. else ifeq ($(HARDWARE_MOTHERBOARD),1606)
  365. HARDWARE_VARIANT ?= Gen7
  366. MCU ?= atmega644p
  367. F_CPU ?= 20000000
  368. # Gen7 v1.4
  369. else ifeq ($(HARDWARE_MOTHERBOARD),1607)
  370. HARDWARE_VARIANT ?= Gen7
  371. MCU ?= atmega1284p
  372. F_CPU ?= 20000000
  373. # Alpha OMCA board
  374. else ifeq ($(HARDWARE_MOTHERBOARD),1608)
  375. HARDWARE_VARIANT ?= SanguinoA
  376. MCU ?= atmega644
  377. # Final OMCA board
  378. else ifeq ($(HARDWARE_MOTHERBOARD),1609)
  379. HARDWARE_VARIANT ?= Sanguino
  380. MCU ?= atmega644p
  381. # Sethi 3D_1
  382. else ifeq ($(HARDWARE_MOTHERBOARD),1610)
  383. HARDWARE_VARIANT ?= Sanguino
  384. MCU ?= atmega644p
  385. #
  386. # Teensyduino - AT90USB1286, AT90USB1286P
  387. #
  388. # Teensylu
  389. else ifeq ($(HARDWARE_MOTHERBOARD),1700)
  390. HARDWARE_VARIANT ?= Teensy
  391. MCU ?= at90usb1286
  392. # Printrboard (AT90USB1286)
  393. else ifeq ($(HARDWARE_MOTHERBOARD),1701)
  394. HARDWARE_VARIANT ?= Teensy
  395. MCU ?= at90usb1286
  396. # Printrboard Revision F (AT90USB1286)
  397. else ifeq ($(HARDWARE_MOTHERBOARD),1702)
  398. HARDWARE_VARIANT ?= Teensy
  399. MCU ?= at90usb1286
  400. # Brainwave (AT90USB646)
  401. else ifeq ($(HARDWARE_MOTHERBOARD),1703)
  402. HARDWARE_VARIANT ?= Teensy
  403. MCU ?= at90usb646
  404. # Brainwave Pro (AT90USB1286)
  405. else ifeq ($(HARDWARE_MOTHERBOARD),1704)
  406. HARDWARE_VARIANT ?= Teensy
  407. MCU ?= at90usb1286
  408. # SAV Mk-I (AT90USB1286)
  409. else ifeq ($(HARDWARE_MOTHERBOARD),1705)
  410. HARDWARE_VARIANT ?= Teensy
  411. MCU ?= at90usb1286
  412. # Teensy++2.0 (AT90USB1286)
  413. else ifeq ($(HARDWARE_MOTHERBOARD),1706)
  414. HARDWARE_VARIANT ?= Teensy
  415. MCU ?= at90usb1286
  416. # 5DPrint D8 Driver Board
  417. else ifeq ($(HARDWARE_MOTHERBOARD),1707)
  418. HARDWARE_VARIANT ?= Teensy
  419. MCU ?= at90usb1286
  420. # UltiMachine Archim1 (with DRV8825 drivers)
  421. else ifeq ($(HARDWARE_MOTHERBOARD),3023)
  422. HARDWARE_VARIANT ?= archim
  423. MCPU = cortex-m3
  424. F_CPU = 84000000L
  425. IS_MCU = 0
  426. # UltiMachine Archim2 (with TMC2130 drivers)
  427. else ifeq ($(HARDWARE_MOTHERBOARD),3024)
  428. HARDWARE_VARIANT ?= archim
  429. MCPU = cortex-m3
  430. F_CPU = 84000000L
  431. IS_MCU = 0
  432. endif
  433. # Be sure to regenerate speed_lookuptable.h with create_speed_lookuptable.py
  434. # if you are setting this to something other than 16MHz
  435. # Set to 16Mhz if not yet set.
  436. F_CPU ?= 16000000
  437. # Set to microcontroller if IS_MCU not yet set
  438. IS_MCU ?= 1
  439. ifeq ($(IS_MCU),1)
  440. # Set to arduino, ATmega2560 if not yet set.
  441. HARDWARE_VARIANT ?= arduino
  442. MCU ?= atmega2560
  443. TOOL_PREFIX = avr
  444. MCU_FLAGS = -mmcu=$(MCU)
  445. SIZE_FLAGS = --mcu=$(MCU) -C
  446. else
  447. TOOL_PREFIX = arm-none-eabi
  448. CPU_FLAGS = -mthumb -mcpu=$(MCPU)
  449. SIZE_FLAGS = -A
  450. endif
  451. # Arduino contained the main source code for the Arduino
  452. # Libraries, the "hardware variant" are for boards
  453. # that derives from that, and their source are present in
  454. # the main Marlin source directory
  455. TARGET = $(notdir $(CURDIR))
  456. # VPATH tells make to look into these directory for source files,
  457. # there is no need to specify explicit pathnames as long as the
  458. # directory is added here
  459. # The Makefile for previous versions of Marlin used VPATH for all
  460. # source files, but for Marlin 2.0, we use VPATH only for arduino
  461. # library files.
  462. VPATH = .
  463. VPATH += $(BUILD_DIR)
  464. VPATH += $(HARDWARE_SRC)
  465. ifeq ($(HARDWARE_VARIANT), $(filter $(HARDWARE_VARIANT),arduino Teensy Sanguino))
  466. VPATH += $(ARDUINO_INSTALL_DIR)/hardware/marlin/avr/libraries/LiquidCrystal/src
  467. VPATH += $(ARDUINO_INSTALL_DIR)/hardware/marlin/avr/libraries/SPI
  468. endif
  469. ifeq ($(IS_MCU),1)
  470. VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino
  471. VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI
  472. VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI/src
  473. VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SoftwareSerial/src
  474. endif
  475. VPATH += $(ARDUINO_INSTALL_DIR)/libraries/LiquidCrystal/src
  476. ifeq ($(LIQUID_TWI2), 1)
  477. VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Wire
  478. VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Wire/utility
  479. VPATH += $(ARDUINO_INSTALL_DIR)/libraries/LiquidTWI2
  480. endif
  481. ifeq ($(WIRE), 1)
  482. VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Wire
  483. VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Wire/utility
  484. endif
  485. ifeq ($(NEOPIXEL), 1)
  486. VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Adafruit_NeoPixel
  487. endif
  488. ifeq ($(U8GLIB), 1)
  489. VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib
  490. VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/csrc
  491. VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/cppsrc
  492. VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/fntsrc
  493. endif
  494. ifeq ($(TMC), 1)
  495. VPATH += $(ARDUINO_INSTALL_DIR)/libraries/TMCStepper/src
  496. VPATH += $(ARDUINO_INSTALL_DIR)/libraries/TMCStepper/src/source
  497. endif
  498. ifeq ($(HARDWARE_VARIANT), arduino)
  499. HARDWARE_SUB_VARIANT ?= mega
  500. VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/variants/$(HARDWARE_SUB_VARIANT)
  501. else ifeq ($(HARDWARE_VARIANT), Sanguino)
  502. VPATH += $(ARDUINO_INSTALL_DIR)/hardware/marlin/avr/variants/sanguino
  503. else ifeq ($(HARDWARE_VARIANT), archim)
  504. VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/system/libsam
  505. VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/system/CMSIS/CMSIS/Include/
  506. VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/system/CMSIS/Device/ATMEL/
  507. VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/cores/arduino
  508. VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/cores/arduino/avr
  509. VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/cores/arduino/USB
  510. VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/libraries/Wire/src
  511. VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/libraries/SPI/src
  512. VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/libraries/U8glib/src/clib
  513. VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/variants/archim
  514. LDSCRIPT = $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/variants/archim/linker_scripts/gcc/flash.ld
  515. LDLIBS = $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/variants/archim/libsam_sam3x8e_gcc_rel.a
  516. else
  517. HARDWARE_SUB_VARIANT ?= standard
  518. VPATH += $(ARDUINO_INSTALL_DIR)/hardware/$(HARDWARE_VARIANT)/variants/$(HARDWARE_SUB_VARIANT)
  519. endif
  520. LIB_SRC = wiring.c \
  521. wiring_analog.c wiring_digital.c \
  522. wiring_shift.c WInterrupts.c hooks.c
  523. ifeq ($(HARDWARE_VARIANT), archim)
  524. LIB_ASRC += wiring_pulse_asm.S
  525. else
  526. LIB_SRC += wiring_pulse.c
  527. endif
  528. ifeq ($(HARDWARE_VARIANT), Teensy)
  529. LIB_SRC = wiring.c
  530. VPATH += $(ARDUINO_INSTALL_DIR)/hardware/teensy/cores/teensy
  531. endif
  532. LIB_CXXSRC = WMath.cpp WString.cpp Print.cpp SPI.cpp
  533. ifeq ($(NEOPIXEL), 1)
  534. LIB_CXXSRC += Adafruit_NeoPixel.cpp
  535. endif
  536. ifeq ($(LIQUID_TWI2), 0)
  537. LIB_CXXSRC += LiquidCrystal.cpp
  538. else
  539. LIB_SRC += twi.c
  540. LIB_CXXSRC += Wire.cpp LiquidTWI2.cpp
  541. endif
  542. ifeq ($(WIRE), 1)
  543. LIB_SRC += twi.c
  544. LIB_CXXSRC += Wire.cpp
  545. endif
  546. ifeq ($(U8GLIB), 1)
  547. LIB_CXXSRC += U8glib.cpp
  548. LIB_SRC += u8g_ll_api.c u8g_bitmap.c u8g_clip.c u8g_com_null.c u8g_delay.c u8g_page.c u8g_pb.c u8g_pb16h1.c u8g_rect.c u8g_state.c u8g_font.c u8g_font_6x13.c u8g_font_04b_03.c u8g_font_5x8.c
  549. endif
  550. ifeq ($(TMC), 1)
  551. LIB_CXXSRC += TMCStepper.cpp COOLCONF.cpp DRV_STATUS.cpp IHOLD_IRUN.cpp CHOPCONF.cpp GCONF.cpp PWMCONF.cpp DRV_CONF.cpp DRVCONF.cpp DRVCTRL.cpp DRVSTATUS.cpp ENCMODE.cpp RAMP_STAT.cpp SGCSCONF.cpp SHORT_CONF.cpp SMARTEN.cpp SW_MODE.cpp SW_SPI.cpp TMC2130Stepper.cpp TMC2208Stepper.cpp TMC2209Stepper.cpp TMC2660Stepper.cpp TMC5130Stepper.cpp TMC5160Stepper.cpp
  552. endif
  553. ifeq ($(RELOC_WORKAROUND), 1)
  554. LD_PREFIX=-nodefaultlibs
  555. LD_SUFFIX=-lm -lgcc -lc -lgcc
  556. endif
  557. #Check for Arduino 1.0.0 or higher and use the correct source files for that version
  558. ifeq ($(shell [ $(ARDUINO_VERSION) -ge 100 ] && echo true), true)
  559. LIB_CXXSRC += main.cpp
  560. else
  561. LIB_SRC += pins_arduino.c main.c
  562. endif
  563. FORMAT = ihex
  564. # Name of this Makefile (used for "make depend").
  565. MAKEFILE = Makefile
  566. # Debugging format.
  567. # Native formats for AVR-GCC's -g are stabs [default], or dwarf-2.
  568. # AVR (extended) COFF requires stabs, plus an avr-objcopy run.
  569. DEBUG = stabs
  570. OPT = s
  571. DEFINES ?=
  572. # Program settings
  573. CC = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-gcc
  574. CXX = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-g++
  575. OBJCOPY = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-objcopy
  576. OBJDUMP = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-objdump
  577. AR = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-ar
  578. SIZE = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-size
  579. NM = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-nm
  580. AVRDUDE = avrdude
  581. REMOVE = rm -f
  582. MV = mv -f
  583. # Place -D or -U options here
  584. CDEFS = -DF_CPU=$(F_CPU) ${addprefix -D , $(DEFINES)} -DARDUINO=$(ARDUINO_VERSION)
  585. CXXDEFS = $(CDEFS)
  586. ifeq ($(HARDWARE_VARIANT), Teensy)
  587. CDEFS += -DUSB_SERIAL
  588. LIB_SRC += usb.c pins_teensy.c
  589. LIB_CXXSRC += usb_api.cpp
  590. else ifeq ($(HARDWARE_VARIANT), archim)
  591. CDEFS += -DARDUINO_SAM_ARCHIM -DARDUINO_ARCH_SAM -D__SAM3X8E__ -DUSB_VID=0x27b1 -DUSB_PID=0x0001 -DUSBCON '-DUSB_MANUFACTURER="UltiMachine"' '-DUSB_PRODUCT="Archim"'
  592. LIB_CXXSRC += variant.cpp IPAddress.cpp Reset.cpp RingBuffer.cpp Stream.cpp UARTClass.cpp USARTClass.cpp abi.cpp new.cpp watchdog.cpp CDC.cpp PluggableUSB.cpp USBCore.cpp
  593. LIB_SRC += cortex_handlers.c iar_calls_sam3.c syscalls_sam3.c dtostrf.c itoa.c
  594. ifeq ($(U8GLIB), 1)
  595. LIB_SRC += u8g_com_api.c u8g_pb32h1.c
  596. endif
  597. endif
  598. # Add all the source directories as include directories too
  599. CINCS = ${addprefix -I ,${VPATH}}
  600. CXXINCS = ${addprefix -I ,${VPATH}}
  601. # Silence warnings for library code (won't work for .h files, unfortunately)
  602. LIBWARN = -w -Wno-packed-bitfield-compat
  603. # Compiler flag to set the C/CPP Standard level.
  604. CSTANDARD = -std=gnu99
  605. CXXSTANDARD = -std=gnu++11
  606. CDEBUG = -g$(DEBUG)
  607. CWARN = -Wall -Wstrict-prototypes -Wno-packed-bitfield-compat -Wno-pragmas -Wunused-parameter
  608. CXXWARN = -Wall -Wno-packed-bitfield-compat -Wno-pragmas -Wunused-parameter
  609. CTUNING = -fsigned-char -funsigned-bitfields -fpack-struct -fno-exceptions \
  610. -fshort-enums -ffunction-sections -fdata-sections
  611. ifneq ($(HARDWARE_MOTHERBOARD),)
  612. CTUNING += -DMOTHERBOARD=${HARDWARE_MOTHERBOARD}
  613. endif
  614. #CEXTRA = -Wa,-adhlns=$(<:.c=.lst)
  615. CXXEXTRA = -fno-use-cxa-atexit -fno-threadsafe-statics -fno-rtti
  616. CFLAGS := $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CEXTRA) $(CTUNING) $(CSTANDARD)
  617. CXXFLAGS := $(CDEFS) $(CINCS) -O$(OPT) $(CXXEXTRA) $(CTUNING) $(CXXSTANDARD)
  618. ASFLAGS := $(CDEFS)
  619. #ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
  620. ifeq ($(HARDWARE_VARIANT), archim)
  621. LD_PREFIX = -Wl,--gc-sections,-Map,Marlin.ino.map,--cref,--check-sections,--entry=Reset_Handler,--unresolved-symbols=report-all,--warn-common,--warn-section-align
  622. LD_SUFFIX = $(LDLIBS)
  623. LDFLAGS = -lm -T$(LDSCRIPT) -u _sbrk -u link -u _close -u _fstat -u _isatty -u _lseek -u _read -u _write -u _exit -u kill -u _getpid
  624. else
  625. LD_PREFIX = -Wl,--gc-sections,--relax
  626. LDFLAGS = -lm
  627. CTUNING += -flto
  628. endif
  629. # Programming support using avrdude. Settings and variables.
  630. AVRDUDE_PORT = $(UPLOAD_PORT)
  631. AVRDUDE_WRITE_FLASH = -Uflash:w:$(BUILD_DIR)/$(TARGET).hex:i
  632. ifeq ($(shell uname -s), Linux)
  633. AVRDUDE_CONF = /etc/avrdude/avrdude.conf
  634. else
  635. AVRDUDE_CONF = $(ARDUINO_INSTALL_DIR)/hardware/tools/avr/etc/avrdude.conf
  636. endif
  637. AVRDUDE_FLAGS = -D -C$(AVRDUDE_CONF) \
  638. -p$(MCU) -P$(AVRDUDE_PORT) -c$(AVRDUDE_PROGRAMMER) \
  639. -b$(UPLOAD_RATE)
  640. # Since Marlin 2.0, the source files may be distributed into several
  641. # different directories, so it is necessary to find them recursively
  642. SRC = $(shell find src -name '*.c' -type f)
  643. CXXSRC = $(shell find src -name '*.cpp' -type f)
  644. # Define all object files.
  645. OBJ = ${patsubst %.c, $(BUILD_DIR)/arduino/%.o, ${LIB_SRC}}
  646. OBJ += ${patsubst %.cpp, $(BUILD_DIR)/arduino/%.o, ${LIB_CXXSRC}}
  647. OBJ += ${patsubst %.S, $(BUILD_DIR)/arduino/%.o, ${LIB_ASRC}}
  648. OBJ += ${patsubst %.c, $(BUILD_DIR)/%.o, ${SRC}}
  649. OBJ += ${patsubst %.cpp, $(BUILD_DIR)/%.o, ${CXXSRC}}
  650. # Define all listing files.
  651. LST = $(LIB_ASRC:.S=.lst) $(LIB_CXXSRC:.cpp=.lst) $(LIB_SRC:.c=.lst)
  652. # Combine all necessary flags and optional flags.
  653. # Add target processor to flags.
  654. ALL_CFLAGS = $(MCU_FLAGS) $(CPU_FLAGS) $(CFLAGS) -I.
  655. ALL_CXXFLAGS = $(MCU_FLAGS) $(CPU_FLAGS) $(CXXFLAGS)
  656. ALL_ASFLAGS = $(MCU_FLAGS) $(CPU_FLAGS) $(ASFLAGS) -x assembler-with-cpp
  657. # set V=1 (eg, "make V=1") to print the full commands etc.
  658. ifneq ($V,1)
  659. Pecho=@echo
  660. P=@
  661. else
  662. Pecho=@:
  663. P=
  664. endif
  665. # Create required build hierarchy if it does not exist
  666. $(shell mkdir -p $(dir $(OBJ)))
  667. # Default target.
  668. all: sizeafter
  669. build: elf hex bin
  670. elf: $(BUILD_DIR)/$(TARGET).elf
  671. bin: $(BUILD_DIR)/$(TARGET).bin
  672. hex: $(BUILD_DIR)/$(TARGET).hex
  673. eep: $(BUILD_DIR)/$(TARGET).eep
  674. lss: $(BUILD_DIR)/$(TARGET).lss
  675. sym: $(BUILD_DIR)/$(TARGET).sym
  676. # Program the device.
  677. # Do not try to reset an Arduino if it's not one
  678. upload: $(BUILD_DIR)/$(TARGET).hex
  679. ifeq (${AVRDUDE_PROGRAMMER}, arduino)
  680. stty hup < $(UPLOAD_PORT); true
  681. endif
  682. $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH)
  683. ifeq (${AVRDUDE_PROGRAMMER}, arduino)
  684. stty -hup < $(UPLOAD_PORT); true
  685. endif
  686. # Display size of file.
  687. HEXSIZE = $(SIZE) --target=$(FORMAT) $(BUILD_DIR)/$(TARGET).hex
  688. ELFSIZE = $(SIZE) $(SIZE_FLAGS) $(BUILD_DIR)/$(TARGET).elf; \
  689. $(SIZE) $(BUILD_DIR)/$(TARGET).elf
  690. sizebefore:
  691. $P if [ -f $(BUILD_DIR)/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(HEXSIZE); echo; fi
  692. sizeafter: build
  693. $P if [ -f $(BUILD_DIR)/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi
  694. # Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
  695. COFFCONVERT=$(OBJCOPY) --debugging \
  696. --change-section-address .data-0x800000 \
  697. --change-section-address .bss-0x800000 \
  698. --change-section-address .noinit-0x800000 \
  699. --change-section-address .eeprom-0x810000
  700. coff: $(BUILD_DIR)/$(TARGET).elf
  701. $(COFFCONVERT) -O coff-avr $(BUILD_DIR)/$(TARGET).elf $(TARGET).cof
  702. extcoff: $(TARGET).elf
  703. $(COFFCONVERT) -O coff-ext-avr $(BUILD_DIR)/$(TARGET).elf $(TARGET).cof
  704. .SUFFIXES: .elf .hex .eep .lss .sym .bin
  705. .PRECIOUS: .o
  706. .elf.hex:
  707. $(Pecho) " COPY $@"
  708. $P $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
  709. .elf.bin:
  710. $(Pecho) " COPY $@"
  711. $P $(OBJCOPY) -O binary -R .eeprom $< $@
  712. .elf.eep:
  713. -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
  714. --change-section-lma .eeprom=0 -O $(FORMAT) $< $@
  715. # Create extended listing file from ELF output file.
  716. .elf.lss:
  717. $(OBJDUMP) -h -S $< > $@
  718. # Create a symbol table from ELF output file.
  719. .elf.sym:
  720. $(NM) -n $< > $@
  721. # Link: create ELF output file from library.
  722. $(BUILD_DIR)/$(TARGET).elf: $(OBJ) Configuration.h
  723. $(Pecho) " CXX $@"
  724. $P $(CC) $(LD_PREFIX) $(ALL_CXXFLAGS) -o $@ -L. $(OBJ) $(LDFLAGS) $(LD_SUFFIX)
  725. # Object files that were found in "src" will be stored in $(BUILD_DIR)
  726. # in directories that mirror the structure of "src"
  727. $(BUILD_DIR)/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE)
  728. $(Pecho) " CC $<"
  729. $P $(CC) -MMD -c $(ALL_CFLAGS) $(CWARN) $< -o $@
  730. $(BUILD_DIR)/%.o: %.cpp Configuration.h Configuration_adv.h $(MAKEFILE)
  731. $(Pecho) " CXX $<"
  732. $P $(CXX) -MMD -c $(ALL_CXXFLAGS) $(CXXWARN) $< -o $@
  733. # Object files for Arduino libs will be created in $(BUILD_DIR)/arduino
  734. $(BUILD_DIR)/arduino/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE)
  735. $(Pecho) " CC $<"
  736. $P $(CC) -MMD -c $(ALL_CFLAGS) $(LIBWARN) $< -o $@
  737. $(BUILD_DIR)/arduino/%.o: %.cpp Configuration.h Configuration_adv.h $(MAKEFILE)
  738. $(Pecho) " CXX $<"
  739. $P $(CXX) -MMD -c $(ALL_CXXFLAGS) $(LIBWARN) $< -o $@
  740. $(BUILD_DIR)/arduino/%.o: %.S $(MAKEFILE)
  741. $(Pecho) " CXX $<"
  742. $P $(CXX) -MMD -c $(ALL_ASFLAGS) $< -o $@
  743. # Target: clean project.
  744. clean:
  745. $(Pecho) " RMDIR $(BUILD_DIR)/"
  746. $P rm -rf $(BUILD_DIR)
  747. .PHONY: all build elf hex eep lss sym program coff extcoff clean depend sizebefore sizeafter
  748. # Automaticaly include the dependency files created by gcc
  749. -include ${patsubst %.o, %.d, ${OBJ}}