@ -89,8 +89,8 @@ WIRE ?= 0
# this defines if U8GLIB is needed (may require RELOC_WORKAROUND)
# this defines if U8GLIB is needed (may require RELOC_WORKAROUND)
U8GLIB ?= 1
U8GLIB ?= 1
# this defines whether to include the Trinamic TMC 2630 Stepper
# this defines whether to include the Trinamic TMC Stepper library
TMC 2630 ?= 1
TMC ?= 1
############
############
# Try to automatically determine whether RELOC_WORKAROUND is needed based
# Try to automatically determine whether RELOC_WORKAROUND is needed based
@ -404,6 +404,12 @@ else ifeq ($(HARDWARE_MOTHERBOARD),88)
HARDWARE_VARIANT ?= Teensy
HARDWARE_VARIANT ?= Teensy
MCU ?= at90usb1286
MCU ?= at90usb1286
# UltiMachine Archim2 (with TMC2130 drivers)
e l s e i f e q ( $( HARDWARE_MOTHERBOARD ) , 1 5 9 0 )
HARDWARE_VARIANT ?= archim
MCPU = cortex-m3
F_CPU = 84000000L
IS_MCU = 0
e n d i f
e n d i f
# Be sure to regenerate speed_lookuptable.h with create_speed_lookuptable.py
# Be sure to regenerate speed_lookuptable.h with create_speed_lookuptable.py
@ -411,10 +417,23 @@ endif
# Set to 16Mhz if not yet set.
# Set to 16Mhz if not yet set.
F_CPU ?= 16000000
F_CPU ?= 16000000
# Set to microcontroller if IS_MCU not yet set
IS_MCU ?= 1
i f e q ( $( IS_MCU ) , 1 )
# Set to arduino, ATmega2560 if not yet set.
# Set to arduino, ATmega2560 if not yet set.
HARDWARE_VARIANT ?= arduino
HARDWARE_VARIANT ?= arduino
MCU ?= atmega2560
MCU ?= atmega2560
TOOL_PREFIX = avr
MCU_FLAGS = -mmcu= $( MCU)
SIZE_FLAGS = --mcu= $( MCU) -C
e l s e
TOOL_PREFIX = arm-none-eabi
CPU_FLAGS = -mthumb -mcpu= $( MCPU)
SIZE_FLAGS = -A
e n d i f
# Arduino contained the main source code for the Arduino
# Arduino contained the main source code for the Arduino
# Libraries, the "hardware variant" are for boards
# Libraries, the "hardware variant" are for boards
# that derives from that, and their source are present in
# that derives from that, and their source are present in
@ -434,19 +453,19 @@ VPATH = .
VPATH += $( BUILD_DIR)
VPATH += $( BUILD_DIR)
VPATH += $( HARDWARE_SRC)
VPATH += $( HARDWARE_SRC)
# U8glib
VPATH += $( ARDUINO_USER_DIR) /libraries/U8glib
VPATH += $( ARDUINO_USER_DIR) /libraries/U8glib/clib
i f e q ( $( HARDWARE_VARIANT ) , $( filter $ ( HARDWARE_VARIANT ) ,arduino Teensy Sanguino ) )
i f e q ( $( 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/LiquidCrystal/src
VPATH += $( ARDUINO_INSTALL_DIR) /hardware/marlin/avr/libraries/SPI
VPATH += $( ARDUINO_INSTALL_DIR) /hardware/marlin/avr/libraries/SPI
e n d i f
e n d i f
i f e q ( $( IS_MCU ) , 1 )
VPATH += $( ARDUINO_INSTALL_DIR) /hardware/arduino/avr/cores/arduino
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
VPATH += $( ARDUINO_INSTALL_DIR) /hardware/arduino/avr/libraries/SPI/src
VPATH += $( ARDUINO_INSTALL_DIR) /hardware/arduino/avr/libraries/SPI/src
VPATH += $( ARDUINO_INSTALL_DIR) /hardware/arduino/avr/libraries/SoftwareSerial/src
e n d i f
VPATH += $( ARDUINO_INSTALL_DIR) /libraries/LiquidCrystal/src
VPATH += $( ARDUINO_INSTALL_DIR) /libraries/LiquidCrystal/src
i f e q ( $( LIQUID_TWI 2) , 1 )
i f e q ( $( LIQUID_TWI 2) , 1 )
VPATH += $( ARDUINO_INSTALL_DIR) /libraries/Wire
VPATH += $( ARDUINO_INSTALL_DIR) /libraries/Wire
@ -462,35 +481,53 @@ VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Adafruit_NeoPixel
e n d i f
e n d i f
i f e q ( $( U 8GLIB ) , 1 )
i f e q ( $( U 8GLIB ) , 1 )
VPATH += $( ARDUINO_INSTALL_DIR) /libraries/U8glib
VPATH += $( ARDUINO_INSTALL_DIR) /libraries/U8glib
VPATH += $( ARDUINO_INSTALL_DIR) /libraries/U8glib/clib
VPATH += $( ARDUINO_INSTALL_DIR) /libraries/U8glib/csrc
VPATH += $( ARDUINO_INSTALL_DIR) /libraries/U8glib/cppsrc
VPATH += $( ARDUINO_INSTALL_DIR) /libraries/U8glib/fntsrc
e n d i f
e n d i f
i f e q ( $( TMC 2630) , 1 )
i f e q ( $( TMC ) , 1 )
VPATH += $( ARDUINO_INSTALL_DIR) /libraries/TMC2130 Stepper/src
VPATH += $( ARDUINO_INSTALL_DIR) /libraries/TMCStepper/src
VPATH += $( ARDUINO_INSTALL_DIR) /libraries/TMC2130 Stepper/src/source
VPATH += $( ARDUINO_INSTALL_DIR) /libraries/TMCStepper/src/source
e n d i f
e n d i f
i f e q ( $( HARDWARE_VARIANT ) , a r d u i n o )
i f e q ( $( HARDWARE_VARIANT ) , a r d u i n o )
HARDWARE_SUB_VARIANT ?= mega
HARDWARE_SUB_VARIANT ?= mega
VPATH += $( ARDUINO_INSTALL_DIR) /hardware/arduino/avr/variants/$( HARDWARE_SUB_VARIANT)
VPATH += $( ARDUINO_INSTALL_DIR) /hardware/arduino/avr/variants/$( HARDWARE_SUB_VARIANT)
e l s e
e l s e i f e q ( $( HARDWARE_VARIANT ) , S a n g u i n o )
i f e q ( $( HARDWARE_VARIANT ) , S a n g u i n o )
VPATH += $( ARDUINO_INSTALL_DIR) /hardware/marlin/avr/variants/sanguino
VPATH += $( ARDUINO_INSTALL_DIR) /hardware/marlin/avr/variants/sanguino
e l s e i f e q ( $( HARDWARE_VARIANT ) , a r c h i m )
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/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
e l s e
e l s e
HARDWARE_SUB_VARIANT ?= standard
HARDWARE_SUB_VARIANT ?= standard
VPATH += $( ARDUINO_INSTALL_DIR) /hardware/$( HARDWARE_VARIANT) /variants/$( HARDWARE_SUB_VARIANT)
VPATH += $( ARDUINO_INSTALL_DIR) /hardware/$( HARDWARE_VARIANT) /variants/$( HARDWARE_SUB_VARIANT)
e n d i f
e n d i f
e n d i f
LIB_SRC = wiring.c \
LIB_SRC = wiring.c \
wiring_analog.c wiring_digital.c \
wiring_analog.c wiring_digital.c \
wiring_pulse.c \
wiring_shift.c WInterrupts.c hooks.c
wiring_shift.c WInterrupts.c hooks.c
i f e q ( $( HARDWARE_VARIANT ) , a r c h i m )
LIB_ASRC += wiring_pulse_asm.S
e l s e
LIB_SRC += wiring_pulse.c
e n d i f
i f e q ( $( HARDWARE_VARIANT ) , T e e n s y )
i f e q ( $( HARDWARE_VARIANT ) , T e e n s y )
LIB_SRC = wiring.c
LIB_SRC = wiring.c
VPATH += $( ARDUINO_INSTALL_DIR) /hardware/teensy/cores/teensy
VPATH += $( ARDUINO_INSTALL_DIR) /hardware/teensy/cores/teensy
e n d i f
e n d i f
LIB_CXXSRC = WMath.cpp WString.cpp Print.cpp SPI.cpp Tone.cpp
LIB_CXXSRC = WMath.cpp WString.cpp Print.cpp SPI.cpp
i f e q ( $( NEOPIXEL ) , 1 )
i f e q ( $( NEOPIXEL ) , 1 )
LIB_CXXSRC += Adafruit_NeoPixel.cpp
LIB_CXXSRC += Adafruit_NeoPixel.cpp
@ -510,11 +547,11 @@ endif
i f e q ( $( U 8GLIB ) , 1 )
i f e q ( $( U 8GLIB ) , 1 )
LIB_CXXSRC += U8glib.cpp
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_data .c
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
e n d i f
e n d i f
i f e q ( $( TMC 2630 ) , 1 )
i f e q ( $( TMC ) , 1 )
LIB_CXXSRC += TMC2130Stepper.cpp TMC2130Stepper_COOLCONF.cpp TMC2130Stepper_DRV_STATUS.cpp TMC2130Stepper_IHOLD_IRUN.cpp TMC2130Stepper_CHOPCONF.cpp TMC2130Stepper_GCONF.cpp TMC2130Stepper_PWMCONF.cpp SW_SPI .cpp
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 TMC2660Stepper.cpp TMC5130Stepper.cpp TMC5160Stepper .cpp
e n d i f
e n d i f
i f e q ( $( RELOC_WORKAROUND ) , 1 )
i f e q ( $( RELOC_WORKAROUND ) , 1 )
@ -544,50 +581,65 @@ OPT = s
DEFINES ?=
DEFINES ?=
# Program settings
# Program settings
CC = $( AVR_TOOLS_PATH) avr -gcc
CC = $( AVR_TOOLS_PATH) $( TOOL_PREFIX) -gcc
CXX = $( AVR_TOOLS_PATH) avr -g++
CXX = $( AVR_TOOLS_PATH) $( TOOL_PREFIX) -g++
OBJCOPY = $( AVR_TOOLS_PATH) avr -objcopy
OBJCOPY = $( AVR_TOOLS_PATH) $( TOOL_PREFIX) -objcopy
OBJDUMP = $( AVR_TOOLS_PATH) avr -objdump
OBJDUMP = $( AVR_TOOLS_PATH) $( TOOL_PREFIX) -objdump
AR = $( AVR_TOOLS_PATH) avr -ar
AR = $( AVR_TOOLS_PATH) $( TOOL_PREFIX) -ar
SIZE = $( AVR_TOOLS_PATH) avr -size
SIZE = $( AVR_TOOLS_PATH) $( TOOL_PREFIX) -size
NM = $( AVR_TOOLS_PATH) avr -nm
NM = $( AVR_TOOLS_PATH) $( TOOL_PREFIX) -nm
AVRDUDE = avrdude
AVRDUDE = avrdude
REMOVE = rm -f
REMOVE = rm -f
MV = mv -f
MV = mv -f
# Place -D or -U options here
# Place -D or -U options here
CDEFS = -DF_CPU= $( F_CPU) ${ addprefix -D , $( DEFINES) }
CDEFS = -DF_CPU= $( F_CPU) ${ addprefix -D , $( DEFINES) } -DARDUINO= $( ARDUINO_VERSION)
CXXDEFS = $( CDEFS)
CXXDEFS = $( CDEFS)
i f e q ( $( HARDWARE_VARIANT ) , T e e n s y )
i f e q ( $( HARDWARE_VARIANT ) , T e e n s y )
CDEFS += -DUSB_SERIAL
CDEFS += -DUSB_SERIAL
LIB_SRC += usb.c pins_teensy.c
LIB_SRC += usb.c pins_teensy.c
LIB_CXXSRC += usb_api.cpp
LIB_CXXSRC += usb_api.cpp
e l s e i f e q ( $( HARDWARE_VARIANT ) , a r c h i m )
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
e n d i f
e n d i f
# Add all the source directories as include directories too
# Add all the source directories as include directories too
CINCS = ${ addprefix -I , ${ VPATH } }
CINCS = ${ addprefix -I , ${ VPATH } }
CXXINCS = ${ addprefix -I , ${ VPATH } }
CXXINCS = ${ addprefix -I , ${ VPATH } }
# Silence warnings for library code (won't work for .h files, unfortunately)
LIBWARN = -w -Wno-packed-bitfield-compat
# Compiler flag to set the C/CPP Standard level.
# Compiler flag to set the C/CPP Standard level.
CSTANDARD = -std= gnu99
CSTANDARD = -std= gnu99
CXXSTANDARD = -std= gnu++11
CXXSTANDARD = -std= gnu++11
CDEBUG = -g$( DEBUG)
CDEBUG = -g$( DEBUG)
CWARN = -Wall -Wstrict-prototypes
CWARN = -Wall -Wstrict-prototypes -Wno-packed-bitfield-compat -Wno-pragmas
C TUNING = -w -fsigned-char -funsigned-bitfields -fpack-struct \
C XXWARN = -Wall -Wno-packed-bitfield-compat -Wno-pragmas
-fshort-enums -ffunction-sections -fdata-sections -flto \
CTUNING = -fsigned-char -funsigned-bitfields -fpack-struct -fno-exceptions \
-DARDUINO= $( ARDUINO_VERSION)
-fshort-enums -ffunction-sections -fdata-sections
i f n e q ( $( HARDWARE_MOTHERBOARD ) , )
i f n e q ( $( HARDWARE_MOTHERBOARD ) , )
CTUNING += -DMOTHERBOARD= ${ HARDWARE_MOTHERBOARD }
CTUNING += -DMOTHERBOARD= ${ HARDWARE_MOTHERBOARD }
e n d i f
e n d i f
#CEXTRA = -Wa,-adhlns=$(<:.c=.lst)
#CEXTRA = -Wa,-adhlns=$(<:.c=.lst)
C EXTRA = -fno-use-cxa-atexit -fno-threadsafe-statics
C XX EXTRA = -fno-use-cxa-atexit -fno-threadsafe-statics -fno-rtti
CFLAGS := $( CDEBUG) $( CDEFS) $( CINCS) -O$( OPT) $( CEXTRA) $( CTUNING) $( CSTANDARD)
C FLAGS := $( CDEBUG) $( CDEFS) $( CINCS) -O$( OPT) $( CWARN) $( C EXTRA) $( CTUNING) $( CSTANDARD)
C XXFLAGS := $( CDEFS) $( CINCS) -O$( OPT) $( CXX EXTRA) $( CTUNING) $( CXX STANDARD)
CXXFLAGS := $( CDEFS) $( CINCS) -O$( OPT) -Wall $( CEXTRA) $( CTUNING) $( CXXSTANDARD )
ASFLAGS := $( CDEFS )
#ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
#ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
i f e q ( $( HARDWARE_VARIANT ) , a r c h i m )
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 -gcc -T$( LDSCRIPT) -u _sbrk -u link -u _close -u _fstat -u _isatty -u _lseek -u _read -u _write -u _exit -u kill -u _getpid
e l s e
LD_PREFIX = -Wl,--gc-sections,--relax
LDFLAGS = -lm
LDFLAGS = -lm
CTUNING += -flto
e n d i f
# Programming support using avrdude. Settings and variables.
# Programming support using avrdude. Settings and variables.
AVRDUDE_PORT = $( UPLOAD_PORT)
AVRDUDE_PORT = $( UPLOAD_PORT)
@ -619,9 +671,9 @@ LST = $(LIB_ASRC:.S=.lst) $(LIB_CXXSRC:.cpp=.lst) $(LIB_SRC:.c=.lst)
# Combine all necessary flags and optional flags.
# Combine all necessary flags and optional flags.
# Add target processor to flags.
# Add target processor to flags.
ALL_CFLAGS = -mmcu= $( MCU) -I. $( CFLAGS)
ALL_CFLAGS = $( MCU_FLAGS) $( CPU_FLAGS) $( CFLAGS) -I.
ALL_CXXFLAGS = -mmcu= $( MCU ) $( CXXFLAGS)
ALL_CXXFLAGS = $( MCU_FLAGS) $( CPU_FLAGS) $( CXXFLAGS)
ALL_ASFLAGS = -mmcu = $( MCU) -x assembler-with-cpp $( ASFLAGS)
ALL_ASFLAGS = $( MCU_FLAGS) $( CPU_FLAGS) $( ASFLAGS ) -x assembler-with-cpp
# set V=1 (eg, "make V=1") to print the full commands etc.
# set V=1 (eg, "make V=1") to print the full commands etc.
i f n e q ( $ V , 1 )
i f n e q ( $ V , 1 )
@ -639,9 +691,10 @@ $(shell mkdir -p $(dir $(OBJ)))
# Default target.
# Default target.
all : sizeafter
all : sizeafter
build : elf hex
build : elf hex bin
elf : $( BUILD_DIR ) /$( TARGET ) .elf
elf : $( BUILD_DIR ) /$( TARGET ) .elf
bin : $( BUILD_DIR ) /$( TARGET ) .bin
hex : $( BUILD_DIR ) /$( TARGET ) .hex
hex : $( BUILD_DIR ) /$( TARGET ) .hex
eep : $( BUILD_DIR ) /$( TARGET ) .eep
eep : $( BUILD_DIR ) /$( TARGET ) .eep
lss : $( BUILD_DIR ) /$( TARGET ) .lss
lss : $( BUILD_DIR ) /$( TARGET ) .lss
@ -660,7 +713,7 @@ endif
# Display size of file.
# Display size of file.
HEXSIZE = $( SIZE) --target= $( FORMAT) $( BUILD_DIR) /$( TARGET) .hex
HEXSIZE = $( SIZE) --target= $( FORMAT) $( BUILD_DIR) /$( TARGET) .hex
ELFSIZE = $( SIZE) --mcu= $( MCU) -C $( BUILD_DIR) /$( TARGET) .elf; \
ELFSIZE = $( SIZE) $( SIZE_FLAGS) $( BUILD_DIR) /$( TARGET) .elf; \
$( SIZE) $( BUILD_DIR) /$( TARGET) .elf
$( SIZE) $( BUILD_DIR) /$( TARGET) .elf
sizebefore :
sizebefore :
$P if [ -f $( BUILD_DIR) /$( TARGET) .elf ] ; then echo; echo $( MSG_SIZE_BEFORE) ; $( HEXSIZE) ; echo; fi
$P if [ -f $( BUILD_DIR) /$( TARGET) .elf ] ; then echo; echo $( MSG_SIZE_BEFORE) ; $( HEXSIZE) ; echo; fi
@ -685,13 +738,17 @@ extcoff: $(TARGET).elf
$( COFFCONVERT) -O coff-ext-avr $( BUILD_DIR) /$( TARGET) .elf $( TARGET) .cof
$( COFFCONVERT) -O coff-ext-avr $( BUILD_DIR) /$( TARGET) .elf $( TARGET) .cof
.SUFFIXES : .elf .hex .eep .lss .sym
.SUFFIXES : .elf .hex .eep .lss .sym .bin
.PRECIOUS : .o
.PRECIOUS : .o
.elf.hex :
.elf.hex :
$( Pecho) " COPY $@ "
$( Pecho) " COPY $@ "
$P $( OBJCOPY) -O $( FORMAT) -R .eeprom $< $@
$P $( OBJCOPY) -O $( FORMAT) -R .eeprom $< $@
.elf.bin :
$( Pecho) " COPY $@ "
$P $( OBJCOPY) -O binary -R .eeprom $< $@
.elf.eep :
.elf.eep :
-$( OBJCOPY) -j .eeprom --set-section-flags= .eeprom= "alloc,load" \
-$( OBJCOPY) -j .eeprom --set-section-flags= .eeprom= "alloc,load" \
--change-section-lma .eeprom= 0 -O $( FORMAT) $< $@
--change-section-lma .eeprom= 0 -O $( FORMAT) $< $@
@ -708,28 +765,32 @@ extcoff: $(TARGET).elf
$(BUILD_DIR)/$(TARGET).elf : $( OBJ ) Configuration .h
$(BUILD_DIR)/$(TARGET).elf : $( OBJ ) Configuration .h
$( Pecho) " CXX $@ "
$( Pecho) " CXX $@ "
$P $( CC) $( LD_PREFIX) $( ALL_CXXFLAGS) -Wl,--gc-sections,--relax -o $@ -L. $( OBJ) $( LDFLAGS) $( LD_SUFFIX)
$P $( CC) $( LD_PREFIX) $( ALL_CXXFLAGS) -o $@ -L. $( OBJ) $( LDFLAGS) $( LD_SUFFIX)
# Object files that were found in "src" will be stored in $(BUILD_DIR)
# Object files that were found in "src" will be stored in $(BUILD_DIR)
# in directories that mirror the structure of "src"
# in directories that mirror the structure of "src"
$(BUILD_DIR)/%.o : %.c Configuration .h Configuration_adv .h $( MAKEFILE )
$(BUILD_DIR)/%.o : %.c Configuration .h Configuration_adv .h $( MAKEFILE )
$( Pecho) " CC $< "
$( Pecho) " CC $< "
$P $( CC) -MMD -c $( ALL_CFLAGS) $< -o $@
$P $( CC) -MMD -c $( ALL_CFLAGS) $( CWARN) $< -o $@
$(BUILD_DIR)/%.o : %.cpp Configuration .h Configuration_adv .h $( MAKEFILE )
$(BUILD_DIR)/%.o : %.cpp Configuration .h Configuration_adv .h $( MAKEFILE )
$( Pecho) " CXX $< "
$( Pecho) " CXX $< "
$P $( CXX) -MMD -c $( ALL_CXXFLAGS) $< -o $@
$P $( CXX) -MMD -c $( ALL_CXXFLAGS) $( CXXWARN) $< -o $@
# Object files for Arduino libs will be created in $(BUILD_DIR)/arduino
# Object files for Arduino libs will be created in $(BUILD_DIR)/arduino
$(BUILD_DIR)/arduino/%.o : %.c Configuration .h Configuration_adv .h $( MAKEFILE )
$(BUILD_DIR)/arduino/%.o : %.c Configuration .h Configuration_adv .h $( MAKEFILE )
$( Pecho) " CC $< "
$( Pecho) " CC $< "
$P $( CC) -MMD -c $( ALL_CFLAGS) $< -o $@
$P $( CC) -MMD -c $( ALL_CFLAGS) $( LIBWARN) $< -o $@
$(BUILD_DIR)/arduino/%.o : %.cpp Configuration .h Configuration_adv .h $( MAKEFILE )
$(BUILD_DIR)/arduino/%.o : %.cpp Configuration .h Configuration_adv .h $( MAKEFILE )
$( Pecho) " CXX $< "
$( Pecho) " CXX $< "
$P $( CXX) -MMD -c $( ALL_CXXFLAGS) $< -o $@
$P $( CXX) -MMD -c $( ALL_CXXFLAGS) $( LIBWARN) $< -o $@
$(BUILD_DIR)/arduino/%.o : %.S $( MAKEFILE )
$( Pecho) " CXX $< "
$P $( CXX) -MMD -c $( ALL_ASFLAGS) $< -o $@
# Target: clean project.
# Target: clean project.
clean :
clean :