3
\$\begingroup\$

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?
\$\endgroup\$
5
  • \$\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
    Commented Apr 24, 2012 at 19:03
  • \$\begingroup\$ Here's something that partially answers your question electronics.stackexchange.com/questions/22017/… \$\endgroup\$
    – Jon L
    Commented Apr 24, 2012 at 19:19
  • \$\begingroup\$ @dext0rb actually it's c++ \$\endgroup\$
    – vicatcu
    Commented 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
    Commented Apr 24, 2012 at 21:03
  • \$\begingroup\$ @vicatcu Actually it's a subset of C++ \$\endgroup\$
    – m.Alin
    Commented Apr 24, 2012 at 21:34

1 Answer 1

4
\$\begingroup\$

This page has everything you're looking for, straight from arduino's website.

https://arduino.github.io/arduino-cli/latest/sketch-build-process/

\$\endgroup\$
1
  • 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
    Commented Apr 24, 2012 at 23:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.