2002-05-19 06:17:28 +08:00
|
|
|
#!/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.
|
|
|
|
#
|
|
|
|
|
2002-05-21 12:10:57 +08:00
|
|
|
use File::Spec;
|
|
|
|
use Fcntl;
|
2006-02-04 08:23:30 +08:00
|
|
|
use Env;
|
2002-05-21 12:10:57 +08:00
|
|
|
|
2006-02-04 08:23:30 +08:00
|
|
|
$perl = $ENV{PERL} || 'perl';
|
|
|
|
$srcdir = $ENV{srcdir} || File::Spec->curdir();
|
2002-05-19 06:17:28 +08:00
|
|
|
|
2006-02-04 08:23:30 +08:00
|
|
|
$versionfile = File::Spec->catfile($srcdir, File::Spec->updir(), 'version');
|
2002-05-21 12:10:57 +08:00
|
|
|
$genps = File::Spec->catfile($srcdir, 'genps.pl');
|
|
|
|
|
|
|
|
sysopen(VERSION, $versionfile, O_RDONLY)
|
|
|
|
or die "$0: cannot open $versionfile\n";
|
2002-05-19 06:17:28 +08:00
|
|
|
$version = <VERSION>;
|
|
|
|
chomp $version;
|
|
|
|
close(VERSION);
|
|
|
|
|
2002-05-23 07:23:02 +08:00
|
|
|
# \240 = no-break space, see @NASMEncoding in genps.pl.
|
|
|
|
# If we use a normal space, it breaks on 'doze platforms...
|
2002-05-26 06:21:27 +08:00
|
|
|
system($perl, $genps, '-subtitle', "version\240".$version,
|
|
|
|
@ARGV, 'nasmdoc.dip');
|