Go Down

Topic: How does arduino IDE decide what files to compile? (Read 247 times) previous topic - next topic

liudr

Oct 09, 2014, 06:00 pm Last Edit: Oct 10, 2014, 03:58 pm by liudr Reason: 1
I am making some mods to files in my Arduino IDE version 1.0.5 R2 to my Arduino IDE version 1.0.5 R2. Here is what I am not able to figure out:
The main project .cpp file only includes Arduino.h, which includes a few other .h files. It also has some declarations such as digitalWrite and digitalRead.

Each wiring_something.c file includes definitions of respective functions. For example, wiring_digital.c has definitions of digitalRead digitalWrite and pinMode.

The following are the .o files in the build folder:
Code: [Select]
10/09/2014  10:42 AM             6,180 Blink.cpp.o
10/09/2014  10:42 AM             2,192 CDC.cpp.o
10/09/2014  10:42 AM            33,100 HardwareSerial.cpp.o
10/09/2014  10:42 AM             2,192 HID.cpp.o
10/09/2014  10:42 AM            15,916 IPAddress.cpp.o
10/09/2014  10:42 AM             3,496 main.cpp.o
10/09/2014  10:42 AM             9,600 malloc.c.o
10/09/2014  10:42 AM             6,620 new.cpp.o
10/09/2014  10:42 AM            40,812 Print.cpp.o
10/09/2014  10:42 AM             7,288 realloc.c.o
10/09/2014  10:42 AM            30,044 Stream.cpp.o
10/09/2014  10:42 AM            16,520 Tone.cpp.o
10/09/2014  10:42 AM             2,200 USBCore.cpp.o
10/09/2014  10:42 AM             5,988 WInterrupts.c.o
10/09/2014  10:42 AM             9,660 wiring.c.o
10/09/2014  10:42 AM             6,956 wiring_analog.c.o
10/09/2014  10:42 AM            11,476 wiring_digital.c.o
10/09/2014  10:42 AM             7,020 wiring_pulse.c.o
10/09/2014  10:42 AM             5,612 wiring_shift.c.o
10/09/2014  10:42 AM             7,016 WMath.cpp.o


Since I didn't do any analog or pwm or shift stuff, can I safely say that most of these files are compiled by the IDE regardless the code? The verbose mode compilation commands seem to indicate that (very long commands).

MarkT

The smart linker omits unused functions I believe, so all the system files are compiled
if triggered by dependancies I believe.  Changing board triggers all to be recompiled
AFAIK.

If you're modding the IDE you have the source code there!
[ I won't respond to messages, use the forum please ]

liudr

Thanks MarkT. I made a mistake saying I'm modding the IDE. I actually just want to change the content of some source files being compiles by the IDE, such as wiring_digital.c wiring_analog.c and Arduino.c

I am doing this work:
http://forum.arduino.cc/index.php?topic=271044.0

Go Up