Use a driver Perl script to run genps.pl, since Windows Make can't
authorH. Peter Anvin <hpa@zytor.com>
Sat, 18 May 2002 22:17:28 +0000 (22:17 +0000)
committerH. Peter Anvin <hpa@zytor.com>
Sat, 18 May 2002 22:17:28 +0000 (22:17 +0000)
handle `cat ...`

doc/Makefile.in
doc/genpsdriver.pl [new file with mode: 0644]

index da96237..a3279e4 100644 (file)
@@ -37,10 +37,9 @@ nasmdoc.dip: nasmdoc.src rdsrc.pl
 nasmdoc.texi: nasmdoc.dip
        : Generated by side effect
 
-nasmdoc.ps: nasmdoc.dip nasmlogo.eps ../version \
+nasmdoc.ps: nasmdoc.dip nasmlogo.eps ../version genpsdriver.pl \
            genps.pl psfonts.ph pswidth.ph head.ps
-       $(PERL) $(srcdir)/genps.pl -subtitle "version `cat ../version`" \
-               nasmdoc.dip > nasmdoc.ps
+       $(PERL) $(srcdir)/genpsdriver.pl > nasmdoc.ps
 
 nasmdoc.pdf: nasmdoc.ps
        $(PS2PDF) nasmdoc.ps nasmdoc.pdf
diff --git a/doc/genpsdriver.pl b/doc/genpsdriver.pl
new file mode 100644 (file)
index 0000000..f05544a
--- /dev/null
@@ -0,0 +1,21 @@
+#!/usr/bin/perl
+#
+# Runs the equivalent of the following command line:
+#
+#       $(PERL) $(srcdir)/genps.pl -subtitle "version `cat ../version`" \
+#                nasmdoc.dip
+#
+# This is implemented as a Perl script since `cat ...` doesn't
+# necessarily work on non-Unix systems.
+#
+
+$perl   = $ENV{'PERL'}   || 'perl';
+$srcdir = $ENV{'srcdir'} || '.';
+
+open(VERSION, '< ../version') or die "$0: cannot open ../version\n";
+$version = <VERSION>;
+chomp $version;
+close(VERSION);
+
+system($perl, "${srcdir}/genps.pl", '-subtitle',
+       'version '.$version, 'nasmdoc.dip');