3 # Read the "version" file and produce some macro declarations
9 my($def, $name, $val) = @_;
11 $def =~ s/\</${name}/g;
12 $def =~ s/\@/${val}/g;
17 ($vfile, $vout, $def) = @ARGV;
18 sysopen(VERSION
, $vfile, O_RDONLY
) or die "$0: Cannot open $vfile\n";
23 unless ( $vfile =~ /^(([0-9]+)\.([0-9]+))\s+([0-9]+)$/ ) {
24 die "$0: Cannot parse version format\n";
31 sysopen(VI
, $vout, O_WRONLY
|O_CREAT
|O_TRUNC
)
32 or die "$0: Cannot create $vout: $!\n";
33 print VI defx
($def, 'VERSION', $version);
34 print VI defx
($def, 'VERSION_STR', '"'.$version.'"');
35 print VI defx
($def, 'VERSION_MAJOR', $vma);
36 print VI defx
($def, 'VERSION_MINOR', $vmi);
37 print VI defx
($def, 'YEAR', $year);
38 print VI defx
($def, 'YEAR_STR', '"'.$year.'"');