[CMake] Compiling without linking

Baptiste Derongs baptiste.derongs at etu.utc.fr
Thu Oct 4 05:30:36 EDT 2007


On 10/4/07, Torsten Martinsen <tma at gatehouse.dk> wrote:
> Baptiste Derongs <> wrote:
>
> > The point is that I want a MakeFile that creates only the .o file,
> > doesnt try to get binary. Next that same Makefile (and other ones)
> > need the .o file to make other binaries.
>
> Instead of focussing on how to do this small step, you should probably
> explain what it is you are trying to do, i.e. why you think that you
> need to explicitly split up the steps of compiling and linking.

Actually I have a file that contains a lot of functions, call this
file global.c.
Next I have multiple files, call them f1.c, f2.c, ...

And each f*.c has to be compiled with global.c.
Obviously I can do gcc f1.c global.c -o f1 for each file, but I think
that it'll be faster to first make the .o, and next to do gcc f1.c
global.o -o f1.

Am I wrong ? If the first solution is good that's cool for me, but I
thought that was not very proper.

>
> -Torsten
>
> This e-mail and any files sent with it contain information that may be privileged or confidential and is the property of the GateHouse Group. This information is intended solely for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use the message or any part thereof. If you have received this e-mail in error, please notify the sender immediately, and delete all copies of this message. In accordance with GateHouse Security Policy, e-mails sent or received may be monitored.
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>


More information about the CMake mailing list