How does the Arduino IDE/build system work?
I noticed that they use the avr-gcc in the background, but what do they do on top?
They seem to have their own "kind of C" language that transforms into something that then compiles by avr-gcc.
Would someone like to spread some light on how it really works?
- What language are they using?
- Are they using something like Make in the background?
- What intermediate files do they create? Can you listcompile a arduino file, or have a look at the generated AVR assambler?
-
\$\begingroup\$ I think the language is C, which is why avr-gcc can compile it. The setup() and loop() functions are just wrappers for other standard functions, ie loop is actually main() \$\endgroup\$dext0rb– dext0rb2012年04月24日 19:03:09 +00:00Commented Apr 24, 2012 at 19:03
-
\$\begingroup\$ Here's something that partially answers your question electronics.stackexchange.com/questions/22017/… \$\endgroup\$Jon L– Jon L2012年04月24日 19:19:52 +00:00Commented Apr 24, 2012 at 19:19
-
\$\begingroup\$ @dext0rb actually it's c++ \$\endgroup\$vicatcu– vicatcu2012年04月24日 20:37:16 +00:00Commented Apr 24, 2012 at 20:37
-
\$\begingroup\$ I think we are both correct. "First, the Arduino environment performs some small transformations to make sure that the code is correct C or C++ (two common programming languages)." From the BuildProcess link below \$\endgroup\$dext0rb– dext0rb2012年04月24日 21:03:54 +00:00Commented Apr 24, 2012 at 21:03
-
\$\begingroup\$ @vicatcu Actually it's a subset of C++ \$\endgroup\$m.Alin– m.Alin2012年04月24日 21:34:14 +00:00Commented Apr 24, 2012 at 21:34
1 Answer 1
This page has everything you're looking for, straight from arduino's website.
https://arduino.github.io/arduino-cli/latest/sketch-build-process/
-
3\$\begingroup\$ It is preferred to add some detail from the site. In case the link goes dead in the future the answer will still be somewhat useful. \$\endgroup\$AngryEE– AngryEE2012年04月24日 23:30:05 +00:00Commented Apr 24, 2012 at 23:30