123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035 |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- HARDWARE_MOTHERBOARD ?= 1020
-
- ifeq ($(OS),Windows_NT)
-
- ARDUINO_INSTALL_DIR ?= ${HOME}/Arduino
- ARDUINO_USER_DIR ?= ${HOME}/Arduino
- else
- UNAME_S := $(shell uname -s)
- ifeq ($(UNAME_S),Linux)
-
- ARDUINO_INSTALL_DIR ?= /usr/share/arduino
- ARDUINO_USER_DIR ?= ${HOME}/Arduino
- endif
- ifeq ($(UNAME_S),Darwin)
-
- ARDUINO_INSTALL_DIR ?= /Applications/Arduino.app/Contents/Java
- ARDUINO_USER_DIR ?= ${HOME}/Documents/Arduino
- AVR_TOOLS_PATH ?= /Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/
- endif
- endif
-
-
-
- ARDUINO_INSTALL_DIR ?= ${HOME}/Arduino
- ARDUINO_VERSION ?= 106
-
-
- ARDUINO_USER_DIR ?= ${HOME}/Arduino
-
-
-
- AVR_TOOLS_PATH ?=
-
-
- UPLOAD_RATE ?= 57600
- AVRDUDE_PROGRAMMER ?= arduino
-
- UPLOAD_PORT ?= /dev/ttyUSB0
-
-
-
-
- BUILD_DIR ?= applet
-
-
- LIQUID_TWI2 ?= 0
-
-
- WIRE ?= 0
-
-
-
- TONE ?= 1
-
-
- U8GLIB ?= 0
-
-
- TMC ?= 0
-
-
- NEOPIXEL ?= 0
-
-
-
-
-
-
- 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)
- $(warning This GCC version $(CC_VER) is likely broken. Enabling relocation workaround.)
- RELOC_WORKAROUND = 1
- endif
-
-
-
-
-
-
-
-
- ifeq ($(HARDWARE_MOTHERBOARD),0)
-
-
-
-
-
-
-
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1000)
-
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1010)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1011)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1012)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1013)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1014)
-
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1020)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1021)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1022)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1023)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1024)
-
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1030)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1031)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1032)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1033)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1034)
-
-
-
-
-
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1100)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1101)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1102)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1103)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1104)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1105)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1106)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1107)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1108)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1109)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1110)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1111)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1112)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1113)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1114)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1115)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1116)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1117)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1118)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1119)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1120)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1121)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1122)
- MCU ?= atmega1280
- PROG_MCU ?= m1280
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1123)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1124)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1125)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1126)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1127)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1128)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1129)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1130)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1131)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1132)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1133)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1134)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1135)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1136)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1137)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1138)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1139)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1140)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1141)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1142)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1143)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1144)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1145)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1146)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1147)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1148)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1149)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1150)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1151)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1152)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1153)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1154)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1155)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1156)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1157)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1158)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1159)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1160)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1161)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1162)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1163)
-
-
-
-
-
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1200)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1201)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1202)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1203)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1204)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1205)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1206)
-
-
-
-
-
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1300)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1301)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1302)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1303)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1304)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1305)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1306)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1307)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1308)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1309)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1310)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1311)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1312)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1313)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1314)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1315)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1316)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1317)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1318)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1319)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1320)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1321)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1322)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1323)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1324)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1325)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1326)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1327)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1328)
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1329)
-
-
-
-
-
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1400)
- MCU ?= atmega1281
- PROG_MCU ?= m1281
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1401)
- MCU ?= atmega1281
- PROG_MCU ?= m1281
-
-
-
-
-
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1500)
- HARDWARE_VARIANT ?= Sanguino
- MCU ?= atmega644p
- PROG_MCU ?= m644p
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1501)
- HARDWARE_VARIANT ?= Sanguino
- MCU ?= atmega644p
- PROG_MCU ?= m644p
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1502)
- HARDWARE_VARIANT ?= Sanguino
- MCU ?= atmega644p
- PROG_MCU ?= m644p
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1503)
- HARDWARE_VARIANT ?= Sanguino
- MCU ?= atmega1284p
- PROG_MCU ?= m1284p
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1504)
- HARDWARE_VARIANT ?= Sanguino
- MCU ?= atmega1284p
- PROG_MCU ?= m1284p
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1505)
- HARDWARE_VARIANT ?= Sanguino
- MCU ?= atmega1284p
- PROG_MCU ?= m1284p
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1506)
- HARDWARE_VARIANT ?= Sanguino
- MCU ?= atmega1284p
- PROG_MCU ?= m1284p
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1507)
- HARDWARE_VARIANT ?= Sanguino
- MCU ?= atmega1284p
- PROG_MCU ?= m1284p
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1508)
- HARDWARE_VARIANT ?= Sanguino
- MCU ?= atmega1284p
- PROG_MCU ?= m1284p
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1509)
- HARDWARE_VARIANT ?= Sanguino
- MCU ?= atmega1284p
- PROG_MCU ?= m1284p
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1510)
- HARDWARE_VARIANT ?= Sanguino
- MCU ?= atmega1284p
- PROG_MCU ?= m1284p
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1511)
- HARDWARE_VARIANT ?= Sanguino
- MCU ?= atmega1284p
- PROG_MCU ?= m1284p
-
-
-
-
-
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1600)
- HARDWARE_VARIANT ?= Sanguino
- MCU ?= atmega644p
- PROG_MCU ?= m644p
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1601)
- HARDWARE_VARIANT ?= Sanguino
- MCU ?= atmega644p
- PROG_MCU ?= m644p
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1602)
- HARDWARE_VARIANT ?= Gen6
- MCU ?= atmega644p
- PROG_MCU ?= m644p
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1603)
- HARDWARE_VARIANT ?= Gen6
- MCU ?= atmega644p
- PROG_MCU ?= m644p
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1604)
- HARDWARE_VARIANT ?= Gen7
- MCU ?= atmega644
- PROG_MCU ?= m644
- F_CPU ?= 20000000
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1605)
- HARDWARE_VARIANT ?= Gen7
- MCU ?= atmega644p
- PROG_MCU ?= m644p
- F_CPU ?= 20000000
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1606)
- HARDWARE_VARIANT ?= Gen7
- MCU ?= atmega644p
- PROG_MCU ?= m644p
- F_CPU ?= 20000000
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1607)
- HARDWARE_VARIANT ?= Gen7
- MCU ?= atmega1284p
- PROG_MCU ?= m1284p
- F_CPU ?= 20000000
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1608)
- HARDWARE_VARIANT ?= SanguinoA
- MCU ?= atmega644
- PROG_MCU ?= m644
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1609)
- HARDWARE_VARIANT ?= Sanguino
- MCU ?= atmega644p
- PROG_MCU ?= m644p
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1610)
- HARDWARE_VARIANT ?= Sanguino
- MCU ?= atmega644p
- PROG_MCU ?= m644p
-
-
-
-
-
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1700)
- HARDWARE_VARIANT ?= Teensy
- MCU ?= at90usb1286
- PROG_MCU ?= usb1286
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1701)
- HARDWARE_VARIANT ?= Teensy
- MCU ?= at90usb1286
- PROG_MCU ?= usb1286
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1702)
- HARDWARE_VARIANT ?= Teensy
- MCU ?= at90usb1286
- PROG_MCU ?= usb1286
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1703)
- HARDWARE_VARIANT ?= Teensy
- MCU ?= at90usb646
- PROG_MCU ?= usb646
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1704)
- HARDWARE_VARIANT ?= Teensy
- MCU ?= at90usb1286
- PROG_MCU ?= usb1286
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1705)
- HARDWARE_VARIANT ?= Teensy
- MCU ?= at90usb1286
- PROG_MCU ?= usb1286
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1706)
- HARDWARE_VARIANT ?= Teensy
- MCU ?= at90usb1286
- PROG_MCU ?= usb1286
-
- else ifeq ($(HARDWARE_MOTHERBOARD),1707)
- HARDWARE_VARIANT ?= Teensy
- MCU ?= at90usb1286
- PROG_MCU ?= usb1286
-
-
- else ifeq ($(HARDWARE_MOTHERBOARD),3023)
- HARDWARE_VARIANT ?= archim
- MCPU = cortex-m3
- F_CPU = 84000000
- IS_MCU = 0
-
- else ifeq ($(HARDWARE_MOTHERBOARD),3024)
- HARDWARE_VARIANT ?= archim
- MCPU = cortex-m3
- F_CPU = 84000000
- IS_MCU = 0
- endif
-
-
-
-
-
- F_CPU ?= 16000000
-
-
- IS_MCU ?= 1
-
- ifeq ($(IS_MCU),1)
-
- HARDWARE_VARIANT ?= arduino
- MCU ?= atmega2560
- PROG_MCU ?= m2560
-
- 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
-
-
-
-
-
-
- TARGET = $(notdir $(CURDIR))
-
-
-
-
-
-
-
-
-
- VPATH = .
- VPATH += $(BUILD_DIR)
- VPATH += $(HARDWARE_SRC)
-
- ifeq ($(HARDWARE_VARIANT), $(filter $(HARDWARE_VARIANT),arduino Teensy Sanguino))
-
- VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI
-
- VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI/src
- endif
-
- 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/SoftwareSerial
-
- VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI/src
- VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SoftwareSerial/src
- endif
-
- VPATH += $(ARDUINO_INSTALL_DIR)/libraries/LiquidCrystal/src
-
- ifeq ($(LIQUID_TWI2), 1)
- WIRE = 1
- VPATH += $(ARDUINO_INSTALL_DIR)/libraries/LiquidTWI2
- endif
- ifeq ($(WIRE), 1)
-
- VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/Wire
- VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/Wire/utility
-
- VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/Wire/src
- VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/Wire/src/utility
- endif
- ifeq ($(NEOPIXEL), 1)
- VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Adafruit_NeoPixel
- endif
- ifeq ($(U8GLIB), 1)
- VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib
- VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/csrc
- VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/cppsrc
- VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/fntsrc
- endif
- ifeq ($(TMC), 1)
- VPATH += $(ARDUINO_INSTALL_DIR)/libraries/TMCStepper/src
- VPATH += $(ARDUINO_INSTALL_DIR)/libraries/TMCStepper/src/source
- endif
-
- ifeq ($(HARDWARE_VARIANT), arduino)
- 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
- VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/libraries/U8glib/src/clib
- 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
- else
- HARDWARE_SUB_VARIANT ?= standard
- VPATH += $(ARDUINO_INSTALL_DIR)/hardware/$(HARDWARE_VARIANT)/variants/$(HARDWARE_SUB_VARIANT)
- endif
-
- LIB_SRC = wiring.c \
- 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
-
- ifeq ($(HARDWARE_VARIANT), Teensy)
- LIB_SRC = wiring.c
- VPATH += $(ARDUINO_INSTALL_DIR)/hardware/teensy/cores/teensy
- endif
-
- LIB_CXXSRC = WMath.cpp WString.cpp Print.cpp SPI.cpp
-
- ifeq ($(NEOPIXEL), 1)
- LIB_CXXSRC += Adafruit_NeoPixel.cpp
- endif
-
- ifeq ($(LIQUID_TWI2), 0)
- LIB_CXXSRC += LiquidCrystal.cpp
- else
- LIB_SRC += twi.c
- LIB_CXXSRC += Wire.cpp LiquidTWI2.cpp
- endif
-
- ifeq ($(WIRE), 1)
- LIB_SRC += twi.c
- LIB_CXXSRC += Wire.cpp
- endif
-
- ifeq ($(TONE), 1)
- LIB_CXXSRC += Tone.cpp
- endif
-
- ifeq ($(U8GLIB), 1)
- 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
- endif
-
- ifeq ($(TMC), 1)
- 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
- endif
-
- ifeq ($(RELOC_WORKAROUND), 1)
- LD_PREFIX=-nodefaultlibs
- LD_SUFFIX=-lm -lgcc -lc -lgcc
- endif
-
-
- ifeq ($(shell [ $(ARDUINO_VERSION) -ge 100 ] && echo true), true)
- LIB_CXXSRC += main.cpp
- else
- LIB_SRC += pins_arduino.c main.c
- endif
-
- FORMAT = ihex
-
-
- MAKEFILE = Makefile
-
-
-
-
- DEBUG = stabs
-
- OPT = s
-
- DEFINES ?=
-
-
- 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
- AVRDUDE = avrdude
- REMOVE = rm -f
- MV = mv -f
-
-
- CDEFS = -DF_CPU=$(F_CPU)UL ${addprefix -D , $(DEFINES)} -DARDUINO=$(ARDUINO_VERSION)
- CXXDEFS = $(CDEFS)
-
- ifeq ($(HARDWARE_VARIANT), Teensy)
- 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__
- CDEFS += -DUSB_VID=0x27B1 -DUSB_PID=0x0001 -DUSBCON
- CDEFS += '-DUSB_MANUFACTURER="UltiMachine"' '-DUSB_PRODUCT_STRING="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
-
- ifeq ($(U8GLIB), 1)
- LIB_SRC += u8g_com_api.c u8g_pb32h1.c
- endif
- endif
-
-
- CINCS = ${addprefix -I ,${VPATH}}
- CXXINCS = ${addprefix -I ,${VPATH}}
-
-
- LIBWARN = -w -Wno-packed-bitfield-compat
-
-
- CSTANDARD = -std=gnu99
- CXXSTANDARD = -std=gnu++11
- CDEBUG = -g$(DEBUG)
- CWARN = -Wall -Wstrict-prototypes -Wno-packed-bitfield-compat -Wno-pragmas -Wunused-parameter
- CXXWARN = -Wall -Wno-packed-bitfield-compat -Wno-pragmas -Wunused-parameter
- CTUNING = -fsigned-char -funsigned-bitfields -fno-exceptions \
- -fshort-enums -ffunction-sections -fdata-sections
- ifneq ($(HARDWARE_MOTHERBOARD),)
- CTUNING += -DMOTHERBOARD=${HARDWARE_MOTHERBOARD}
- endif
-
-
- 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)
-
-
- 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)
-
- LDFLAGS = -lm -T$(LDSCRIPT) -u _sbrk -u link -u _close -u _fstat -u _isatty
- LDFLAGS += -u _lseek -u _read -u _write -u _exit -u kill -u _getpid
- else
- LD_PREFIX = -Wl,--gc-sections,--relax
- LDFLAGS = -lm
- CTUNING += -flto
- endif
-
-
- AVRDUDE_PORT = $(UPLOAD_PORT)
- AVRDUDE_WRITE_FLASH = -Uflash:w:$(BUILD_DIR)/$(TARGET).hex:i
- ifeq ($(shell uname -s), Linux)
- AVRDUDE_CONF = /etc/avrdude/avrdude.conf
- else
- AVRDUDE_CONF = $(ARDUINO_INSTALL_DIR)/hardware/tools/avr/etc/avrdude.conf
- endif
- AVRDUDE_FLAGS = -D -C$(AVRDUDE_CONF) \
- -p$(PROG_MCU) -P$(AVRDUDE_PORT) -c$(AVRDUDE_PROGRAMMER) \
- -b$(UPLOAD_RATE)
-
-
-
-
- SRC = $(shell find src -name '*.c' -type f)
- CXXSRC = $(shell find src -name '*.cpp' -type f)
-
-
- 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}}
- OBJ += ${patsubst %.cpp, $(BUILD_DIR)/%.o, ${CXXSRC}}
-
-
- LST = $(LIB_ASRC:.S=.lst) $(LIB_CXXSRC:.cpp=.lst) $(LIB_SRC:.c=.lst)
-
-
-
- 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
-
-
- ifneq ($V,1)
- Pecho=@echo
- P=@
- else
- Pecho=@:
- P=
- endif
-
-
-
- $(shell mkdir -p $(dir $(OBJ)))
-
-
- all: sizeafter
-
- build: elf hex bin
-
- elf: $(BUILD_DIR)/$(TARGET).elf
- bin: $(BUILD_DIR)/$(TARGET).bin
- hex: $(BUILD_DIR)/$(TARGET).hex
- eep: $(BUILD_DIR)/$(TARGET).eep
- lss: $(BUILD_DIR)/$(TARGET).lss
- sym: $(BUILD_DIR)/$(TARGET).sym
-
-
-
- upload: $(BUILD_DIR)/$(TARGET).hex
- ifeq (${AVRDUDE_PROGRAMMER}, arduino)
- stty hup < $(UPLOAD_PORT); true
- endif
- $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH)
- ifeq (${AVRDUDE_PROGRAMMER}, arduino)
- stty -hup < $(UPLOAD_PORT); true
- endif
-
-
- HEXSIZE = $(SIZE) --target=$(FORMAT) $(BUILD_DIR)/$(TARGET).hex
- ELFSIZE = $(SIZE) $(SIZE_FLAGS) $(BUILD_DIR)/$(TARGET).elf; \
- $(SIZE) $(BUILD_DIR)/$(TARGET).elf
- sizebefore:
- $P if [ -f $(BUILD_DIR)/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(HEXSIZE); echo; fi
-
- sizeafter: build
- $P if [ -f $(BUILD_DIR)/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); echo; fi
-
-
-
- COFFCONVERT=$(OBJCOPY) --debugging \
- --change-section-address .data-0x800000 \
- --change-section-address .bss-0x800000 \
- --change-section-address .noinit-0x800000 \
- --change-section-address .eeprom-0x810000
-
-
- coff: $(BUILD_DIR)/$(TARGET).elf
- $(COFFCONVERT) -O coff-avr $(BUILD_DIR)/$(TARGET).elf $(TARGET).cof
-
-
- extcoff: $(TARGET).elf
- $(COFFCONVERT) -O coff-ext-avr $(BUILD_DIR)/$(TARGET).elf $(TARGET).cof
-
-
- .SUFFIXES: .elf .hex .eep .lss .sym .bin
- .PRECIOUS: .o
-
- .elf.hex:
- $(Pecho) " COPY $@"
- $P $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
-
- .elf.bin:
- $(Pecho) " COPY $@"
- $P $(OBJCOPY) -O binary -R .eeprom $< $@
-
- .elf.eep:
- -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
- --change-section-lma .eeprom=0 -O $(FORMAT) $< $@
-
-
- .elf.lss:
- $(OBJDUMP) -h -S $< > $@
-
-
- .elf.sym:
- $(NM) -n $< > $@
-
-
-
- $(BUILD_DIR)/$(TARGET).elf: $(OBJ) Configuration.h
- $(Pecho) " CXX $@"
- $P $(CXX) $(LD_PREFIX) $(ALL_CXXFLAGS) -o $@ -L. $(OBJ) $(LDFLAGS) $(LD_SUFFIX)
-
-
-
-
- $(BUILD_DIR)/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE)
- $(Pecho) " CC $<"
- $P $(CC) -MMD -c $(ALL_CFLAGS) $(CWARN) $< -o $@
-
- $(BUILD_DIR)/%.o: %.cpp Configuration.h Configuration_adv.h $(MAKEFILE)
- $(Pecho) " CXX $<"
- $P $(CXX) -MMD -c $(ALL_CXXFLAGS) $(CXXWARN) $< -o $@
-
-
-
- $(BUILD_DIR)/arduino/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE)
- $(Pecho) " CC $<"
- $P $(CC) -MMD -c $(ALL_CFLAGS) $(LIBWARN) $< -o $@
-
- $(BUILD_DIR)/arduino/%.o: %.cpp Configuration.h Configuration_adv.h $(MAKEFILE)
- $(Pecho) " CXX $<"
- $P $(CXX) -MMD -c $(ALL_CXXFLAGS) $(LIBWARN) $< -o $@
-
- $(BUILD_DIR)/arduino/%.o: %.S $(MAKEFILE)
- $(Pecho) " CXX $<"
- $P $(CXX) -MMD -c $(ALL_ASFLAGS) $< -o $@
-
-
- clean:
- $(Pecho) " RMDIR $(BUILD_DIR)/"
- $P rm -rf $(BUILD_DIR)
-
-
- .PHONY: all build elf hex eep lss sym program coff extcoff clean depend sizebefore sizeafter
-
-
- -include ${patsubst %.o, %.d, ${OBJ}}
|