[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gcc -M deficiencies; workaround?
From: |
gk |
Subject: |
gcc -M deficiencies; workaround? |
Date: |
Wed, 15 Jan 2003 14:06:03 -0800 |
Since gcc -M only returns prerequisite files included with #include
directive, it cannot list prerequisite files accessed by fopen(), etc.
Of course a workaround is to manually add such files to the makefile but
this is a bad solution since it requires developers to manually keep track
of such things as source files change, incurring the same problems we find
in recursive make situations.
I was wondering if there is any standard method in the C language context
that people have found to address this problem.
I have found a solution in the PHP language context.
My makefile processes PHP script files to which I have included a function
by which a source file can declare that it has a prerequisites other than
by include() or require() statements:
<?php register_prerequisite_files( $array_of_filenames );?>
I then have a makefile rule which includes the source file, sending all
output to /dev/null and then calls another function to retrieve the list of
prerequisites:
<?php $array_of_filenames=get_prerequisite_files();?>
- Greg Keraunen
http://www.xmake.org
http://www.xmlmake.com
- gcc -M deficiencies; workaround?,
gk <=