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
_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make
