Arduino-Makefile
Arduino-Makefile copied to clipboard
Compiler comandline fail, -mmcu= left unset
The blink.ino example project fails to build, because Arduino.mk does following with Arduino Nano. Makefile:
ARDMK_DIR=/usr/share/arduino ARDMK_VENDOR=archlinux-arduino ARDUINO_DIR=/usr/share/arduino ARCHITECTURE = avr BOARD_TAG = nano BOARD_SUB = atmega328p include $(ARDMK_DIR)/Arduino.mk
Result:
/usr/bin/avr-g++ -x c++ -include Arduino.h -MMD -c -D__PROG_TYPES_COMPAT__ -mmcu= -DF_CPU=16000000L -DARDUINO=1813 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-DARDUINO_BOARD=\"AVR_NANO\"" "-DARDUINO_VARIANT=\"eightanaloginputs\"" -I/usr/share/arduino/hardware/archlinux-arduino/avr/cores/arduino -I/usr/share/arduino/hardware/archlinux-arduino/avr/cores/arduino/api -I/usr/share/arduino/hardware/archlinux-arduino/avr/variants/eightanaloginputs -Wall -ffunction-sections -fdata-sections -Os -fno-exceptions -std=gnu++11 -fno-threadsafe-statics -flto -fdiagnostics-color=always blink.ino -o build-nano-atmega328p/blink.ino.o avr-g++: error: missing device or architecture after '-mmcu='
Somehow -mmcu= is not set as "-mmcu=atmega328p" even though I specified it. What's going on?
More over I would love to have more control how Arduino.mk setups the compiler command line flags for CFLAGS
and CXXFLAGS
etc.
Currently I can't by default remove etc. -fpermissive
flag from the compiler cmdline without hacking the Arduino.mk installed on the system... :-(
It seems to be a duplicate of issue #638.