Can Makefiles be used?

Jonathan Wakely
Mon Jan 3 15:05:00 GMT 2011

On 3 January 2011 14:59, Vaibhav Kaushal wrote:
> My question is mainly related to the process of linking object files
> automatically using a 'Makefile'.
> I know that makefiles can be used to compile a source tree with options
> at each source level. The problem is that
> * I dont know how to create / change them manually. The ./configure has
> been working for me till now.
> * I have the object files (the .o files). I have made changes to a small
> project and tried to use the functions in those .o files (according to
> the API Docs).
> * I do not have the course of the object files.
> Under these circumstances, Is it possible to change the makefile so that
> GCC will link to the functions in those object files automatically when
> compiling?

This question is about Make, not GCC, so this isn't the best place to
ask, but yes, it can be done.

Makefiles can be used to do almost anything, especially building software.

The makefile rules simply need to refer to the .o files and they will
be linked to.  The most common structure of a simple makefile would
turn source files into object files, then link all the object files
together.  You simply want to skip the first step.

More information about the Gcc-help mailing list