0
0
mirror of https://github.com/netwide-assembler/nasm.git synced 2025-07-24 10:25:42 -04:00
nasm/doc/genpsdriver.pl

28 lines
722 B
Perl

#!/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.
#
use File::Spec;
use Fcntl;
$perl = $ENV{'PERL'} || 'perl';
$srcdir = $ENV{'srcdir'} || '.';
$versionfile = File::Spec->catfile(File::Spec->updir($srcdir), 'version');
$genps = File::Spec->catfile($srcdir, 'genps.pl');
sysopen(VERSION, $versionfile, O_RDONLY)
or die "$0: cannot open $versionfile\n";
$version = <VERSION>;
chomp $version;
close(VERSION);
system($perl, $genps, '-subtitle', 'version '.$version, 'nasmdoc.dip');