sudar / Arduino-Makefile

Makefile for Arduino sketches. It defines the workflows for compiling code, flashing it to Arduino and even communicating through Serial.
http://hardwarefun.com/tutorials/compiling-arduino-sketches-using-makefile
GNU Lesser General Public License v2.1
2.01k stars 448 forks source link

Add build.board to CPPFLAGS (if found) #641

Closed sej7278 closed 4 years ago

sej7278 commented 4 years ago

Most boards.txt use build.board these days, this parses it and adds to CPPFLAGS, works with 1.0 and 1.5+

Some libraries bundled with cores like ESP32 use this to identify the specific development board rather than just relying on arch/platform

Example output (yes, the weird quoting is intentional as the libraries look for a string):

-DARDUINO_AVR_ATTINYX5 "-DARDUINO_BOARD=\"AVR_ATTINYX5\""

-DARDUINO_AVR_MEGA2560 "-DARDUINO_BOARD=\"AVR_MEGA2560\""

-DARDUINO_AVR_SANGUINO "-DARDUINO_BOARD=\"AVR_SANGUINO\""

-DARDUINO_AVR_ATmega128 "-DARDUINO_BOARD=\"AVR_ATmega128\""

-DARDUINO_AVR_UNO "-DARDUINO_BOARD=\"AVR_UNO\""