Fix "make doc"
[nasm/avx512.git] / doc / genpsdriver.pl
blob0136e3e1f3694389fce184a5e3e17a1e8638c8b4
1 #!/usr/bin/perl
3 # Runs the equivalent of the following command line:
5 # $(PERL) $(srcdir)/genps.pl -subtitle "version `cat ../version`" \
6 # nasmdoc.dip
8 # This is implemented as a Perl script since `cat ...` doesn't
9 # necessarily work on non-Unix systems.
12 use File::Spec;
13 use Fcntl;
15 $perl = $ENV{'PERL'} || 'perl';
16 $srcdir = $ENV{'srcdir'} || File::Spec->curdir();
18 $versionfile = File::Spec->catfile(File::Spec->updir($srcdir), 'version');
19 $genps = File::Spec->catfile($srcdir, 'genps.pl');
21 sysopen(VERSION, $versionfile, O_RDONLY)
22 or die "$0: cannot open $versionfile\n";
23 $version = <VERSION>;
24 chomp $version;
25 close(VERSION);
27 # \240 = no-break space, see @NASMEncoding in genps.pl.
28 # If we use a normal space, it breaks on 'doze platforms...
29 system($perl, $genps, '-subtitle', "version\240".$version,
30 @ARGV, 'nasmdoc.dip');