3

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?
m.Alin
  • 10,638
  • 19
  • 62
  • 89
Johan
  • 2,385
  • 2
  • 25
  • 27
  • 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() – dext0rb Apr 24 '12 at 19:03
  • Here's something that partially answers your question http://electronics.stackexchange.com/questions/22017/complete-alternatives-to-the-arduino-ide/22019#22019 – Jon L Apr 24 '12 at 19:19
  • @dext0rb actually it's c++ – vicatcu Apr 24 '12 at 20:37
  • 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 – dext0rb Apr 24 '12 at 21:03
  • @vicatcu Actually it's a subset of C++ – m.Alin Apr 24 '12 at 21:34

1 Answers1

4

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

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

asky
  • 105
  • 4
uberdanzik
  • 209
  • 1
  • 3
  • 8
  • 3
    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. – AngryEE Apr 24 '12 at 23:30