doc: add some cross-references
[platform/upstream/nasm.git] / doc / genpsdriver.pl
1 #!/usr/bin/perl
2 #
3 # Runs the equivalent of the following command line:
4 #
5 #       $(PERL) $(srcdir)/genps.pl -subtitle "version `cat ../version`" \
6 #                nasmdoc.dip
7 #
8 # This is implemented as a Perl script since `cat ...` doesn't
9 # necessarily work on non-Unix systems.
10 #
11
12 use File::Spec;
13 use Fcntl;
14 use Env;
15
16 $perl   = $ENV{PERL}   || 'perl';
17 $srcdir = $ENV{srcdir} || File::Spec->curdir();
18
19 $versionfile = File::Spec->catfile($srcdir, File::Spec->updir(), 'version');
20 $genps = File::Spec->catfile($srcdir, 'genps.pl');
21
22 sysopen(VERSION, $versionfile, O_RDONLY)
23     or die "$0: cannot open $versionfile\n";
24 $version = <VERSION>;
25 chomp $version;
26 close(VERSION);
27
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');