ARDUINO-BUILDER(1)
β¨ NAME β¨
arduino-builder β compiles Arduino sketches π
πΈ SYNOPSIS πΈ
arduino-builder mandatory-arguments [options] sketch
π DESCRIPTION π
Okay bestie, so arduino-builder is a command line tool for compiling Arduino sketches. That's the whole vibe. π«Ά
What it actually does: it parses Arduino Hardware specifications, runs gcc properly, and produces compiled sketches. Iconic behavior, no cap.
Now here's the tea about why an Arduino sketch is not just a standard C program β:
- it's missing a
mainβ that's provided by the Arduino core, so don't worry about it - function prototypes are not mandatory (yes, really)
- library inclusion is automagic β you literally just have to
#includethem and it's handled β¨
So this tool generates those function prototypes and gathers the library paths, handing gcc all the -I params it needs. She's doing the most so you don't have to. π
π OPTIONS π
Every single time you run this tool, it creates a build.options.json file in the build path. Why? Because it needs to know whether the build options changed (think hardware folders, fqbn, and so on) when you're compiling the same sketch.
- If they changed β the whole build path gets wiped out. Gone. π
- If they didn't change β previous compiled files get reused, as long as the corresponding source files didn't change either. Efficient queen. β¨
And plot twist: you can save this file locally and use it instead of specifying -hardware, -tools, -libraries, -fqbn, -pref and -ide-version. Slay.
π Mandatory π
-hardwarefolder β the folder containing Arduino platforms. For example, thehardwarefolder that ships with the Arduino IDE, or the packages folder that Arduino Boards Manager creates. You can specify it multiple times. And if you specify conflicting hardware definitions? The last one wins, periodt.-toolsfolder β the folder containing Arduino tools (gcc,avrdude...). Like thehardware/toolsfolder shipped with the Arduino IDE, or the packages folder created by Arduino Boards Manager. Can be specified multiple times too.-fqbnname β Fully Qualified Board Name, e.g.:arduino:avr:uno.
π¦ Optional π¦
-compile|-dump-prefs|-preprocessβ if you omit this, it defaults to-compile. Here's the breakdown:dump-prefsjust prints all the build preferences used,-compileuses those preferences to run the actual compiler, and-preprocessonly prints preprocessed code tostdout.-librariesfolder β folder containing Arduino libraries, like thelibrariesfolder shipped with the Arduino IDE. Can be specified multiple times.-build-pathfolder β folder where the compiled files get saved. If you skip it, a folder gets created in the temporary folder specified by your OS.-prefs=key=valueβ lets you override some build properties.-warningsβ can be"none","default","more"and"all". Defaults to"none". This tellsgccwhich warning level to use (the-Wflag).-verboseβ turns on verbose mode. Spill the details. π£οΈ-quietβ suppresses almost every output. Shhh. π€«-debug-levelβ defaults to"5". Used for debugging. Set it to10when submitting an issue. (Do it, bestie, the maintainers will love you for it π)-core-api-versionβ defaults to"10600". This is the version of the Arduino IDE that's using this tool.-loggerβ can be"human","humantags"or"machine". Defaults to"human". If it's"humantags", messages get qualified with a prefix indicating their level (info,debug,error). If it's"machine", the messages emitted come out in a format that the Arduino IDE understands and uses for I18N.-versionβ if specified, prints the version and exits. Short and sweet. π-build-options-filepath β path to a localbuild.options.jsonfile, which lets you omit specifying params such as-hardware,-tools,-libraries,-fqbn,-prefand-ide-version.-vid-pidβ when specified, VID/PID specific build properties get used, if the board supports them. π
π SEE ALSO π
and that's the whole page, bestie!! this manual came from Arduino AG, dated March 2018, and it's the general commands manual for section 1. go compile something gorgeous π¦β¨π
π¦ where this page comes from
- debian bookworm: arduino-builder 1.3.25-4+b3 Β· GPL-2.0-only
- debian trixie: arduino-builder 1.3.25-5+b2 Β· GPL-2.0-only
- ubuntu jammy: arduino-builder 1.3.25-3 Β· GPL-2.0-only
- ubuntu noble: arduino-builder 1.3.25-4build1 Β· GPL-2.0-only
- ubuntu noble: arduino-builder 1.3.25-4ubuntu0.24.04.3 Β· GPL-2.0-only
- ubuntu questing: arduino-builder 1.3.25-5
- ubuntu resolute: arduino-builder 1.3.25-5build1 Β· GPL-2.0-only
- ubuntu stonking: arduino-builder 1.3.25-5build1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms