This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Feature idea for GCC: link dependencies


Hi,

GCC is already able to create makefile fragments containing compile
dependencies of source files.

I propose an extension to enable it to add link dependencies to such
makefile fragments. A file main.c has a link dependency on foo.c if a function
defined in main.c calls a function defined in foo.c. The idea is to maintain such
link dependencies in the source code instead of in "makefile" or
"makefile.am". If foo.h contains a line `#pragma linkdep "foo.c"', then the compiler
knows that every source file with a line `#include "foo.h"' has a link dependency
on foo.c. If it links main.o into an executable, it has to link it with
foo.o.

I created a patch which implements the above proposition:
http://in3www.epfl.ch/~schaffne/use/gcc-cvs-3-7-14-linkdep.ptch
Please comment and criticize.

Martin Schaffner

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++

Jetzt ein- oder umsteigen und USB-Speicheruhr als Prämie sichern!


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]