NASM 2.05
[nasm.git] / doc / genpsdriver.pl
blobdd9b7a7f2275d14ba3d9de207f3d7d09dea2eeff
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;
14 use Env;
16 $perl = $ENV{PERL} || 'perl';
17 $srcdir = $ENV{srcdir} || File::Spec->curdir();
19 $versionfile = File::Spec->catfile($srcdir, File::Spec->updir(), 'version');
20 $genps = File::Spec->catfile($srcdir, 'genps.pl');
22 sysopen(VERSION, $versionfile, O_RDONLY)
23 or die "$0: cannot open $versionfile\n";
24 $version = <VERSION>;
25 chomp $version;
26 close(VERSION);
28 # \240 = no-break space, see @NASMEncoding in genps.pl.
29 # If we use a normal space, it breaks on 'doze platforms...
30 system($perl, $genps, '-subtitle', "version\240".$version,
31 @ARGV, 'nasmdoc.dip');