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
--- /dev/null
+#!/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');