[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]
Re: dependeny dump for wml_p1_ipp
- From: Andreas Hofmeister <nospam@thanx>
- Date: Thu, 18 Mar 1999 05:11:51 +0000
Denis Barbier wrote:
> Of course.
> Please use diff -u on the source file ipp.src, so that it can easily be
> incorporated.
> If your patch is small, send it to the list, it may interest other
> people. If it's big, or if you don't know how to proceed, send it to me
> directly.
Ok, hree it is. I did not change the dokumentation (because of my poor
english ) , so i think you need some additional infos. I modified the
preprocessor to output something like
abc.html : abc.wml \
my-tags.wml \
...
on STDOUT . This can be included in a makefile as desribed in the (info)
docs for make.
Because i did not modify "wml" itself, i need to run ipp as
wml_p1_ipp -I. -I<more dirs> -S/usr/local/lib/wml/include -o X.html
X.wml > X.html.dep
To make this feature real useable, one should change "wml" to accept
--depend , so one could write
wml --depend -o X.html X.wml > X.html.dep
or better
wml --depend X.html.dep -o X.html X.wml
--
Andreas Hofmeister (see http://www.informatik.uni-freiburg.de/~hofmeist)
"I can do it in Quake, why not in real life ?"
(Lan Solaris (Illiad))
--- ipp.src Thu Mar 18 05:32:27 1999
+++ ipp.src.new Thu Mar 18 05:30:42 1999
@@ -59,9 +59,12 @@
print STDERR " -m, --mapfile=<file> use include file mapping table\n";
print STDERR " -o, --outputfile=<file> set output file instead of stdout\n";
print STDERR " -v, --verbose verbosity\n";
+
+ print STDERR " -d, --depend dump dependencies\n";
exit(1);
}
$opt_v = 0;
+$opt_d = 0;
@opt_I = ('.');
@opt_D = ();
@opt_S = ();
@@ -74,6 +77,7 @@
$Getopt::Long::getopt_compat = 0;
if (not Getopt::Long::GetOptions(
"v|verbose",
+ "d|depend" ,
"S|sysincludedir=s@",
"D|define=s@",
"I|includedir=s@",
@@ -219,7 +223,22 @@
$found = 1;
}
}
- &error("file not found: $file") if not $found;
+
+ if( not $found ) {
+ if( ! $opt_d ) {
+ &error("file not found: $file");
+ } else {
+ # while checking dependencies, only warn at missing files
+
+ &warning("file not found: $file");
+ $id = &CanonPath($file);
+
+ # forget the missing file
+ undef($INCLUDES{$id});
+ return '';
+
+ }
+ }
#
# stop if file was still included some time before
@@ -437,19 +456,40 @@
0, 1, '"', "\\", '"') # the escapes, etc.
if $outbuf =~ m|/\*|;
-#
-# create output file
-#
-if ($opt_o eq '-') {
- $out = new IO::Handle;
- $out->fdopen(fileno(STDOUT), "w");
-}
-else {
- $out = new IO::File;
- $out->open(">$opt_o");
+# dependencies ?
+if( $opt_d ) {
+
+ $depout = STDOUT; # dependecy file as commandline argument ?
+
+ # print dependencies to stdout
+
+ print $depout $opt_o . ": " ;
+ print $depout join(" " , @ARGV ) . "\\\n" ;
+
+ # print a line for each included file
+ foreach $inc (keys(%INCLUDES)) {
+ print $depout "\t$inc \\\n" ;
+ }
+ print $depout "\n";
+
+} else {
+
+ # normal run - print preprocessed buffer
+
+ #
+ # create output file
+ #
+ if ($opt_o eq '-') {
+ $out = new IO::Handle;
+ $out->fdopen(fileno(STDOUT), "w");
+ }
+ else {
+ $out = new IO::File;
+ $out->open(">$opt_o");
+ }
+ print $out $outbuf;
+ $out->close();
}
-print $out $outbuf;
-$out->close();
# die gracefully
exit(0);