My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148
  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 macOS, 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. Set
  26. # "PROG_MCU" as the AVR part name corresponding to "MCU". You can use the
  27. # following command to get a list of correspondences: `avrdude -c alf -p x`
  28. # Older boards are atmega8 based, newer ones like Arduino Mini, Bluetooth
  29. # or Diecimila have the atmega168. If you're using a LilyPad Arduino,
  30. # change F_CPU to 8000000. If you are using Gen7 electronics, you
  31. # probably need to use 20000000. Either way, you must regenerate
  32. # the speed lookup table with create_speed_lookuptable.py.
  33. #
  34. # 4. Type "make" and press enter to compile/verify your program.
  35. #
  36. # 5. Type "make upload", reset your Arduino board, and press enter to
  37. # upload your program to the Arduino board.
  38. #
  39. # Note that all settings at the top of this file can be overridden from
  40. # the command line with, for example, "make HARDWARE_MOTHERBOARD=71"
  41. #
  42. # To compile for RAMPS (atmega2560) with Arduino 1.6.9 at root/arduino you would use...
  43. #
  44. # make ARDUINO_VERSION=10609 AVR_TOOLS_PATH=/root/arduino/hardware/tools/avr/bin/ \
  45. # HARDWARE_MOTHERBOARD=1200 ARDUINO_INSTALL_DIR=/root/arduino
  46. #
  47. # To compile and upload simply add "upload" to the end of the line...
  48. #
  49. # make ARDUINO_VERSION=10609 AVR_TOOLS_PATH=/root/arduino/hardware/tools/avr/bin/ \
  50. # HARDWARE_MOTHERBOARD=1200 ARDUINO_INSTALL_DIR=/root/arduino upload
  51. #
  52. # If uploading doesn't work try adding the parameter "AVRDUDE_PROGRAMMER=wiring" or
  53. # start upload manually (using stk500) like so:
  54. #
  55. # avrdude -C /root/arduino/hardware/tools/avr/etc/avrdude.conf -v -p m2560 -c stk500 \
  56. # -U flash:w:applet/Marlin.hex:i -P /dev/ttyUSB0
  57. #
  58. # Or, try disconnecting USB to power down and then reconnecting before running avrdude.
  59. #
  60. # This defines the board to compile for (see boards.h for your board's ID)
  61. HARDWARE_MOTHERBOARD ?= 1020
  62. ifeq ($(OS),Windows_NT)
  63. # Windows
  64. ARDUINO_INSTALL_DIR ?= ${HOME}/Arduino
  65. ARDUINO_USER_DIR ?= ${HOME}/Arduino
  66. else
  67. UNAME_S := $(shell uname -s)
  68. ifeq ($(UNAME_S),Linux)
  69. # Linux
  70. ARDUINO_INSTALL_DIR ?= /usr/share/arduino
  71. ARDUINO_USER_DIR ?= ${HOME}/Arduino
  72. endif
  73. ifeq ($(UNAME_S),Darwin)
  74. # Darwin (macOS)
  75. ARDUINO_INSTALL_DIR ?= /Applications/Arduino.app/Contents/Java
  76. ARDUINO_USER_DIR ?= ${HOME}/Documents/Arduino
  77. AVR_TOOLS_PATH ?= /Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/
  78. endif
  79. endif
  80. # Arduino source install directory, and version number
  81. # On most linuxes this will be /usr/share/arduino
  82. ARDUINO_INSTALL_DIR ?= ${HOME}/Arduino
  83. ARDUINO_VERSION ?= 106
  84. # The installed Libraries are in the User folder
  85. ARDUINO_USER_DIR ?= ${HOME}/Arduino
  86. # You can optionally set a path to the avr-gcc tools.
  87. # Requires a trailing slash. For example, /usr/local/avr-gcc/bin/
  88. AVR_TOOLS_PATH ?=
  89. # Programmer configuration
  90. UPLOAD_RATE ?= 57600
  91. AVRDUDE_PROGRAMMER ?= arduino
  92. # On most linuxes this will be /dev/ttyACM0 or /dev/ttyACM1
  93. UPLOAD_PORT ?= /dev/ttyUSB0
  94. # Directory used to build files in, contains all the build files, from object
  95. # files to the final hex file on linux it is best to put an absolute path
  96. # like /home/username/tmp .
  97. BUILD_DIR ?= applet
  98. # This defines whether Liquid_TWI2 support will be built
  99. LIQUID_TWI2 ?= 0
  100. # This defines if Wire is needed
  101. WIRE ?= 0
  102. # This defines if Tone is needed (i.e SPEAKER is defined in Configuration.h)
  103. # Disabling this (and SPEAKER) saves approximately 350 bytes of memory.
  104. TONE ?= 1
  105. # This defines if U8GLIB is needed (may require RELOC_WORKAROUND)
  106. U8GLIB ?= 0
  107. # This defines whether to include the Trinamic TMCStepper library
  108. TMC ?= 0
  109. # This defines whether to include the AdaFruit NeoPixel library
  110. NEOPIXEL ?= 0
  111. ############
  112. # Try to automatically determine whether RELOC_WORKAROUND is needed based
  113. # on GCC versions:
  114. # https://www.avrfreaks.net/comment/1789106#comment-1789106
  115. CC_MAJ:=$(shell $(CC) -dM -E - < /dev/null | grep __GNUC__ | cut -f3 -d\ )
  116. CC_MIN:=$(shell $(CC) -dM -E - < /dev/null | grep __GNUC_MINOR__ | cut -f3 -d\ )
  117. CC_PATCHLEVEL:=$(shell $(CC) -dM -E - < /dev/null | grep __GNUC_PATCHLEVEL__ | cut -f3 -d\ )
  118. CC_VER:=$(shell echo $$(( $(CC_MAJ) * 10000 + $(CC_MIN) * 100 + $(CC_PATCHLEVEL) )))
  119. ifeq ($(shell test $(CC_VER) -lt 40901 && echo 1),1)
  120. @echo This version of GCC is likely broken. Enabling relocation workaround.
  121. RELOC_WORKAROUND = 1
  122. endif
  123. ############################################################################
  124. # Below here nothing should be changed...
  125. # Here the Arduino variant is selected by the board type
  126. # HARDWARE_VARIANT = "arduino", "Sanguino", "Gen7", ...
  127. # MCU = "atmega1280", "Mega2560", "atmega2560", "atmega644p", ...
  128. ifeq ($(HARDWARE_MOTHERBOARD),0)
  129. # No motherboard selected
  130. #
  131. # RAMPS 1.3 / 1.4 - ATmega1280, ATmega2560
  132. #
  133. # MEGA/RAMPS up to 1.2
  134. else ifeq ($(HARDWARE_MOTHERBOARD),1000)
  135. # RAMPS 1.3 (Power outputs: Hotend, Fan, Bed)
  136. else ifeq ($(HARDWARE_MOTHERBOARD),1010)
  137. # RAMPS 1.3 (Power outputs: Hotend0, Hotend1, Bed)
  138. else ifeq ($(HARDWARE_MOTHERBOARD),1011)
  139. # RAMPS 1.3 (Power outputs: Hotend, Fan0, Fan1)
  140. else ifeq ($(HARDWARE_MOTHERBOARD),1012)
  141. # RAMPS 1.3 (Power outputs: Hotend0, Hotend1, Fan)
  142. else ifeq ($(HARDWARE_MOTHERBOARD),1013)
  143. # RAMPS 1.3 (Power outputs: Spindle, Controller Fan)
  144. else ifeq ($(HARDWARE_MOTHERBOARD),1014)
  145. # RAMPS 1.4 (Power outputs: Hotend, Fan, Bed)
  146. else ifeq ($(HARDWARE_MOTHERBOARD),1020)
  147. # RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Bed)
  148. else ifeq ($(HARDWARE_MOTHERBOARD),1021)
  149. # RAMPS 1.4 (Power outputs: Hotend, Fan0, Fan1)
  150. else ifeq ($(HARDWARE_MOTHERBOARD),1022)
  151. # RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Fan)
  152. else ifeq ($(HARDWARE_MOTHERBOARD),1023)
  153. # RAMPS 1.4 (Power outputs: Spindle, Controller Fan)
  154. else ifeq ($(HARDWARE_MOTHERBOARD),1024)
  155. # RAMPS Plus 3DYMY (Power outputs: Hotend, Fan, Bed)
  156. else ifeq ($(HARDWARE_MOTHERBOARD),1030)
  157. # RAMPS Plus 3DYMY (Power outputs: Hotend0, Hotend1, Bed)
  158. else ifeq ($(HARDWARE_MOTHERBOARD),1031)
  159. # RAMPS Plus 3DYMY (Power outputs: Hotend, Fan0, Fan1)
  160. else ifeq ($(HARDWARE_MOTHERBOARD),1032)
  161. # RAMPS Plus 3DYMY (Power outputs: Hotend0, Hotend1, Fan)
  162. else ifeq ($(HARDWARE_MOTHERBOARD),1033)
  163. # RAMPS Plus 3DYMY (Power outputs: Spindle, Controller Fan)
  164. else ifeq ($(HARDWARE_MOTHERBOARD),1034)
  165. #
  166. # RAMPS Derivatives - ATmega1280, ATmega2560
  167. #
  168. # 3Drag Controller
  169. else ifeq ($(HARDWARE_MOTHERBOARD),1100)
  170. # Velleman K8200 Controller (derived from 3Drag Controller)
  171. else ifeq ($(HARDWARE_MOTHERBOARD),1101)
  172. # Velleman K8400 Controller (derived from 3Drag Controller)
  173. else ifeq ($(HARDWARE_MOTHERBOARD),1102)
  174. # Velleman K8600 Controller (Vertex Nano)
  175. else ifeq ($(HARDWARE_MOTHERBOARD),1103)
  176. # Velleman K8800 Controller (Vertex Delta)
  177. else ifeq ($(HARDWARE_MOTHERBOARD),1104)
  178. # 2PrintBeta BAM&DICE with STK drivers
  179. else ifeq ($(HARDWARE_MOTHERBOARD),1105)
  180. # 2PrintBeta BAM&DICE Due with STK drivers
  181. else ifeq ($(HARDWARE_MOTHERBOARD),1106)
  182. # MKS BASE v1.0
  183. else ifeq ($(HARDWARE_MOTHERBOARD),1107)
  184. # MKS BASE v1.4 with Allegro A4982 stepper drivers
  185. else ifeq ($(HARDWARE_MOTHERBOARD),1108)
  186. # MKS BASE v1.5 with Allegro A4982 stepper drivers
  187. else ifeq ($(HARDWARE_MOTHERBOARD),1109)
  188. # MKS BASE v1.6 with Allegro A4982 stepper drivers
  189. else ifeq ($(HARDWARE_MOTHERBOARD),1110)
  190. # MKS BASE 1.0 with Heroic HR4982 stepper drivers
  191. else ifeq ($(HARDWARE_MOTHERBOARD),1111)
  192. # MKS GEN v1.3 or 1.4
  193. else ifeq ($(HARDWARE_MOTHERBOARD),1112)
  194. # MKS GEN L
  195. else ifeq ($(HARDWARE_MOTHERBOARD),1113)
  196. # BigTreeTech or BIQU KFB2.0
  197. else ifeq ($(HARDWARE_MOTHERBOARD),1114)
  198. # zrib V2.0 (Chinese RAMPS replica)
  199. else ifeq ($(HARDWARE_MOTHERBOARD),1115)
  200. # zrib V5.2 (Chinese RAMPS replica)
  201. else ifeq ($(HARDWARE_MOTHERBOARD),1116)
  202. # Felix 2.0+ Electronics Board (RAMPS like)
  203. else ifeq ($(HARDWARE_MOTHERBOARD),1117)
  204. # Invent-A-Part RigidBoard
  205. else ifeq ($(HARDWARE_MOTHERBOARD),1118)
  206. # Invent-A-Part RigidBoard V2
  207. else ifeq ($(HARDWARE_MOTHERBOARD),1119)
  208. # Sainsmart 2-in-1 board
  209. else ifeq ($(HARDWARE_MOTHERBOARD),1120)
  210. # Ultimaker
  211. else ifeq ($(HARDWARE_MOTHERBOARD),1121)
  212. # Ultimaker (Older electronics. Pre 1.5.4. This is rare)
  213. else ifeq ($(HARDWARE_MOTHERBOARD),1122)
  214. MCU ?= atmega1280
  215. PROG_MCU ?= m1280
  216. # Azteeg X3
  217. else ifeq ($(HARDWARE_MOTHERBOARD),1123)
  218. # Azteeg X3 Pro
  219. else ifeq ($(HARDWARE_MOTHERBOARD),1124)
  220. # Ultimainboard 2.x (Uses TEMP_SENSOR 20)
  221. else ifeq ($(HARDWARE_MOTHERBOARD),1125)
  222. # Rumba
  223. else ifeq ($(HARDWARE_MOTHERBOARD),1126)
  224. # Raise3D N series Rumba derivative
  225. else ifeq ($(HARDWARE_MOTHERBOARD),1127)
  226. # Rapide Lite 200 (v1, low-cost RUMBA clone with drv)
  227. else ifeq ($(HARDWARE_MOTHERBOARD),1128)
  228. # Formbot T-Rex 2 Plus
  229. else ifeq ($(HARDWARE_MOTHERBOARD),1129)
  230. # Formbot T-Rex 3
  231. else ifeq ($(HARDWARE_MOTHERBOARD),1130)
  232. # Formbot Raptor
  233. else ifeq ($(HARDWARE_MOTHERBOARD),1131)
  234. # Formbot Raptor 2
  235. else ifeq ($(HARDWARE_MOTHERBOARD),1132)
  236. # bq ZUM Mega 3D
  237. else ifeq ($(HARDWARE_MOTHERBOARD),1133)
  238. # MakeBoard Mini v2.1.2 by MicroMake
  239. else ifeq ($(HARDWARE_MOTHERBOARD),1134)
  240. # TriGorilla Anycubic version 1.3-based on RAMPS EFB
  241. else ifeq ($(HARDWARE_MOTHERBOARD),1135)
  242. # ... Ver 1.4
  243. else ifeq ($(HARDWARE_MOTHERBOARD),1136)
  244. # ... Rev 1.1 (new servo pin order)
  245. else ifeq ($(HARDWARE_MOTHERBOARD),1137)
  246. # Creality: Ender-4, CR-8
  247. else ifeq ($(HARDWARE_MOTHERBOARD),1138)
  248. # Creality: CR10S, CR20, CR-X
  249. else ifeq ($(HARDWARE_MOTHERBOARD),1139)
  250. # Dagoma F5
  251. else ifeq ($(HARDWARE_MOTHERBOARD),1140)
  252. # FYSETC F6 1.3
  253. else ifeq ($(HARDWARE_MOTHERBOARD),1141)
  254. # FYSETC F6 1.4
  255. else ifeq ($(HARDWARE_MOTHERBOARD),1142)
  256. # Wanhao Duplicator i3 Plus
  257. else ifeq ($(HARDWARE_MOTHERBOARD),1143)
  258. # VORON Design
  259. else ifeq ($(HARDWARE_MOTHERBOARD),1144)
  260. # Tronxy TRONXY-V3-1.0
  261. else ifeq ($(HARDWARE_MOTHERBOARD),1145)
  262. # Z-Bolt X Series
  263. else ifeq ($(HARDWARE_MOTHERBOARD),1146)
  264. # TT OSCAR
  265. else ifeq ($(HARDWARE_MOTHERBOARD),1147)
  266. # Overlord/Overlord Pro
  267. else ifeq ($(HARDWARE_MOTHERBOARD),1148)
  268. # ADIMLab Gantry v1
  269. else ifeq ($(HARDWARE_MOTHERBOARD),1149)
  270. # ADIMLab Gantry v2
  271. else ifeq ($(HARDWARE_MOTHERBOARD),1150)
  272. # BIQU Tango V1
  273. else ifeq ($(HARDWARE_MOTHERBOARD),1151)
  274. # MKS GEN L V2
  275. else ifeq ($(HARDWARE_MOTHERBOARD),1152)
  276. # MKS GEN L V2.1
  277. else ifeq ($(HARDWARE_MOTHERBOARD),1153)
  278. # Copymaster 3D
  279. else ifeq ($(HARDWARE_MOTHERBOARD),1154)
  280. # Ortur 4
  281. else ifeq ($(HARDWARE_MOTHERBOARD),1155)
  282. # Tenlog D3 Hero IDEX printer
  283. else ifeq ($(HARDWARE_MOTHERBOARD),1156)
  284. # Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Fan, Bed)
  285. else ifeq ($(HARDWARE_MOTHERBOARD),1157)
  286. # Ramps S 1.2 by Sakul.cz (Power outputs: Hotend0, Hotend1, Hotend2, Bed)
  287. else ifeq ($(HARDWARE_MOTHERBOARD),1158)
  288. # Ramps S 1.2 by Sakul.cz (Power outputs: Hotend, Fan0, Fan1, Bed)
  289. else ifeq ($(HARDWARE_MOTHERBOARD),1159)
  290. # Longer LK1 PRO / Alfawise U20 Pro (PRO version)
  291. else ifeq ($(HARDWARE_MOTHERBOARD),1160)
  292. # Longer LKx PRO / Alfawise Uxx Pro (PRO version)
  293. else ifeq ($(HARDWARE_MOTHERBOARD),1161)
  294. # 3Drag Controller
  295. else ifeq ($(HARDWARE_MOTHERBOARD),1100)
  296. # Velleman K8200 Controller (derived from 3Drag Controller)
  297. else ifeq ($(HARDWARE_MOTHERBOARD),1101)
  298. # Velleman K8400 Controller (derived from 3Drag Controller)
  299. else ifeq ($(HARDWARE_MOTHERBOARD),1102)
  300. # Velleman K8600 Controller (Vertex Nano)
  301. else ifeq ($(HARDWARE_MOTHERBOARD),1103)
  302. # Velleman K8800 Controller (Vertex Delta)
  303. else ifeq ($(HARDWARE_MOTHERBOARD),1104)
  304. # 2PrintBeta BAM&DICE with STK drivers
  305. else ifeq ($(HARDWARE_MOTHERBOARD),1105)
  306. # 2PrintBeta BAM&DICE Due with STK drivers
  307. else ifeq ($(HARDWARE_MOTHERBOARD),1106)
  308. # MKS BASE v1.0
  309. else ifeq ($(HARDWARE_MOTHERBOARD),1107)
  310. # MKS v1.4 with A4982 stepper drivers
  311. else ifeq ($(HARDWARE_MOTHERBOARD),1108)
  312. # MKS v1.5 with Allegro A4982 stepper drivers
  313. else ifeq ($(HARDWARE_MOTHERBOARD),1109)
  314. # MKS v1.6 with Allegro A4982 stepper drivers
  315. else ifeq ($(HARDWARE_MOTHERBOARD),1110)
  316. # MKS BASE 1.0 with Heroic HR4982 stepper drivers
  317. else ifeq ($(HARDWARE_MOTHERBOARD),1111)
  318. # MKS GEN v1.3 or 1.4
  319. else ifeq ($(HARDWARE_MOTHERBOARD),1112)
  320. # MKS GEN L
  321. else ifeq ($(HARDWARE_MOTHERBOARD),1113)
  322. # zrib V2.0 control board (Chinese RAMPS replica)
  323. else ifeq ($(HARDWARE_MOTHERBOARD),1114)
  324. # BigTreeTech or BIQU KFB2.0
  325. else ifeq ($(HARDWARE_MOTHERBOARD),1115)
  326. # Felix 2.0+ Electronics Board (RAMPS like)
  327. else ifeq ($(HARDWARE_MOTHERBOARD),1116)
  328. # Invent-A-Part RigidBoard
  329. else ifeq ($(HARDWARE_MOTHERBOARD),1117)
  330. # Invent-A-Part RigidBoard V2
  331. else ifeq ($(HARDWARE_MOTHERBOARD),1118)
  332. # Sainsmart 2-in-1 board
  333. else ifeq ($(HARDWARE_MOTHERBOARD),1119)
  334. # Ultimaker
  335. else ifeq ($(HARDWARE_MOTHERBOARD),1120)
  336. # Ultimaker (Older electronics. Pre 1.5.4. This is rare)
  337. else ifeq ($(HARDWARE_MOTHERBOARD),1121)
  338. MCU ?= atmega1280
  339. PROG_MCU ?= m1280
  340. # Azteeg X3
  341. else ifeq ($(HARDWARE_MOTHERBOARD),1122)
  342. # Azteeg X3 Pro
  343. else ifeq ($(HARDWARE_MOTHERBOARD),1123)
  344. # Ultimainboard 2.x (Uses TEMP_SENSOR 20)
  345. else ifeq ($(HARDWARE_MOTHERBOARD),1124)
  346. # Rumba
  347. else ifeq ($(HARDWARE_MOTHERBOARD),1125)
  348. # Raise3D Rumba
  349. else ifeq ($(HARDWARE_MOTHERBOARD),1126)
  350. # Rapide Lite RL200 Rumba
  351. else ifeq ($(HARDWARE_MOTHERBOARD),1127)
  352. # Formbot T-Rex 2 Plus
  353. else ifeq ($(HARDWARE_MOTHERBOARD),1128)
  354. # Formbot T-Rex 3
  355. else ifeq ($(HARDWARE_MOTHERBOARD),1129)
  356. # Formbot Raptor
  357. else ifeq ($(HARDWARE_MOTHERBOARD),1130)
  358. # Formbot Raptor 2
  359. else ifeq ($(HARDWARE_MOTHERBOARD),1131)
  360. # bq ZUM Mega 3D
  361. else ifeq ($(HARDWARE_MOTHERBOARD),1132)
  362. # MakeBoard Mini v2.1.2 is a control board sold by MicroMake
  363. else ifeq ($(HARDWARE_MOTHERBOARD),1133)
  364. # TriGorilla Anycubic version 1.3 based on RAMPS EFB
  365. else ifeq ($(HARDWARE_MOTHERBOARD),1134)
  366. # TriGorilla Anycubic version 1.4 based on RAMPS EFB
  367. else ifeq ($(HARDWARE_MOTHERBOARD),1135)
  368. # TriGorilla Anycubic version 1.4 Rev 1.1
  369. else ifeq ($(HARDWARE_MOTHERBOARD),1136)
  370. # Creality: Ender-4, CR-8
  371. else ifeq ($(HARDWARE_MOTHERBOARD),1137)
  372. # Creality: CR10S, CR20, CR-X
  373. else ifeq ($(HARDWARE_MOTHERBOARD),1138)
  374. # Dagoma F5
  375. else ifeq ($(HARDWARE_MOTHERBOARD),1139)
  376. # FYSETC F6 1.3
  377. else ifeq ($(HARDWARE_MOTHERBOARD),1140)
  378. # FYSETC F6 1.5
  379. else ifeq ($(HARDWARE_MOTHERBOARD),1141)
  380. # Duplicator i3 Plus
  381. else ifeq ($(HARDWARE_MOTHERBOARD),1142)
  382. # VORON
  383. else ifeq ($(HARDWARE_MOTHERBOARD),1143)
  384. # TRONXY V3 1.0
  385. else ifeq ($(HARDWARE_MOTHERBOARD),1144)
  386. # Z-Bolt X Series
  387. else ifeq ($(HARDWARE_MOTHERBOARD),1145)
  388. # TT OSCAR
  389. else ifeq ($(HARDWARE_MOTHERBOARD),1146)
  390. # Overlord/Overlord Pro
  391. else ifeq ($(HARDWARE_MOTHERBOARD),1147)
  392. # ADIMLab Gantry v1
  393. else ifeq ($(HARDWARE_MOTHERBOARD),1148)
  394. # ADIMLab Gantry v2
  395. else ifeq ($(HARDWARE_MOTHERBOARD),1149)
  396. # BIQU Tango V1
  397. else ifeq ($(HARDWARE_MOTHERBOARD),1150)
  398. # MKS GEN L V2
  399. else ifeq ($(HARDWARE_MOTHERBOARD),1151)
  400. # MKS GEN L V2.1
  401. else ifeq ($(HARDWARE_MOTHERBOARD),1152)
  402. # Copymaster 3D
  403. else ifeq ($(HARDWARE_MOTHERBOARD),1153)
  404. # Ortur 4
  405. else ifeq ($(HARDWARE_MOTHERBOARD),1154)
  406. # Tenlog D3 Hero
  407. else ifeq ($(HARDWARE_MOTHERBOARD),1155)
  408. #
  409. # RAMBo and derivatives
  410. #
  411. # Rambo
  412. else ifeq ($(HARDWARE_MOTHERBOARD),1200)
  413. # Mini-Rambo
  414. else ifeq ($(HARDWARE_MOTHERBOARD),1201)
  415. # Mini-Rambo 1.0a
  416. else ifeq ($(HARDWARE_MOTHERBOARD),1202)
  417. # Einsy Rambo
  418. else ifeq ($(HARDWARE_MOTHERBOARD),1203)
  419. # Einsy Retro
  420. else ifeq ($(HARDWARE_MOTHERBOARD),1204)
  421. # abee Scoovo X9H
  422. else ifeq ($(HARDWARE_MOTHERBOARD),1205)
  423. # Rambo ThinkerV2
  424. else ifeq ($(HARDWARE_MOTHERBOARD),1206)
  425. #
  426. # Other ATmega1280, ATmega2560
  427. #
  428. # Cartesio CN Controls V11
  429. else ifeq ($(HARDWARE_MOTHERBOARD),1300)
  430. # Cartesio CN Controls V12
  431. else ifeq ($(HARDWARE_MOTHERBOARD),1301)
  432. # Cartesio CN Controls V15
  433. else ifeq ($(HARDWARE_MOTHERBOARD),1302)
  434. # Cheaptronic v1.0
  435. else ifeq ($(HARDWARE_MOTHERBOARD),1303)
  436. # Cheaptronic v2.0
  437. else ifeq ($(HARDWARE_MOTHERBOARD),1304)
  438. # Makerbot Mightyboard Revision E
  439. else ifeq ($(HARDWARE_MOTHERBOARD),1305)
  440. # Megatronics
  441. else ifeq ($(HARDWARE_MOTHERBOARD),1306)
  442. # Megatronics v2.0
  443. else ifeq ($(HARDWARE_MOTHERBOARD),1307)
  444. # Megatronics v3.0
  445. else ifeq ($(HARDWARE_MOTHERBOARD),1308)
  446. # Megatronics v3.1
  447. else ifeq ($(HARDWARE_MOTHERBOARD),1309)
  448. # Megatronics v3.2
  449. else ifeq ($(HARDWARE_MOTHERBOARD),1310)
  450. # Elefu Ra Board (v3)
  451. else ifeq ($(HARDWARE_MOTHERBOARD),1311)
  452. # Leapfrog
  453. else ifeq ($(HARDWARE_MOTHERBOARD),1312)
  454. # Mega controller
  455. else ifeq ($(HARDWARE_MOTHERBOARD),1313)
  456. # Geeetech GT2560 Rev A
  457. else ifeq ($(HARDWARE_MOTHERBOARD),1314)
  458. # Geeetech GT2560 Rev A+ (with auto level probe)
  459. else ifeq ($(HARDWARE_MOTHERBOARD),1315)
  460. # Geeetech GT2560 Rev B
  461. else ifeq ($(HARDWARE_MOTHERBOARD),1316)
  462. # Geeetech GT2560 Rev B for A10(M/T/D)
  463. else ifeq ($(HARDWARE_MOTHERBOARD),1317)
  464. # Geeetech GT2560 Rev B for A10(M/T/D)
  465. else ifeq ($(HARDWARE_MOTHERBOARD),1318)
  466. # Geeetech GT2560 Rev B for Mecreator2
  467. else ifeq ($(HARDWARE_MOTHERBOARD),1319)
  468. # Geeetech GT2560 Rev B for A20(M/T/D)
  469. else ifeq ($(HARDWARE_MOTHERBOARD),1320)
  470. # Einstart retrofit
  471. else ifeq ($(HARDWARE_MOTHERBOARD),1321)
  472. # Wanhao 0ne+ i3 Mini
  473. else ifeq ($(HARDWARE_MOTHERBOARD),1322)
  474. # Leapfrog Xeed 2015
  475. else ifeq ($(HARDWARE_MOTHERBOARD),1323)
  476. # PICA Shield (original version)
  477. else ifeq ($(HARDWARE_MOTHERBOARD),1324)
  478. # PICA Shield (rev C or later)
  479. else ifeq ($(HARDWARE_MOTHERBOARD),1325)
  480. # Intamsys 4.0 (Funmat HT)
  481. else ifeq ($(HARDWARE_MOTHERBOARD),1326)
  482. # Malyan M180 Mainboard Version 2 (no display function, direct gcode only)
  483. else ifeq ($(HARDWARE_MOTHERBOARD),1327)
  484. # Geeetech GT2560 Rev B for A20(M/T/D)
  485. else ifeq ($(HARDWARE_MOTHERBOARD),1328)
  486. # Mega controller & Protoneer CNC Shield V3.00
  487. else ifeq ($(HARDWARE_MOTHERBOARD),1329)
  488. #
  489. # ATmega1281, ATmega2561
  490. #
  491. # Minitronics v1.0/1.1
  492. else ifeq ($(HARDWARE_MOTHERBOARD),1400)
  493. MCU ?= atmega1281
  494. PROG_MCU ?= m1281
  495. # Silvergate v1.0
  496. else ifeq ($(HARDWARE_MOTHERBOARD),1401)
  497. MCU ?= atmega1281
  498. PROG_MCU ?= m1281
  499. #
  500. # Sanguinololu and Derivatives - ATmega644P, ATmega1284P
  501. #
  502. # Sanguinololu < 1.2
  503. else ifeq ($(HARDWARE_MOTHERBOARD),1500)
  504. HARDWARE_VARIANT ?= Sanguino
  505. MCU ?= atmega644p
  506. PROG_MCU ?= m644p
  507. # Sanguinololu 1.2 and above
  508. else ifeq ($(HARDWARE_MOTHERBOARD),1501)
  509. HARDWARE_VARIANT ?= Sanguino
  510. MCU ?= atmega644p
  511. PROG_MCU ?= m644p
  512. # Melzi
  513. else ifeq ($(HARDWARE_MOTHERBOARD),1502)
  514. HARDWARE_VARIANT ?= Sanguino
  515. MCU ?= atmega644p
  516. PROG_MCU ?= m644p
  517. # Melzi V2.0
  518. else ifeq ($(HARDWARE_MOTHERBOARD),1503)
  519. HARDWARE_VARIANT ?= Sanguino
  520. MCU ?= atmega1284p
  521. PROG_MCU ?= m1284p
  522. # Melzi with ATmega1284 (MaKr3d version)
  523. else ifeq ($(HARDWARE_MOTHERBOARD),1504)
  524. HARDWARE_VARIANT ?= Sanguino
  525. MCU ?= atmega1284p
  526. PROG_MCU ?= m1284p
  527. # Melzi Creality3D board (for CR-10 etc)
  528. else ifeq ($(HARDWARE_MOTHERBOARD),1505)
  529. HARDWARE_VARIANT ?= Sanguino
  530. MCU ?= atmega1284p
  531. PROG_MCU ?= m1284p
  532. # Melzi Malyan M150 board
  533. else ifeq ($(HARDWARE_MOTHERBOARD),1506)
  534. HARDWARE_VARIANT ?= Sanguino
  535. MCU ?= atmega1284p
  536. PROG_MCU ?= m1284p
  537. # Tronxy X5S
  538. else ifeq ($(HARDWARE_MOTHERBOARD),1507)
  539. HARDWARE_VARIANT ?= Sanguino
  540. MCU ?= atmega1284p
  541. PROG_MCU ?= m1284p
  542. # STB V1.1
  543. else ifeq ($(HARDWARE_MOTHERBOARD),1508)
  544. HARDWARE_VARIANT ?= Sanguino
  545. MCU ?= atmega1284p
  546. PROG_MCU ?= m1284p
  547. # Azteeg X1
  548. else ifeq ($(HARDWARE_MOTHERBOARD),1509)
  549. HARDWARE_VARIANT ?= Sanguino
  550. MCU ?= atmega1284p
  551. PROG_MCU ?= m1284p
  552. # Anet 1.0 (Melzi clone)
  553. else ifeq ($(HARDWARE_MOTHERBOARD),1510)
  554. HARDWARE_VARIANT ?= Sanguino
  555. MCU ?= atmega1284p
  556. PROG_MCU ?= m1284p
  557. # ZoneStar ZMIB V2
  558. else ifeq ($(HARDWARE_MOTHERBOARD),1511)
  559. HARDWARE_VARIANT ?= Sanguino
  560. MCU ?= atmega1284p
  561. PROG_MCU ?= m1284p
  562. #
  563. # Other ATmega644P, ATmega644, ATmega1284P
  564. #
  565. # Gen3 Monolithic Electronics
  566. else ifeq ($(HARDWARE_MOTHERBOARD),1600)
  567. HARDWARE_VARIANT ?= Sanguino
  568. MCU ?= atmega644p
  569. PROG_MCU ?= m644p
  570. # Gen3+
  571. else ifeq ($(HARDWARE_MOTHERBOARD),1601)
  572. HARDWARE_VARIANT ?= Sanguino
  573. MCU ?= atmega644p
  574. PROG_MCU ?= m644p
  575. # Gen6
  576. else ifeq ($(HARDWARE_MOTHERBOARD),1602)
  577. HARDWARE_VARIANT ?= Gen6
  578. MCU ?= atmega644p
  579. PROG_MCU ?= m644p
  580. # Gen6 deluxe
  581. else ifeq ($(HARDWARE_MOTHERBOARD),1603)
  582. HARDWARE_VARIANT ?= Gen6
  583. MCU ?= atmega644p
  584. PROG_MCU ?= m644p
  585. # Gen7 custom (Alfons3 Version)
  586. else ifeq ($(HARDWARE_MOTHERBOARD),1604)
  587. HARDWARE_VARIANT ?= Gen7
  588. MCU ?= atmega644
  589. PROG_MCU ?= m644
  590. F_CPU ?= 20000000
  591. # Gen7 v1.1, v1.2
  592. else ifeq ($(HARDWARE_MOTHERBOARD),1605)
  593. HARDWARE_VARIANT ?= Gen7
  594. MCU ?= atmega644p
  595. PROG_MCU ?= m644p
  596. F_CPU ?= 20000000
  597. # Gen7 v1.3
  598. else ifeq ($(HARDWARE_MOTHERBOARD),1606)
  599. HARDWARE_VARIANT ?= Gen7
  600. MCU ?= atmega644p
  601. PROG_MCU ?= m644p
  602. F_CPU ?= 20000000
  603. # Gen7 v1.4
  604. else ifeq ($(HARDWARE_MOTHERBOARD),1607)
  605. HARDWARE_VARIANT ?= Gen7
  606. MCU ?= atmega1284p
  607. PROG_MCU ?= m1284p
  608. F_CPU ?= 20000000
  609. # Alpha OMCA board
  610. else ifeq ($(HARDWARE_MOTHERBOARD),1608)
  611. HARDWARE_VARIANT ?= SanguinoA
  612. MCU ?= atmega644
  613. PROG_MCU ?= m644
  614. # Final OMCA board
  615. else ifeq ($(HARDWARE_MOTHERBOARD),1609)
  616. HARDWARE_VARIANT ?= Sanguino
  617. MCU ?= atmega644p
  618. PROG_MCU ?= m644p
  619. # Sethi 3D_1
  620. else ifeq ($(HARDWARE_MOTHERBOARD),1610)
  621. HARDWARE_VARIANT ?= Sanguino
  622. MCU ?= atmega644p
  623. PROG_MCU ?= m644p
  624. #
  625. # Teensyduino - AT90USB1286, AT90USB1286P
  626. #
  627. # Teensylu
  628. else ifeq ($(HARDWARE_MOTHERBOARD),1700)
  629. HARDWARE_VARIANT ?= Teensy
  630. MCU ?= at90usb1286
  631. PROG_MCU ?= usb1286
  632. # Printrboard (AT90USB1286)
  633. else ifeq ($(HARDWARE_MOTHERBOARD),1701)
  634. HARDWARE_VARIANT ?= Teensy
  635. MCU ?= at90usb1286
  636. PROG_MCU ?= usb1286
  637. # Printrboard Revision F (AT90USB1286)
  638. else ifeq ($(HARDWARE_MOTHERBOARD),1702)
  639. HARDWARE_VARIANT ?= Teensy
  640. MCU ?= at90usb1286
  641. PROG_MCU ?= usb1286
  642. # Brainwave (AT90USB646)
  643. else ifeq ($(HARDWARE_MOTHERBOARD),1703)
  644. HARDWARE_VARIANT ?= Teensy
  645. MCU ?= at90usb646
  646. PROG_MCU ?= usb646
  647. # Brainwave Pro (AT90USB1286)
  648. else ifeq ($(HARDWARE_MOTHERBOARD),1704)
  649. HARDWARE_VARIANT ?= Teensy
  650. MCU ?= at90usb1286
  651. PROG_MCU ?= usb1286
  652. # SAV Mk-I (AT90USB1286)
  653. else ifeq ($(HARDWARE_MOTHERBOARD),1705)
  654. HARDWARE_VARIANT ?= Teensy
  655. MCU ?= at90usb1286
  656. PROG_MCU ?= usb1286
  657. # Teensy++2.0 (AT90USB1286)
  658. else ifeq ($(HARDWARE_MOTHERBOARD),1706)
  659. HARDWARE_VARIANT ?= Teensy
  660. MCU ?= at90usb1286
  661. PROG_MCU ?= usb1286
  662. # 5DPrint D8 Driver Board
  663. else ifeq ($(HARDWARE_MOTHERBOARD),1707)
  664. HARDWARE_VARIANT ?= Teensy
  665. MCU ?= at90usb1286
  666. PROG_MCU ?= usb1286
  667. # UltiMachine Archim1 (with DRV8825 drivers)
  668. else ifeq ($(HARDWARE_MOTHERBOARD),3023)
  669. HARDWARE_VARIANT ?= archim
  670. MCPU = cortex-m3
  671. F_CPU = 84000000
  672. IS_MCU = 0
  673. # UltiMachine Archim2 (with TMC2130 drivers)
  674. else ifeq ($(HARDWARE_MOTHERBOARD),3024)
  675. HARDWARE_VARIANT ?= archim
  676. MCPU = cortex-m3
  677. F_CPU = 84000000
  678. IS_MCU = 0
  679. endif
  680. # Be sure to regenerate speed_lookuptable.h with create_speed_lookuptable.py
  681. # if you are setting this to something other than 16MHz
  682. # Do not put the UL suffix, it's done later on.
  683. # Set to 16Mhz if not yet set.
  684. F_CPU ?= 16000000
  685. # Set to microcontroller if IS_MCU not yet set
  686. IS_MCU ?= 1
  687. ifeq ($(IS_MCU),1)
  688. # Set to arduino, ATmega2560 if not yet set.
  689. HARDWARE_VARIANT ?= arduino
  690. MCU ?= atmega2560
  691. PROG_MCU ?= m2560
  692. TOOL_PREFIX = avr
  693. MCU_FLAGS = -mmcu=$(MCU)
  694. SIZE_FLAGS = --mcu=$(MCU) -C
  695. else
  696. TOOL_PREFIX = arm-none-eabi
  697. CPU_FLAGS = -mthumb -mcpu=$(MCPU)
  698. SIZE_FLAGS = -A
  699. endif
  700. # Arduino contained the main source code for the Arduino
  701. # Libraries, the "hardware variant" are for boards
  702. # that derives from that, and their source are present in
  703. # the main Marlin source directory
  704. TARGET = $(notdir $(CURDIR))
  705. # VPATH tells make to look into these directory for source files,
  706. # there is no need to specify explicit pathnames as long as the
  707. # directory is added here
  708. # The Makefile for previous versions of Marlin used VPATH for all
  709. # source files, but for Marlin 2.0, we use VPATH only for arduino
  710. # library files.
  711. VPATH = .
  712. VPATH += $(BUILD_DIR)
  713. VPATH += $(HARDWARE_SRC)
  714. ifeq ($(HARDWARE_VARIANT), $(filter $(HARDWARE_VARIANT),arduino Teensy Sanguino))
  715. # Old libraries (avr-core 1.6.21 < / Arduino < 1.6.8)
  716. VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI
  717. # New libraries (avr-core >= 1.6.21 / Arduino >= 1.6.8)
  718. VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI/src
  719. endif
  720. ifeq ($(IS_MCU),1)
  721. VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino
  722. # Old libraries (avr-core 1.6.21 < / Arduino < 1.6.8)
  723. VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI
  724. VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SoftwareSerial
  725. # New libraries (avr-core >= 1.6.21 / Arduino >= 1.6.8)
  726. VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI/src
  727. VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SoftwareSerial/src
  728. endif
  729. VPATH += $(ARDUINO_INSTALL_DIR)/libraries/LiquidCrystal/src
  730. ifeq ($(LIQUID_TWI2), 1)
  731. WIRE = 1
  732. VPATH += $(ARDUINO_INSTALL_DIR)/libraries/LiquidTWI2
  733. endif
  734. ifeq ($(WIRE), 1)
  735. # Old libraries (avr-core 1.6.21 / Arduino < 1.6.8)
  736. VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/Wire
  737. VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/Wire/utility
  738. # New libraries (avr-core >= 1.6.21 / Arduino >= 1.6.8)
  739. VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/Wire/src
  740. VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/Wire/src/utility
  741. endif
  742. ifeq ($(NEOPIXEL), 1)
  743. VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Adafruit_NeoPixel
  744. endif
  745. ifeq ($(U8GLIB), 1)
  746. VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib
  747. VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/csrc
  748. VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/cppsrc
  749. VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/fntsrc
  750. endif
  751. ifeq ($(TMC), 1)
  752. VPATH += $(ARDUINO_INSTALL_DIR)/libraries/TMCStepper/src
  753. VPATH += $(ARDUINO_INSTALL_DIR)/libraries/TMCStepper/src/source
  754. endif
  755. ifeq ($(HARDWARE_VARIANT), arduino)
  756. HARDWARE_SUB_VARIANT ?= mega
  757. VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/variants/$(HARDWARE_SUB_VARIANT)
  758. else ifeq ($(HARDWARE_VARIANT), Sanguino)
  759. VPATH += $(ARDUINO_INSTALL_DIR)/hardware/marlin/avr/variants/sanguino
  760. else ifeq ($(HARDWARE_VARIANT), archim)
  761. VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/system/libsam
  762. VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/system/CMSIS/CMSIS/Include/
  763. VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/system/CMSIS/Device/ATMEL/
  764. VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/cores/arduino
  765. VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/cores/arduino/avr
  766. VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/cores/arduino/USB
  767. VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/libraries/Wire/src
  768. VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/libraries/SPI/src
  769. VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/libraries/U8glib/src/clib
  770. VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/variants/archim
  771. LDSCRIPT = $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/variants/archim/linker_scripts/gcc/flash.ld
  772. LDLIBS = $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/variants/archim/libsam_sam3x8e_gcc_rel.a
  773. else
  774. HARDWARE_SUB_VARIANT ?= standard
  775. VPATH += $(ARDUINO_INSTALL_DIR)/hardware/$(HARDWARE_VARIANT)/variants/$(HARDWARE_SUB_VARIANT)
  776. endif
  777. LIB_SRC = wiring.c \
  778. wiring_analog.c wiring_digital.c \
  779. wiring_shift.c WInterrupts.c hooks.c
  780. ifeq ($(HARDWARE_VARIANT), archim)
  781. LIB_ASRC += wiring_pulse_asm.S
  782. else
  783. LIB_SRC += wiring_pulse.c
  784. endif
  785. ifeq ($(HARDWARE_VARIANT), Teensy)
  786. LIB_SRC = wiring.c
  787. VPATH += $(ARDUINO_INSTALL_DIR)/hardware/teensy/cores/teensy
  788. endif
  789. LIB_CXXSRC = WMath.cpp WString.cpp Print.cpp SPI.cpp
  790. ifeq ($(NEOPIXEL), 1)
  791. LIB_CXXSRC += Adafruit_NeoPixel.cpp
  792. endif
  793. ifeq ($(LIQUID_TWI2), 0)
  794. LIB_CXXSRC += LiquidCrystal.cpp
  795. else
  796. LIB_SRC += twi.c
  797. LIB_CXXSRC += Wire.cpp LiquidTWI2.cpp
  798. endif
  799. ifeq ($(WIRE), 1)
  800. LIB_SRC += twi.c
  801. LIB_CXXSRC += Wire.cpp
  802. endif
  803. ifeq ($(TONE), 1)
  804. LIB_CXXSRC += Tone.cpp
  805. endif
  806. ifeq ($(U8GLIB), 1)
  807. LIB_CXXSRC += U8glib.cpp
  808. LIB_SRC += u8g_ll_api.c u8g_bitmap.c u8g_clip.c u8g_com_null.c u8g_delay.c \
  809. u8g_page.c u8g_pb.c u8g_pb16h1.c u8g_rect.c u8g_state.c u8g_font.c \
  810. u8g_font_6x13.c u8g_font_04b_03.c u8g_font_5x8.c
  811. endif
  812. ifeq ($(TMC), 1)
  813. LIB_CXXSRC += TMCStepper.cpp COOLCONF.cpp DRV_STATUS.cpp IHOLD_IRUN.cpp \
  814. CHOPCONF.cpp GCONF.cpp PWMCONF.cpp DRV_CONF.cpp DRVCONF.cpp DRVCTRL.cpp \
  815. DRVSTATUS.cpp ENCMODE.cpp RAMP_STAT.cpp SGCSCONF.cpp SHORT_CONF.cpp \
  816. SMARTEN.cpp SW_MODE.cpp SW_SPI.cpp TMC2130Stepper.cpp TMC2208Stepper.cpp \
  817. TMC2209Stepper.cpp TMC2660Stepper.cpp TMC5130Stepper.cpp TMC5160Stepper.cpp
  818. endif
  819. ifeq ($(RELOC_WORKAROUND), 1)
  820. LD_PREFIX=-nodefaultlibs
  821. LD_SUFFIX=-lm -lgcc -lc -lgcc
  822. endif
  823. #Check for Arduino 1.0.0 or higher and use the correct source files for that version
  824. ifeq ($(shell [ $(ARDUINO_VERSION) -ge 100 ] && echo true), true)
  825. LIB_CXXSRC += main.cpp
  826. else
  827. LIB_SRC += pins_arduino.c main.c
  828. endif
  829. FORMAT = ihex
  830. # Name of this Makefile (used for "make depend").
  831. MAKEFILE = Makefile
  832. # Debugging format.
  833. # Native formats for AVR-GCC's -g are stabs [default], or dwarf-2.
  834. # AVR (extended) COFF requires stabs, plus an avr-objcopy run.
  835. DEBUG = stabs
  836. OPT = s
  837. DEFINES ?=
  838. # Program settings
  839. CC = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-gcc
  840. CXX = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-g++
  841. OBJCOPY = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-objcopy
  842. OBJDUMP = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-objdump
  843. AR = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-ar
  844. SIZE = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-size
  845. NM = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-nm
  846. AVRDUDE = avrdude
  847. REMOVE = rm -f
  848. MV = mv -f
  849. # Place -D or -U options here
  850. CDEFS = -DF_CPU=$(F_CPU)UL ${addprefix -D , $(DEFINES)} -DARDUINO=$(ARDUINO_VERSION)
  851. CXXDEFS = $(CDEFS)
  852. ifeq ($(HARDWARE_VARIANT), Teensy)
  853. CDEFS += -DUSB_SERIAL
  854. LIB_SRC += usb.c pins_teensy.c
  855. LIB_CXXSRC += usb_api.cpp
  856. else ifeq ($(HARDWARE_VARIANT), archim)
  857. CDEFS += -DARDUINO_SAM_ARCHIM -DARDUINO_ARCH_SAM -D__SAM3X8E__
  858. CDEFS += -DUSB_VID=0x27B1 -DUSB_PID=0x0001 -DUSBCON
  859. CDEFS += '-DUSB_MANUFACTURER="UltiMachine"' '-DUSB_PRODUCT_STRING="Archim"'
  860. LIB_CXXSRC += variant.cpp IPAddress.cpp Reset.cpp RingBuffer.cpp Stream.cpp \
  861. UARTClass.cpp USARTClass.cpp abi.cpp new.cpp watchdog.cpp CDC.cpp \
  862. PluggableUSB.cpp USBCore.cpp
  863. LIB_SRC += cortex_handlers.c iar_calls_sam3.c syscalls_sam3.c dtostrf.c itoa.c
  864. ifeq ($(U8GLIB), 1)
  865. LIB_SRC += u8g_com_api.c u8g_pb32h1.c
  866. endif
  867. endif
  868. # Add all the source directories as include directories too
  869. CINCS = ${addprefix -I ,${VPATH}}
  870. CXXINCS = ${addprefix -I ,${VPATH}}
  871. # Silence warnings for library code (won't work for .h files, unfortunately)
  872. LIBWARN = -w -Wno-packed-bitfield-compat
  873. # Compiler flag to set the C/CPP Standard level.
  874. CSTANDARD = -std=gnu99
  875. CXXSTANDARD = -std=gnu++11
  876. CDEBUG = -g$(DEBUG)
  877. CWARN = -Wall -Wstrict-prototypes -Wno-packed-bitfield-compat -Wno-pragmas -Wunused-parameter
  878. CXXWARN = -Wall -Wno-packed-bitfield-compat -Wno-pragmas -Wunused-parameter
  879. CTUNING = -fsigned-char -funsigned-bitfields -fno-exceptions \
  880. -fshort-enums -ffunction-sections -fdata-sections
  881. ifneq ($(HARDWARE_MOTHERBOARD),)
  882. CTUNING += -DMOTHERBOARD=${HARDWARE_MOTHERBOARD}
  883. endif
  884. #CEXTRA = -Wa,-adhlns=$(<:.c=.lst)
  885. CXXEXTRA = -fno-use-cxa-atexit -fno-threadsafe-statics -fno-rtti
  886. CFLAGS := $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CEXTRA) $(CTUNING) $(CSTANDARD)
  887. CXXFLAGS := $(CDEFS) $(CINCS) -O$(OPT) $(CXXEXTRA) $(CTUNING) $(CXXSTANDARD)
  888. ASFLAGS := $(CDEFS)
  889. #ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
  890. ifeq ($(HARDWARE_VARIANT), archim)
  891. LD_PREFIX = -Wl,--gc-sections,-Map,Marlin.ino.map,--cref,--check-sections,--entry=Reset_Handler,--unresolved-symbols=report-all,--warn-common,--warn-section-align
  892. LD_SUFFIX = $(LDLIBS)
  893. LDFLAGS = -lm -T$(LDSCRIPT) -u _sbrk -u link -u _close -u _fstat -u _isatty
  894. LDFLAGS += -u _lseek -u _read -u _write -u _exit -u kill -u _getpid
  895. else
  896. LD_PREFIX = -Wl,--gc-sections,--relax
  897. LDFLAGS = -lm
  898. CTUNING += -flto
  899. endif
  900. # Programming support using avrdude. Settings and variables.
  901. AVRDUDE_PORT = $(UPLOAD_PORT)
  902. AVRDUDE_WRITE_FLASH = -Uflash:w:$(BUILD_DIR)/$(TARGET).hex:i
  903. ifeq ($(shell uname -s), Linux)
  904. AVRDUDE_CONF = /etc/avrdude/avrdude.conf
  905. else
  906. AVRDUDE_CONF = $(ARDUINO_INSTALL_DIR)/hardware/tools/avr/etc/avrdude.conf
  907. endif
  908. AVRDUDE_FLAGS = -D -C$(AVRDUDE_CONF) \
  909. -p$(PROG_MCU) -P$(AVRDUDE_PORT) -c$(AVRDUDE_PROGRAMMER) \
  910. -b$(UPLOAD_RATE)
  911. # Since Marlin 2.0, the source files may be distributed into several
  912. # different directories, so it is necessary to find them recursively
  913. SRC = $(shell find src -name '*.c' -type f)
  914. CXXSRC = $(shell find src -name '*.cpp' -type f)
  915. # Define all object files.
  916. OBJ = ${patsubst %.c, $(BUILD_DIR)/arduino/%.o, ${LIB_SRC}}
  917. OBJ += ${patsubst %.cpp, $(BUILD_DIR)/arduino/%.o, ${LIB_CXXSRC}}
  918. OBJ += ${patsubst %.S, $(BUILD_DIR)/arduino/%.o, ${LIB_ASRC}}
  919. OBJ += ${patsubst %.c, $(BUILD_DIR)/%.o, ${SRC}}
  920. OBJ += ${patsubst %.cpp, $(BUILD_DIR)/%.o, ${CXXSRC}}
  921. # Define all listing files.
  922. LST = $(LIB_ASRC:.S=.lst) $(LIB_CXXSRC:.cpp=.lst) $(LIB_SRC:.c=.lst)
  923. # Combine all necessary flags and optional flags.
  924. # Add target processor to flags.
  925. ALL_CFLAGS = $(MCU_FLAGS) $(CPU_FLAGS) $(CFLAGS) -I.
  926. ALL_CXXFLAGS = $(MCU_FLAGS) $(CPU_FLAGS) $(CXXFLAGS)
  927. ALL_ASFLAGS = $(MCU_FLAGS) $(CPU_FLAGS) $(ASFLAGS) -x assembler-with-cpp
  928. # set V=1 (eg, "make V=1") to print the full commands etc.
  929. ifneq ($V,1)
  930. Pecho=@echo
  931. P=@
  932. else
  933. Pecho=@:
  934. P=
  935. endif
  936. # Create required build hierarchy if it does not exist
  937. $(shell mkdir -p $(dir $(OBJ)))
  938. # Default target.
  939. all: sizeafter
  940. build: elf hex bin
  941. elf: $(BUILD_DIR)/$(TARGET).elf
  942. bin: $(BUILD_DIR)/$(TARGET).bin
  943. hex: $(BUILD_DIR)/$(TARGET).hex
  944. eep: $(BUILD_DIR)/$(TARGET).eep
  945. lss: $(BUILD_DIR)/$(TARGET).lss
  946. sym: $(BUILD_DIR)/$(TARGET).sym
  947. # Program the device.
  948. # Do not try to reset an Arduino if it's not one
  949. upload: $(BUILD_DIR)/$(TARGET).hex
  950. ifeq (${AVRDUDE_PROGRAMMER}, arduino)
  951. stty hup < $(UPLOAD_PORT); true
  952. endif
  953. $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH)
  954. ifeq (${AVRDUDE_PROGRAMMER}, arduino)
  955. stty -hup < $(UPLOAD_PORT); true
  956. endif
  957. # Display size of file.
  958. HEXSIZE = $(SIZE) --target=$(FORMAT) $(BUILD_DIR)/$(TARGET).hex
  959. ELFSIZE = $(SIZE) $(SIZE_FLAGS) $(BUILD_DIR)/$(TARGET).elf; \
  960. $(SIZE) $(BUILD_DIR)/$(TARGET).elf
  961. sizebefore:
  962. $P if [ -f $(BUILD_DIR)/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(HEXSIZE); echo; fi
  963. sizeafter: build
  964. $P if [ -f $(BUILD_DIR)/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi
  965. # Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
  966. COFFCONVERT=$(OBJCOPY) --debugging \
  967. --change-section-address .data-0x800000 \
  968. --change-section-address .bss-0x800000 \
  969. --change-section-address .noinit-0x800000 \
  970. --change-section-address .eeprom-0x810000
  971. coff: $(BUILD_DIR)/$(TARGET).elf
  972. $(COFFCONVERT) -O coff-avr $(BUILD_DIR)/$(TARGET).elf $(TARGET).cof
  973. extcoff: $(TARGET).elf
  974. $(COFFCONVERT) -O coff-ext-avr $(BUILD_DIR)/$(TARGET).elf $(TARGET).cof
  975. .SUFFIXES: .elf .hex .eep .lss .sym .bin
  976. .PRECIOUS: .o
  977. .elf.hex:
  978. $(Pecho) " COPY $@"
  979. $P $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
  980. .elf.bin:
  981. $(Pecho) " COPY $@"
  982. $P $(OBJCOPY) -O binary -R .eeprom $< $@
  983. .elf.eep:
  984. -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
  985. --change-section-lma .eeprom=0 -O $(FORMAT) $< $@
  986. # Create extended listing file from ELF output file.
  987. .elf.lss:
  988. $(OBJDUMP) -h -S $< > $@
  989. # Create a symbol table from ELF output file.
  990. .elf.sym:
  991. $(NM) -n $< > $@
  992. # Link: create ELF output file from library.
  993. $(BUILD_DIR)/$(TARGET).elf: $(OBJ) Configuration.h
  994. $(Pecho) " CXX $@"
  995. $P $(CXX) $(LD_PREFIX) $(ALL_CXXFLAGS) -o $@ -L. $(OBJ) $(LDFLAGS) $(LD_SUFFIX)
  996. # Object files that were found in "src" will be stored in $(BUILD_DIR)
  997. # in directories that mirror the structure of "src"
  998. $(BUILD_DIR)/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE)
  999. $(Pecho) " CC $<"
  1000. $P $(CC) -MMD -c $(ALL_CFLAGS) $(CWARN) $< -o $@
  1001. $(BUILD_DIR)/%.o: %.cpp Configuration.h Configuration_adv.h $(MAKEFILE)
  1002. $(Pecho) " CXX $<"
  1003. $P $(CXX) -MMD -c $(ALL_CXXFLAGS) $(CXXWARN) $< -o $@
  1004. # Object files for Arduino libs will be created in $(BUILD_DIR)/arduino
  1005. $(BUILD_DIR)/arduino/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE)
  1006. $(Pecho) " CC $<"
  1007. $P $(CC) -MMD -c $(ALL_CFLAGS) $(LIBWARN) $< -o $@
  1008. $(BUILD_DIR)/arduino/%.o: %.cpp Configuration.h Configuration_adv.h $(MAKEFILE)
  1009. $(Pecho) " CXX $<"
  1010. $P $(CXX) -MMD -c $(ALL_CXXFLAGS) $(LIBWARN) $< -o $@
  1011. $(BUILD_DIR)/arduino/%.o: %.S $(MAKEFILE)
  1012. $(Pecho) " CXX $<"
  1013. $P $(CXX) -MMD -c $(ALL_ASFLAGS) $< -o $@
  1014. # Target: clean project.
  1015. clean:
  1016. $(Pecho) " RMDIR $(BUILD_DIR)/"
  1017. $P rm -rf $(BUILD_DIR)
  1018. .PHONY: all build elf hex eep lss sym program coff extcoff clean depend sizebefore sizeafter
  1019. # Automatically include the dependency files created by gcc
  1020. -include ${patsubst %.o, %.d, ${OBJ}}