You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
892 lines
29 KiB
Makefile
892 lines
29 KiB
Makefile
7 years ago
|
# Marlin Firmware Arduino Project Makefile
|
||
12 years ago
|
#
|
||
13 years ago
|
# Makefile Based on:
|
||
|
# Arduino 0011 Makefile
|
||
|
# Arduino adaptation by mellis, eighthave, oli.keller
|
||
12 years ago
|
# Marlin adaption by Daid
|
||
7 years ago
|
# Marlin 2.0 support and RELOC_WORKAROUND by @marcio-ao
|
||
13 years ago
|
#
|
||
|
# This has been tested with Arduino 0022.
|
||
12 years ago
|
#
|
||
13 years ago
|
# This makefile allows you to build sketches from the command line
|
||
|
# without the Arduino environment (or Java).
|
||
|
#
|
||
|
# Detailed instructions for using the makefile:
|
||
|
#
|
||
9 years ago
|
# 1. Modify the line containing "ARDUINO_INSTALL_DIR" to point to the directory that
|
||
13 years ago
|
# contains the Arduino installation (for example, under Mac OS X, this
|
||
11 years ago
|
# might be /Applications/Arduino.app/Contents/Resources/Java).
|
||
13 years ago
|
#
|
||
12 years ago
|
# 2. Modify the line containing "UPLOAD_PORT" to refer to the filename
|
||
13 years ago
|
# representing the USB or serial connection to your Arduino board
|
||
12 years ago
|
# (e.g. UPLOAD_PORT = /dev/tty.USB0). If the exact name of this file
|
||
9 years ago
|
# changes, you can use * as a wild card (e.g. UPLOAD_PORT = /dev/tty.usb*).
|
||
13 years ago
|
#
|
||
12 years ago
|
# 3. Set the line containing "MCU" to match your board's processor.
|
||
13 years ago
|
# Older one's are atmega8 based, newer ones like Arduino Mini, Bluetooth
|
||
|
# or Diecimila have the atmega168. If you're using a LilyPad Arduino,
|
||
13 years ago
|
# change F_CPU to 8000000. If you are using Gen7 electronics, you
|
||
|
# probably need to use 20000000. Either way, you must regenerate
|
||
|
# the speed lookup table with create_speed_lookuptable.py.
|
||
13 years ago
|
#
|
||
|
# 4. Type "make" and press enter to compile/verify your program.
|
||
|
#
|
||
|
# 5. Type "make upload", reset your Arduino board, and press enter to
|
||
|
# upload your program to the Arduino board.
|
||
|
#
|
||
8 years ago
|
# Note that all settings at the top of this file can be overriden from
|
||
|
# the command line with, for example, "make HARDWARE_MOTHERBOARD=71"
|
||
|
#
|
||
|
# To compile for RAMPS (atmega2560) with Arduino 1.6.9 at root/arduino you would use...
|
||
|
#
|
||
|
# make ARDUINO_VERSION=10609 AVR_TOOLS_PATH=/root/arduino/hardware/tools/avr/bin/ \
|
||
|
# HARDWARE_MOTHERBOARD=33 ARDUINO_INSTALL_DIR=/root/arduino
|
||
|
#
|
||
|
# To compile and upload simply add "upload" to the end of the line...
|
||
|
#
|
||
|
# make ARDUINO_VERSION=10609 AVR_TOOLS_PATH=/root/arduino/hardware/tools/avr/bin/ \
|
||
|
# HARDWARE_MOTHERBOARD=33 ARDUINO_INSTALL_DIR=/root/arduino upload
|
||
8 years ago
|
#
|
||
8 years ago
|
# If uploading doesn't work try adding the parameter "AVRDUDE_PROGRAMMER=wiring" or
|
||
|
# start upload manually (using stk500) like so:
|
||
|
#
|
||
|
# avrdude -C /root/arduino/hardware/tools/avr/etc/avrdude.conf -v -p m2560 -c stk500 \
|
||
|
# -U flash:w:applet/Marlin.hex:i -P /dev/ttyUSB0
|
||
|
#
|
||
|
# Or, try disconnecting USB to power down and then reconnecting before running avrdude.
|
||
|
#
|
||
13 years ago
|
|
||
8 years ago
|
# This defines the board to compile for (see boards.h for your board's ID)
|
||
12 years ago
|
HARDWARE_MOTHERBOARD ?= 11
|
||
13 years ago
|
|
||
12 years ago
|
# Arduino source install directory, and version number
|
||
10 years ago
|
# On most linuxes this will be /usr/share/arduino
|
||
9 years ago
|
ARDUINO_INSTALL_DIR ?= ${HOME}/Arduino
|
||
|
ARDUINO_VERSION ?= 106
|
||
13 years ago
|
|
||
7 years ago
|
# The installed Libraries are in the User folder
|
||
|
ARDUINO_USER_DIR ?= ${HOME}/Arduino
|
||
|
|
||
12 years ago
|
# You can optionally set a path to the avr-gcc tools. Requires a trailing slash. (ex: /usr/local/avr-gcc/bin)
|
||
12 years ago
|
AVR_TOOLS_PATH ?=
|
||
12 years ago
|
|
||
|
#Programmer configuration
|
||
9 years ago
|
UPLOAD_RATE ?= 57600
|
||
|
AVRDUDE_PROGRAMMER ?= arduino
|
||
8 years ago
|
# on most linuxes this will be /dev/ttyACM0 or /dev/ttyACM1
|
||
9 years ago
|
UPLOAD_PORT ?= /dev/ttyUSB0
|
||
12 years ago
|
|
||
10 years ago
|
#Directory used to build files in, contains all the build files, from object files to the final hex file
|
||
|
#on linux it is best to put an absolute path like /home/username/tmp .
|
||
12 years ago
|
BUILD_DIR ?= applet
|
||
|
|
||
12 years ago
|
# This defines whether Liquid_TWI2 support will be built
|
||
11 years ago
|
LIQUID_TWI2 ?= 0
|
||
|
|
||
|
# this defines if Wire is needed
|
||
|
WIRE ?= 0
|
||
12 years ago
|
|
||
8 years ago
|
# this defines if U8GLIB is needed (may require RELOC_WORKAROUND)
|
||
|
U8GLIB ?= 1
|
||
|
|
||
6 years ago
|
# this defines whether to include the Trinamic TMCStepper library
|
||
|
TMC ?= 1
|
||
7 years ago
|
|
||
5 years ago
|
# this defines whether to include the AdaFruit NeoPixel library
|
||
|
NEOPIXEL ?= 0
|
||
|
|
||
7 years ago
|
############
|
||
|
# Try to automatically determine whether RELOC_WORKAROUND is needed based
|
||
|
# on GCC versions:
|
||
|
# http://www.avrfreaks.net/comment/1789106#comment-1789106
|
||
|
|
||
|
CC_MAJ:=$(shell $(CC) -dM -E - < /dev/null | grep __GNUC__ | cut -f3 -d\ )
|
||
|
CC_MIN:=$(shell $(CC) -dM -E - < /dev/null | grep __GNUC_MINOR__ | cut -f3 -d\ )
|
||
|
CC_PATCHLEVEL:=$(shell $(CC) -dM -E - < /dev/null | grep __GNUC_PATCHLEVEL__ | cut -f3 -d\ )
|
||
|
CC_VER:=$(shell echo $$(( $(CC_MAJ) * 10000 + $(CC_MIN) * 100 + $(CC_PATCHLEVEL) )))
|
||
|
ifeq ($(shell test $(CC_VER) -lt 40901 && echo 1),1)
|
||
|
@echo This version of GCC is likely broken. Enabling relocation workaround.
|
||
6 years ago
|
RELOC_WORKAROUND = 1
|
||
7 years ago
|
endif
|
||
8 years ago
|
|
||
12 years ago
|
############################################################################
|
||
|
# Below here nothing should be changed...
|
||
|
|
||
|
# Here the Arduino variant is selected by the board type
|
||
|
# HARDWARE_VARIANT = "arduino", "Sanguino", "Gen7", ...
|
||
|
# MCU = "atmega1280", "Mega2560", "atmega2560", "atmega644p", ...
|
||
|
|
||
7 years ago
|
ifeq ($(HARDWARE_MOTHERBOARD),0)
|
||
12 years ago
|
|
||
7 years ago
|
# No motherboard selected
|
||
7 years ago
|
|
||
7 years ago
|
#
|
||
|
# RAMPS 1.3 / 1.4 - ATmega1280, ATmega2560
|
||
|
#
|
||
12 years ago
|
|
||
7 years ago
|
# MEGA/RAMPS up to 1.2
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1000)
|
||
7 years ago
|
|
||
|
# RAMPS 1.3 (Power outputs: Hotend, Fan, Bed)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1010)
|
||
7 years ago
|
# RAMPS 1.3 (Power outputs: Hotend0, Hotend1, Bed)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1011)
|
||
7 years ago
|
# RAMPS 1.3 (Power outputs: Hotend, Fan0, Fan1)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1012)
|
||
7 years ago
|
# RAMPS 1.3 (Power outputs: Hotend0, Hotend1, Fan)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1013)
|
||
7 years ago
|
# RAMPS 1.3 (Power outputs: Spindle, Controller Fan)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1014)
|
||
7 years ago
|
|
||
|
# RAMPS 1.4 (Power outputs: Hotend, Fan, Bed)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1020)
|
||
7 years ago
|
# RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Bed)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1021)
|
||
7 years ago
|
# RAMPS 1.4 (Power outputs: Hotend, Fan0, Fan1)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1022)
|
||
7 years ago
|
# RAMPS 1.4 (Power outputs: Hotend0, Hotend1, Fan)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1023)
|
||
7 years ago
|
# RAMPS 1.4 (Power outputs: Spindle, Controller Fan)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1024)
|
||
7 years ago
|
|
||
|
# RAMPS Plus 3DYMY (Power outputs: Hotend, Fan, Bed)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1030)
|
||
7 years ago
|
# RAMPS Plus 3DYMY (Power outputs: Hotend0, Hotend1, Bed)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1031)
|
||
7 years ago
|
# RAMPS Plus 3DYMY (Power outputs: Hotend, Fan0, Fan1)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1032)
|
||
7 years ago
|
# RAMPS Plus 3DYMY (Power outputs: Hotend0, Hotend1, Fan)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1033)
|
||
7 years ago
|
# RAMPS Plus 3DYMY (Power outputs: Spindle, Controller Fan)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1034)
|
||
7 years ago
|
|
||
7 years ago
|
#
|
||
|
# RAMPS Derivatives - ATmega1280, ATmega2560
|
||
|
#
|
||
|
|
||
|
# 3Drag Controller
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1100)
|
||
7 years ago
|
# Velleman K8200 Controller (derived from 3Drag Controller)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1101)
|
||
7 years ago
|
# Velleman K8400 Controller (derived from 3Drag Controller)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1102)
|
||
7 years ago
|
# 2PrintBeta BAM&DICE with STK drivers
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1103)
|
||
7 years ago
|
# 2PrintBeta BAM&DICE Due with STK drivers
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1104)
|
||
7 years ago
|
# MKS BASE v1.0
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1105)
|
||
|
# MKS v1.4 with A4982 stepper drivers
|
||
|
else ifeq ($(HARDWARE_MOTHERBOARD),1106)
|
||
7 years ago
|
# MKS v1.5 with Allegro A4982 stepper drivers
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1107)
|
||
5 years ago
|
# MKS v1.6 with Allegro A4982 stepper drivers
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1108)
|
||
5 years ago
|
|
||
|
# MKS BASE 1.0 with Heroic HR4982 stepper drivers
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1109)
|
||
5 years ago
|
# MKS GEN v1.3 or 1.4
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1110)
|
||
5 years ago
|
# MKS GEN L
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1111)
|
||
5 years ago
|
# zrib V2.0 control board (Chinese knock off RAMPS replica)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1112)
|
||
5 years ago
|
# BigTreeTech or BIQU KFB2.0
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1113)
|
||
5 years ago
|
# Felix 2.0+ Electronics Board (RAMPS like)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1114)
|
||
5 years ago
|
# Invent-A-Part RigidBoard
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1115)
|
||
5 years ago
|
# Invent-A-Part RigidBoard V2
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1116)
|
||
5 years ago
|
# Sainsmart 2-in-1 board
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1117)
|
||
5 years ago
|
# Ultimaker
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1118)
|
||
5 years ago
|
# Ultimaker (Older electronics. Pre 1.5.4. This is rare)
|
||
|
else ifeq ($(HARDWARE_MOTHERBOARD),1119)
|
||
6 years ago
|
MCU ?= atmega1280
|
||
6 years ago
|
|
||
7 years ago
|
# Azteeg X3
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1120)
|
||
5 years ago
|
# Azteeg X3 Pro
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1121)
|
||
5 years ago
|
# Ultimainboard 2.x (Uses TEMP_SENSOR 20)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1122)
|
||
5 years ago
|
# Rumba
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1123)
|
||
5 years ago
|
# Raise3D Rumba
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1124)
|
||
5 years ago
|
# Rapide Lite RL200 Rumba
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1125)
|
||
5 years ago
|
# Formbot T-Rex 2 Plus
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1126)
|
||
5 years ago
|
# Formbot T-Rex 3
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1127)
|
||
5 years ago
|
# Formbot Raptor
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1128)
|
||
5 years ago
|
# Formbot Raptor 2
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1129)
|
||
5 years ago
|
# bq ZUM Mega 3D
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1130)
|
||
5 years ago
|
# MakeBoard Mini v2.1.2 is a control board sold by MicroMake
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1131)
|
||
5 years ago
|
# TriGorilla Anycubic version 1.3 based on RAMPS EFB
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1132)
|
||
5 years ago
|
# TriGorilla Anycubic version 1.4 based on RAMPS EFB
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1133)
|
||
5 years ago
|
# TriGorilla Anycubic version 1.4 Rev 1.1
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1134)
|
||
5 years ago
|
# Creality: Ender-4, CR-8
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1135)
|
||
5 years ago
|
# Creality: CR10S, CR20, CR-X
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1136)
|
||
5 years ago
|
# Dagoma F5
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1137)
|
||
5 years ago
|
# FYSETC F6 1.3
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1138)
|
||
5 years ago
|
# FYSETC F6 1.5
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1139)
|
||
5 years ago
|
# Duplicator i3 Plus
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1140)
|
||
5 years ago
|
# VORON
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1141)
|
||
5 years ago
|
# TRONXY V3 1.0
|
||
5 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1142)
|
||
5 years ago
|
# Z-Bolt X Series
|
||
5 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1143)
|
||
5 years ago
|
# TT OSCAR
|
||
5 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1144)
|
||
5 years ago
|
# Overlord/Overlord Pro
|
||
5 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1145)
|
||
5 years ago
|
# ADIMLab Gantry v1
|
||
5 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1146)
|
||
5 years ago
|
# ADIMLab Gantry v2
|
||
5 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1147)
|
||
5 years ago
|
# BIQU Tango V1
|
||
|
else ifeq ($(HARDWARE_MOTHERBOARD),1148)
|
||
|
# MKS GEN L V2
|
||
|
else ifeq ($(HARDWARE_MOTHERBOARD),1149)
|
||
5 years ago
|
# Copymaster 3D
|
||
|
else ifeq ($(HARDWARE_MOTHERBOARD),1150)
|
||
12 years ago
|
|
||
6 years ago
|
#
|
||
|
# RAMBo and derivatives
|
||
|
#
|
||
|
|
||
|
# Rambo
|
||
|
else ifeq ($(HARDWARE_MOTHERBOARD),1200)
|
||
|
# Mini-Rambo
|
||
|
else ifeq ($(HARDWARE_MOTHERBOARD),1201)
|
||
|
# Mini-Rambo 1.0a
|
||
|
else ifeq ($(HARDWARE_MOTHERBOARD),1202)
|
||
|
# Einsy Rambo
|
||
|
else ifeq ($(HARDWARE_MOTHERBOARD),1203)
|
||
|
# Einsy Retro
|
||
|
else ifeq ($(HARDWARE_MOTHERBOARD),1204)
|
||
|
# abee Scoovo X9H
|
||
|
else ifeq ($(HARDWARE_MOTHERBOARD),1205)
|
||
|
|
||
7 years ago
|
#
|
||
|
# Other ATmega1280, ATmega2560
|
||
|
#
|
||
|
|
||
|
# Cartesio CN Controls V11
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1300)
|
||
7 years ago
|
# Cartesio CN Controls V12
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1301)
|
||
5 years ago
|
# Cartesio CN Controls V15
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1302)
|
||
5 years ago
|
# Cheaptronic v1.0
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1303)
|
||
5 years ago
|
# Cheaptronic v2.0
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1304)
|
||
5 years ago
|
# Makerbot Mightyboard Revision E
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1305)
|
||
5 years ago
|
# Megatronics
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1306)
|
||
5 years ago
|
# Megatronics v2.0
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1307)
|
||
5 years ago
|
# Megatronics v3.0
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1308)
|
||
5 years ago
|
# Megatronics v3.1
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1309)
|
||
5 years ago
|
# Megatronics v3.2
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1310)
|
||
5 years ago
|
# Elefu Ra Board (v3)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1311)
|
||
5 years ago
|
# Leapfrog
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1312)
|
||
5 years ago
|
# Mega controller
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1313)
|
||
5 years ago
|
# Geeetech GT2560 Rev B for Mecreator2
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1314)
|
||
5 years ago
|
# Geeetech GT2560 Rev. A
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1315)
|
||
5 years ago
|
# Geeetech GT2560 Rev. A+ (with auto level probe)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1316)
|
||
5 years ago
|
# Geeetech GT2560 Rev B for A10(M/D)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1317)
|
||
5 years ago
|
# Geeetech GT2560 Rev B for A20(M/D)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1318)
|
||
5 years ago
|
# Einstart retrofit
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1319)
|
||
5 years ago
|
# Wanhao 0ne+ i3 Mini
|
||
|
else ifeq ($(HARDWARE_MOTHERBOARD),1320)
|
||
7 years ago
|
|
||
|
#
|
||
|
# ATmega1281, ATmega2561
|
||
|
#
|
||
|
|
||
5 years ago
|
# Minitronics v1.0/1.1
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1400)
|
||
6 years ago
|
MCU ?= atmega1281
|
||
5 years ago
|
# Silvergate v1.0
|
||
|
else ifeq ($(HARDWARE_MOTHERBOARD),1401)
|
||
6 years ago
|
MCU ?= atmega1281
|
||
7 years ago
|
|
||
|
#
|
||
|
# Sanguinololu and Derivatives - ATmega644P, ATmega1284P
|
||
|
#
|
||
|
|
||
|
# Sanguinololu < 1.2
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1500)
|
||
6 years ago
|
HARDWARE_VARIANT ?= Sanguino
|
||
|
MCU ?= atmega644p
|
||
7 years ago
|
# Sanguinololu 1.2 and above
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1501)
|
||
6 years ago
|
HARDWARE_VARIANT ?= Sanguino
|
||
|
MCU ?= atmega644p
|
||
7 years ago
|
# Melzi
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1502)
|
||
6 years ago
|
HARDWARE_VARIANT ?= Sanguino
|
||
|
MCU ?= atmega644p
|
||
7 years ago
|
# Melzi with ATmega1284 (MaKr3d version)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1503)
|
||
6 years ago
|
HARDWARE_VARIANT ?= Sanguino
|
||
|
MCU ?= atmega1284p
|
||
7 years ago
|
# Melzi Creality3D board (for CR-10 etc)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1504)
|
||
6 years ago
|
HARDWARE_VARIANT ?= Sanguino
|
||
|
MCU ?= atmega1284p
|
||
7 years ago
|
# Melzi Malyan M150 board
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1505)
|
||
6 years ago
|
HARDWARE_VARIANT ?= Sanguino
|
||
|
MCU ?= atmega1284p
|
||
7 years ago
|
# Tronxy X5S
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1506)
|
||
6 years ago
|
HARDWARE_VARIANT ?= Sanguino
|
||
|
MCU ?= atmega1284p
|
||
7 years ago
|
# STB V1.1
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1507)
|
||
6 years ago
|
HARDWARE_VARIANT ?= Sanguino
|
||
|
MCU ?= atmega1284p
|
||
7 years ago
|
# Azteeg X1
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1508)
|
||
6 years ago
|
HARDWARE_VARIANT ?= Sanguino
|
||
|
MCU ?= atmega1284p
|
||
7 years ago
|
# Anet 1.0 (Melzi clone)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1509)
|
||
6 years ago
|
HARDWARE_VARIANT ?= Sanguino
|
||
|
MCU ?= atmega1284p
|
||
7 years ago
|
|
||
|
#
|
||
|
# Other ATmega644P, ATmega644, ATmega1284P
|
||
|
#
|
||
|
|
||
|
# Gen3 Monolithic Electronics
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1600)
|
||
6 years ago
|
HARDWARE_VARIANT ?= Sanguino
|
||
|
MCU ?= atmega644p
|
||
7 years ago
|
# Gen3+
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1601)
|
||
6 years ago
|
HARDWARE_VARIANT ?= Sanguino
|
||
|
MCU ?= atmega644p
|
||
7 years ago
|
# Gen6
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1602)
|
||
6 years ago
|
HARDWARE_VARIANT ?= Gen6
|
||
|
MCU ?= atmega644p
|
||
7 years ago
|
# Gen6 deluxe
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1603)
|
||
6 years ago
|
HARDWARE_VARIANT ?= Gen6
|
||
|
MCU ?= atmega644p
|
||
7 years ago
|
# Gen7 custom (Alfons3 Version)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1604)
|
||
6 years ago
|
HARDWARE_VARIANT ?= Gen7
|
||
|
MCU ?= atmega644
|
||
|
F_CPU ?= 20000000
|
||
7 years ago
|
# Gen7 v1.1, v1.2
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1605)
|
||
6 years ago
|
HARDWARE_VARIANT ?= Gen7
|
||
|
MCU ?= atmega644p
|
||
|
F_CPU ?= 20000000
|
||
7 years ago
|
# Gen7 v1.3
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1606)
|
||
6 years ago
|
HARDWARE_VARIANT ?= Gen7
|
||
|
MCU ?= atmega644p
|
||
|
F_CPU ?= 20000000
|
||
7 years ago
|
# Gen7 v1.4
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1607)
|
||
6 years ago
|
HARDWARE_VARIANT ?= Gen7
|
||
|
MCU ?= atmega1284p
|
||
|
F_CPU ?= 20000000
|
||
7 years ago
|
# Alpha OMCA board
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1608)
|
||
6 years ago
|
HARDWARE_VARIANT ?= SanguinoA
|
||
|
MCU ?= atmega644
|
||
7 years ago
|
# Final OMCA board
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1609)
|
||
6 years ago
|
HARDWARE_VARIANT ?= Sanguino
|
||
|
MCU ?= atmega644p
|
||
7 years ago
|
# Sethi 3D_1
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1610)
|
||
6 years ago
|
HARDWARE_VARIANT ?= Sanguino
|
||
|
MCU ?= atmega644p
|
||
12 years ago
|
|
||
7 years ago
|
#
|
||
|
# Teensyduino - AT90USB1286, AT90USB1286P
|
||
|
#
|
||
7 years ago
|
|
||
7 years ago
|
# Teensylu
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1700)
|
||
6 years ago
|
HARDWARE_VARIANT ?= Teensy
|
||
|
MCU ?= at90usb1286
|
||
7 years ago
|
# Printrboard (AT90USB1286)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1701)
|
||
6 years ago
|
HARDWARE_VARIANT ?= Teensy
|
||
|
MCU ?= at90usb1286
|
||
7 years ago
|
# Printrboard Revision F (AT90USB1286)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1702)
|
||
6 years ago
|
HARDWARE_VARIANT ?= Teensy
|
||
|
MCU ?= at90usb1286
|
||
7 years ago
|
# Brainwave (AT90USB646)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1703)
|
||
6 years ago
|
HARDWARE_VARIANT ?= Teensy
|
||
|
MCU ?= at90usb646
|
||
7 years ago
|
# Brainwave Pro (AT90USB1286)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1704)
|
||
6 years ago
|
HARDWARE_VARIANT ?= Teensy
|
||
|
MCU ?= at90usb1286
|
||
7 years ago
|
# SAV Mk-I (AT90USB1286)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1705)
|
||
6 years ago
|
HARDWARE_VARIANT ?= Teensy
|
||
|
MCU ?= at90usb1286
|
||
7 years ago
|
# Teensy++2.0 (AT90USB1286)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1706)
|
||
6 years ago
|
HARDWARE_VARIANT ?= Teensy
|
||
|
MCU ?= at90usb1286
|
||
7 years ago
|
# 5DPrint D8 Driver Board
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),1707)
|
||
6 years ago
|
HARDWARE_VARIANT ?= Teensy
|
||
|
MCU ?= at90usb1286
|
||
|
|
||
6 years ago
|
# UltiMachine Archim1 (with DRV8825 drivers)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),3023)
|
||
6 years ago
|
HARDWARE_VARIANT ?= archim
|
||
|
MCPU = cortex-m3
|
||
|
F_CPU = 84000000L
|
||
|
IS_MCU = 0
|
||
6 years ago
|
# UltiMachine Archim2 (with TMC2130 drivers)
|
||
6 years ago
|
else ifeq ($(HARDWARE_MOTHERBOARD),3024)
|
||
6 years ago
|
HARDWARE_VARIANT ?= archim
|
||
|
MCPU = cortex-m3
|
||
|
F_CPU = 84000000L
|
||
|
IS_MCU = 0
|
||
12 years ago
|
endif
|
||
|
|
||
|
# Be sure to regenerate speed_lookuptable.h with create_speed_lookuptable.py
|
||
|
# if you are setting this to something other than 16MHz
|
||
|
# Set to 16Mhz if not yet set.
|
||
|
F_CPU ?= 16000000
|
||
13 years ago
|
|
||
6 years ago
|
# Set to microcontroller if IS_MCU not yet set
|
||
|
IS_MCU ?= 1
|
||
|
|
||
|
ifeq ($(IS_MCU),1)
|
||
|
# Set to arduino, ATmega2560 if not yet set.
|
||
|
HARDWARE_VARIANT ?= arduino
|
||
|
MCU ?= atmega2560
|
||
|
|
||
|
TOOL_PREFIX = avr
|
||
|
MCU_FLAGS = -mmcu=$(MCU)
|
||
|
SIZE_FLAGS = --mcu=$(MCU) -C
|
||
|
else
|
||
|
TOOL_PREFIX = arm-none-eabi
|
||
|
CPU_FLAGS = -mthumb -mcpu=$(MCPU)
|
||
|
SIZE_FLAGS = -A
|
||
|
endif
|
||
7 years ago
|
|
||
9 years ago
|
# Arduino contained the main source code for the Arduino
|
||
13 years ago
|
# Libraries, the "hardware variant" are for boards
|
||
|
# that derives from that, and their source are present in
|
||
|
# the main Marlin source directory
|
||
12 years ago
|
|
||
13 years ago
|
TARGET = $(notdir $(CURDIR))
|
||
|
|
||
13 years ago
|
# VPATH tells make to look into these directory for source files,
|
||
|
# there is no need to specify explicit pathnames as long as the
|
||
|
# directory is added here
|
||
|
|
||
7 years ago
|
# The Makefile for previous versions of Marlin used VPATH for all
|
||
|
# source files, but for Marlin 2.0, we use VPATH only for arduino
|
||
|
# library files.
|
||
|
|
||
13 years ago
|
VPATH = .
|
||
12 years ago
|
VPATH += $(BUILD_DIR)
|
||
7 years ago
|
VPATH += $(HARDWARE_SRC)
|
||
|
|
||
|
ifeq ($(HARDWARE_VARIANT), $(filter $(HARDWARE_VARIANT),arduino Teensy Sanguino))
|
||
|
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/marlin/avr/libraries/LiquidCrystal/src
|
||
|
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/marlin/avr/libraries/SPI
|
||
|
endif
|
||
|
|
||
6 years ago
|
ifeq ($(IS_MCU),1)
|
||
|
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino
|
||
|
|
||
|
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI
|
||
|
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI/src
|
||
|
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SoftwareSerial/src
|
||
|
endif
|
||
8 years ago
|
|
||
8 years ago
|
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/LiquidCrystal/src
|
||
12 years ago
|
ifeq ($(LIQUID_TWI2), 1)
|
||
|
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Wire
|
||
|
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Wire/utility
|
||
|
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/LiquidTWI2
|
||
|
endif
|
||
11 years ago
|
ifeq ($(WIRE), 1)
|
||
|
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Wire
|
||
|
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Wire/utility
|
||
|
endif
|
||
8 years ago
|
ifeq ($(NEOPIXEL), 1)
|
||
|
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Adafruit_NeoPixel
|
||
|
endif
|
||
8 years ago
|
ifeq ($(U8GLIB), 1)
|
||
|
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib
|
||
6 years ago
|
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/csrc
|
||
|
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/cppsrc
|
||
|
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/fntsrc
|
||
7 years ago
|
endif
|
||
6 years ago
|
ifeq ($(TMC), 1)
|
||
|
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/TMCStepper/src
|
||
|
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/TMCStepper/src/source
|
||
8 years ago
|
endif
|
||
8 years ago
|
|
||
12 years ago
|
ifeq ($(HARDWARE_VARIANT), arduino)
|
||
6 years ago
|
HARDWARE_SUB_VARIANT ?= mega
|
||
|
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/variants/$(HARDWARE_SUB_VARIANT)
|
||
|
else ifeq ($(HARDWARE_VARIANT), Sanguino)
|
||
|
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/marlin/avr/variants/sanguino
|
||
|
else ifeq ($(HARDWARE_VARIANT), archim)
|
||
|
VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/system/libsam
|
||
|
VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/system/CMSIS/CMSIS/Include/
|
||
|
VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/system/CMSIS/Device/ATMEL/
|
||
|
VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/cores/arduino
|
||
|
VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/cores/arduino/avr
|
||
|
VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/cores/arduino/USB
|
||
|
VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/libraries/Wire/src
|
||
|
VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/libraries/SPI/src
|
||
6 years ago
|
VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/libraries/U8glib/src/clib
|
||
6 years ago
|
VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/variants/archim
|
||
|
LDSCRIPT = $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/variants/archim/linker_scripts/gcc/flash.ld
|
||
|
LDLIBS = $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/variants/archim/libsam_sam3x8e_gcc_rel.a
|
||
9 years ago
|
else
|
||
6 years ago
|
HARDWARE_SUB_VARIANT ?= standard
|
||
|
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/$(HARDWARE_VARIANT)/variants/$(HARDWARE_SUB_VARIANT)
|
||
9 years ago
|
endif
|
||
6 years ago
|
|
||
7 years ago
|
LIB_SRC = wiring.c \
|
||
6 years ago
|
wiring_analog.c wiring_digital.c \
|
||
|
wiring_shift.c WInterrupts.c hooks.c
|
||
|
|
||
|
ifeq ($(HARDWARE_VARIANT), archim)
|
||
|
LIB_ASRC += wiring_pulse_asm.S
|
||
|
else
|
||
|
LIB_SRC += wiring_pulse.c
|
||
|
endif
|
||
7 years ago
|
|
||
11 years ago
|
ifeq ($(HARDWARE_VARIANT), Teensy)
|
||
6 years ago
|
LIB_SRC = wiring.c
|
||
|
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/teensy/cores/teensy
|
||
11 years ago
|
endif
|
||
7 years ago
|
|
||
6 years ago
|
LIB_CXXSRC = WMath.cpp WString.cpp Print.cpp SPI.cpp
|
||
7 years ago
|
|
||
8 years ago
|
ifeq ($(NEOPIXEL), 1)
|
||
6 years ago
|
LIB_CXXSRC += Adafruit_NeoPixel.cpp
|
||
8 years ago
|
endif
|
||
7 years ago
|
|
||
12 years ago
|
ifeq ($(LIQUID_TWI2), 0)
|
||
6 years ago
|
LIB_CXXSRC += LiquidCrystal.cpp
|
||
12 years ago
|
else
|
||
6 years ago
|
LIB_SRC += twi.c
|
||
|
LIB_CXXSRC += Wire.cpp LiquidTWI2.cpp
|
||
12 years ago
|
endif
|
||
12 years ago
|
|
||
11 years ago
|
ifeq ($(WIRE), 1)
|
||
6 years ago
|
LIB_SRC += twi.c
|
||
|
LIB_CXXSRC += Wire.cpp
|
||
11 years ago
|
endif
|
||
|
|
||
8 years ago
|
ifeq ($(U8GLIB), 1)
|
||
6 years ago
|
LIB_CXXSRC += U8glib.cpp
|
||
|
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
|
||
7 years ago
|
endif
|
||
|
|
||
6 years ago
|
ifeq ($(TMC), 1)
|
||
6 years ago
|
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
|
||
8 years ago
|
endif
|
||
|
|
||
|
ifeq ($(RELOC_WORKAROUND), 1)
|
||
6 years ago
|
LD_PREFIX=-nodefaultlibs
|
||
|
LD_SUFFIX=-lm -lgcc -lc -lgcc
|
||
8 years ago
|
endif
|
||
|
|
||
9 years ago
|
#Check for Arduino 1.0.0 or higher and use the correct source files for that version
|
||
12 years ago
|
ifeq ($(shell [ $(ARDUINO_VERSION) -ge 100 ] && echo true), true)
|
||
6 years ago
|
LIB_CXXSRC += main.cpp
|
||
12 years ago
|
else
|
||
6 years ago
|
LIB_SRC += pins_arduino.c main.c
|
||
12 years ago
|
endif
|
||
|
|
||
13 years ago
|
FORMAT = ihex
|
||
|
|
||
|
# Name of this Makefile (used for "make depend").
|
||
|
MAKEFILE = Makefile
|
||
|
|
||
|
# Debugging format.
|
||
|
# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2.
|
||
|
# AVR (extended) COFF requires stabs, plus an avr-objcopy run.
|
||
|
DEBUG = stabs
|
||
|
|
||
13 years ago
|
OPT = s
|
||
13 years ago
|
|
||
12 years ago
|
DEFINES ?=
|
||
|
|
||
12 years ago
|
# Program settings
|
||
6 years ago
|
CC = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-gcc
|
||
|
CXX = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-g++
|
||
|
OBJCOPY = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-objcopy
|
||
|
OBJDUMP = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-objdump
|
||
|
AR = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-ar
|
||
|
SIZE = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-size
|
||
|
NM = $(AVR_TOOLS_PATH)$(TOOL_PREFIX)-nm
|
||
12 years ago
|
AVRDUDE = avrdude
|
||
|
REMOVE = rm -f
|
||
|
MV = mv -f
|
||
|
|
||
13 years ago
|
# Place -D or -U options here
|
||
6 years ago
|
CDEFS = -DF_CPU=$(F_CPU) ${addprefix -D , $(DEFINES)} -DARDUINO=$(ARDUINO_VERSION)
|
||
12 years ago
|
CXXDEFS = $(CDEFS)
|
||
|
|
||
|
ifeq ($(HARDWARE_VARIANT), Teensy)
|
||
6 years ago
|
CDEFS += -DUSB_SERIAL
|
||
|
LIB_SRC += usb.c pins_teensy.c
|
||
|
LIB_CXXSRC += usb_api.cpp
|
||
|
|
||
|
else ifeq ($(HARDWARE_VARIANT), archim)
|
||
|
CDEFS += -DARDUINO_SAM_ARCHIM -DARDUINO_ARCH_SAM -D__SAM3X8E__ -DUSB_VID=0x27b1 -DUSB_PID=0x0001 -DUSBCON '-DUSB_MANUFACTURER="UltiMachine"' '-DUSB_PRODUCT="Archim"'
|
||
|
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
|
||
|
LIB_SRC += cortex_handlers.c iar_calls_sam3.c syscalls_sam3.c dtostrf.c itoa.c
|
||
6 years ago
|
|
||
|
ifeq ($(U8GLIB), 1)
|
||
|
LIB_SRC += u8g_com_api.c u8g_pb32h1.c
|
||
|
endif
|
||
12 years ago
|
endif
|
||
13 years ago
|
|
||
13 years ago
|
# Add all the source directories as include directories too
|
||
13 years ago
|
CINCS = ${addprefix -I ,${VPATH}}
|
||
|
CXXINCS = ${addprefix -I ,${VPATH}}
|
||
13 years ago
|
|
||
6 years ago
|
# Silence warnings for library code (won't work for .h files, unfortunately)
|
||
|
LIBWARN = -w -Wno-packed-bitfield-compat
|
||
|
|
||
8 years ago
|
# Compiler flag to set the C/CPP Standard level.
|
||
|
CSTANDARD = -std=gnu99
|
||
|
CXXSTANDARD = -std=gnu++11
|
||
13 years ago
|
CDEBUG = -g$(DEBUG)
|
||
5 years ago
|
CWARN = -Wall -Wstrict-prototypes -Wno-packed-bitfield-compat -Wno-pragmas -Wunused-parameter
|
||
|
CXXWARN = -Wall -Wno-packed-bitfield-compat -Wno-pragmas -Wunused-parameter
|
||
5 years ago
|
CTUNING = -fsigned-char -funsigned-bitfields -fno-exceptions \
|
||
6 years ago
|
-fshort-enums -ffunction-sections -fdata-sections
|
||
12 years ago
|
ifneq ($(HARDWARE_MOTHERBOARD),)
|
||
6 years ago
|
CTUNING += -DMOTHERBOARD=${HARDWARE_MOTHERBOARD}
|
||
13 years ago
|
endif
|
||
13 years ago
|
#CEXTRA = -Wa,-adhlns=$(<:.c=.lst)
|
||
6 years ago
|
CXXEXTRA = -fno-use-cxa-atexit -fno-threadsafe-statics -fno-rtti
|
||
|
CFLAGS := $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CEXTRA) $(CTUNING) $(CSTANDARD)
|
||
|
CXXFLAGS := $(CDEFS) $(CINCS) -O$(OPT) $(CXXEXTRA) $(CTUNING) $(CXXSTANDARD)
|
||
|
ASFLAGS := $(CDEFS)
|
||
12 years ago
|
#ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
|
||
6 years ago
|
ifeq ($(HARDWARE_VARIANT), archim)
|
||
|
LD_PREFIX = -Wl,--gc-sections,-Map,Marlin.ino.map,--cref,--check-sections,--entry=Reset_Handler,--unresolved-symbols=report-all,--warn-common,--warn-section-align
|
||
|
LD_SUFFIX = $(LDLIBS)
|
||
6 years ago
|
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
|
||
6 years ago
|
else
|
||
|
LD_PREFIX = -Wl,--gc-sections,--relax
|
||
|
LDFLAGS = -lm
|
||
|
CTUNING += -flto
|
||
|
endif
|
||
13 years ago
|
|
||
13 years ago
|
# Programming support using avrdude. Settings and variables.
|
||
12 years ago
|
AVRDUDE_PORT = $(UPLOAD_PORT)
|
||
10 years ago
|
AVRDUDE_WRITE_FLASH = -Uflash:w:$(BUILD_DIR)/$(TARGET).hex:i
|
||
12 years ago
|
ifeq ($(shell uname -s), Linux)
|
||
6 years ago
|
AVRDUDE_CONF = /etc/avrdude/avrdude.conf
|
||
12 years ago
|
else
|
||
6 years ago
|
AVRDUDE_CONF = $(ARDUINO_INSTALL_DIR)/hardware/tools/avr/etc/avrdude.conf
|
||
12 years ago
|
endif
|
||
10 years ago
|
AVRDUDE_FLAGS = -D -C$(AVRDUDE_CONF) \
|
||
6 years ago
|
-p$(MCU) -P$(AVRDUDE_PORT) -c$(AVRDUDE_PROGRAMMER) \
|
||
|
-b$(UPLOAD_RATE)
|
||
13 years ago
|
|
||
7 years ago
|
# Since Marlin 2.0, the source files may be distributed into several
|
||
|
# different directories, so it is necessary to find them recursively
|
||
|
|
||
|
SRC = $(shell find src -name '*.c' -type f)
|
||
|
CXXSRC = $(shell find src -name '*.cpp' -type f)
|
||
|
|
||
13 years ago
|
# Define all object files.
|
||
7 years ago
|
OBJ = ${patsubst %.c, $(BUILD_DIR)/arduino/%.o, ${LIB_SRC}}
|
||
|
OBJ += ${patsubst %.cpp, $(BUILD_DIR)/arduino/%.o, ${LIB_CXXSRC}}
|
||
|
OBJ += ${patsubst %.S, $(BUILD_DIR)/arduino/%.o, ${LIB_ASRC}}
|
||
|
OBJ += ${patsubst %.c, $(BUILD_DIR)/%.o, ${SRC}}
|
||
12 years ago
|
OBJ += ${patsubst %.cpp, $(BUILD_DIR)/%.o, ${CXXSRC}}
|
||
13 years ago
|
|
||
|
# Define all listing files.
|
||
7 years ago
|
LST = $(LIB_ASRC:.S=.lst) $(LIB_CXXSRC:.cpp=.lst) $(LIB_SRC:.c=.lst)
|
||
13 years ago
|
|
||
|
# Combine all necessary flags and optional flags.
|
||
|
# Add target processor to flags.
|
||
6 years ago
|
ALL_CFLAGS = $(MCU_FLAGS) $(CPU_FLAGS) $(CFLAGS) -I.
|
||
|
ALL_CXXFLAGS = $(MCU_FLAGS) $(CPU_FLAGS) $(CXXFLAGS)
|
||
|
ALL_ASFLAGS = $(MCU_FLAGS) $(CPU_FLAGS) $(ASFLAGS) -x assembler-with-cpp
|
||
13 years ago
|
|
||
13 years ago
|
# set V=1 (eg, "make V=1") to print the full commands etc.
|
||
|
ifneq ($V,1)
|
||
6 years ago
|
Pecho=@echo
|
||
|
P=@
|
||
13 years ago
|
else
|
||
6 years ago
|
Pecho=@:
|
||
|
P=
|
||
13 years ago
|
endif
|
||
13 years ago
|
|
||
7 years ago
|
# Create required build hierarchy if it does not exist
|
||
|
|
||
|
$(shell mkdir -p $(dir $(OBJ)))
|
||
|
|
||
13 years ago
|
# Default target.
|
||
13 years ago
|
all: sizeafter
|
||
13 years ago
|
|
||
6 years ago
|
build: elf hex bin
|
||
12 years ago
|
|
||
|
elf: $(BUILD_DIR)/$(TARGET).elf
|
||
6 years ago
|
bin: $(BUILD_DIR)/$(TARGET).bin
|
||
12 years ago
|
hex: $(BUILD_DIR)/$(TARGET).hex
|
||
|
eep: $(BUILD_DIR)/$(TARGET).eep
|
||
12 years ago
|
lss: $(BUILD_DIR)/$(TARGET).lss
|
||
12 years ago
|
sym: $(BUILD_DIR)/$(TARGET).sym
|
||
13 years ago
|
|
||
12 years ago
|
# Program the device.
|
||
9 years ago
|
# Do not try to reset an Arduino if it's not one
|
||
12 years ago
|
upload: $(BUILD_DIR)/$(TARGET).hex
|
||
13 years ago
|
ifeq (${AVRDUDE_PROGRAMMER}, arduino)
|
||
5 years ago
|
stty hup < $(UPLOAD_PORT); true
|
||
13 years ago
|
endif
|
||
5 years ago
|
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH)
|
||
13 years ago
|
ifeq (${AVRDUDE_PROGRAMMER}, arduino)
|
||
5 years ago
|
stty -hup < $(UPLOAD_PORT); true
|
||
13 years ago
|
endif
|
||
13 years ago
|
|
||
6 years ago
|
# Display size of file.
|
||
12 years ago
|
HEXSIZE = $(SIZE) --target=$(FORMAT) $(BUILD_DIR)/$(TARGET).hex
|
||
6 years ago
|
ELFSIZE = $(SIZE) $(SIZE_FLAGS) $(BUILD_DIR)/$(TARGET).elf; \
|
||
12 years ago
|
$(SIZE) $(BUILD_DIR)/$(TARGET).elf
|
||
13 years ago
|
sizebefore:
|
||
5 years ago
|
$P if [ -f $(BUILD_DIR)/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(HEXSIZE); echo; fi
|
||
13 years ago
|
|
||
13 years ago
|
sizeafter: build
|
||
5 years ago
|
$P if [ -f $(BUILD_DIR)/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi
|
||
13 years ago
|
|
||
13 years ago
|
|
||
13 years ago
|
# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
|
||
|
COFFCONVERT=$(OBJCOPY) --debugging \
|
||
6 years ago
|
--change-section-address .data-0x800000 \
|
||
|
--change-section-address .bss-0x800000 \
|
||
|
--change-section-address .noinit-0x800000 \
|
||
|
--change-section-address .eeprom-0x810000
|
||
13 years ago
|
|
||
13 years ago
|
|
||
12 years ago
|
coff: $(BUILD_DIR)/$(TARGET).elf
|
||
5 years ago
|
$(COFFCONVERT) -O coff-avr $(BUILD_DIR)/$(TARGET).elf $(TARGET).cof
|
||
13 years ago
|
|
||
13 years ago
|
|
||
13 years ago
|
extcoff: $(TARGET).elf
|
||
5 years ago
|
$(COFFCONVERT) -O coff-ext-avr $(BUILD_DIR)/$(TARGET).elf $(TARGET).cof
|
||
13 years ago
|
|
||
13 years ago
|
|
||
6 years ago
|
.SUFFIXES: .elf .hex .eep .lss .sym .bin
|
||
13 years ago
|
.PRECIOUS: .o
|
||
13 years ago
|
|
||
|
.elf.hex:
|
||
5 years ago
|
$(Pecho) " COPY $@"
|
||
|
$P $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
|
||
6 years ago
|
|
||
|
.elf.bin:
|
||
5 years ago
|
$(Pecho) " COPY $@"
|
||
|
$P $(OBJCOPY) -O binary -R .eeprom $< $@
|
||
13 years ago
|
|
||
|
.elf.eep:
|
||
5 years ago
|
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
|
||
6 years ago
|
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@
|
||
13 years ago
|
|
||
|
# Create extended listing file from ELF output file.
|
||
|
.elf.lss:
|
||
5 years ago
|
$(OBJDUMP) -h -S $< > $@
|
||
13 years ago
|
|
||
|
# Create a symbol table from ELF output file.
|
||
|
.elf.sym:
|
||
5 years ago
|
$(NM) -n $< > $@
|
||
13 years ago
|
|
||
6 years ago
|
# Link: create ELF output file from library.
|
||
7 years ago
|
|
||
12 years ago
|
$(BUILD_DIR)/$(TARGET).elf: $(OBJ) Configuration.h
|
||
5 years ago
|
$(Pecho) " CXX $@"
|
||
|
$P $(CC) $(LD_PREFIX) $(ALL_CXXFLAGS) -o $@ -L. $(OBJ) $(LDFLAGS) $(LD_SUFFIX)
|
||
13 years ago
|
|
||
7 years ago
|
# Object files that were found in "src" will be stored in $(BUILD_DIR)
|
||
|
# in directories that mirror the structure of "src"
|
||
|
|
||
12 years ago
|
$(BUILD_DIR)/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE)
|
||
5 years ago
|
$(Pecho) " CC $<"
|
||
|
$P $(CC) -MMD -c $(ALL_CFLAGS) $(CWARN) $< -o $@
|
||
13 years ago
|
|
||
7 years ago
|
$(BUILD_DIR)/%.o: %.cpp Configuration.h Configuration_adv.h $(MAKEFILE)
|
||
5 years ago
|
$(Pecho) " CXX $<"
|
||
|
$P $(CXX) -MMD -c $(ALL_CXXFLAGS) $(CXXWARN) $< -o $@
|
||
12 years ago
|
|
||
7 years ago
|
# Object files for Arduino libs will be created in $(BUILD_DIR)/arduino
|
||
|
|
||
|
$(BUILD_DIR)/arduino/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE)
|
||
5 years ago
|
$(Pecho) " CC $<"
|
||
|
$P $(CC) -MMD -c $(ALL_CFLAGS) $(LIBWARN) $< -o $@
|
||
7 years ago
|
|
||
|
$(BUILD_DIR)/arduino/%.o: %.cpp Configuration.h Configuration_adv.h $(MAKEFILE)
|
||
5 years ago
|
$(Pecho) " CXX $<"
|
||
|
$P $(CXX) -MMD -c $(ALL_CXXFLAGS) $(LIBWARN) $< -o $@
|
||
6 years ago
|
|
||
|
$(BUILD_DIR)/arduino/%.o: %.S $(MAKEFILE)
|
||
5 years ago
|
$(Pecho) " CXX $<"
|
||
|
$P $(CXX) -MMD -c $(ALL_ASFLAGS) $< -o $@
|
||
13 years ago
|
|
||
13 years ago
|
# Target: clean project.
|
||
14 years ago
|
clean:
|
||
5 years ago
|
$(Pecho) " RMDIR $(BUILD_DIR)/"
|
||
|
$P rm -rf $(BUILD_DIR)
|
||
13 years ago
|
|
||
13 years ago
|
|
||
6 years ago
|
.PHONY: all build elf hex eep lss sym program coff extcoff clean depend sizebefore sizeafter
|
||
13 years ago
|
|
||
|
# Automaticaly include the dependency files created by gcc
|
||
7 years ago
|
-include ${patsubst %.o, %.d, ${OBJ}}
|