Go Down

Topic: Another Compiler (Read 2 times) previous topic - next topic

blalor

Quote

Thats because your compiling against the Arduino libraries. They are always included.
If you compile it separately (with a Makefile) then there is no overhead.

Is that a difference in "cc -o whatever pins_arduino.o HardwareSerial.o ..." vs "cc -o whatever -larduino" (where libarduino.a is the output of "ar <er, something...> pins_arduino.o HardwareSerial.o ...")?

Cheater

Quote
Quote
Is that a difference in "cc -o whatever pins_arduino.o HardwareSerial.o ..." vs "cc -o whatever -larduino" (where libarduino.a is the output of "ar <er, something...> pins_arduino.o HardwareSerial.o ...")?

I think there is a difference but I'm not sure.

kg4wsv

Quote
Is that a difference in "cc -o whatever pins_arduino.o HardwareSerial.o ..." vs "cc -o whatever -larduino" (where libarduino.a is the output of "ar <er, something...> pins_arduino.o HardwareSerial.o ...")?


Yes.  Linking against all the .o files crams them all together, just like you ask.  Making a library and linking against -larduino extracts the code for the functions you use (not the whole thing) and merges only the needed code with the executable.

-j


AVRman

I love the Arduino environment.

Go Up