This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
add lib/overload/numbers.pm to (unused) output file list in regen.pl
[perl5.git] / regen.pl
CommitLineData
36bb303b 1#!/usr/bin/perl -w
f014cfc2
DM
2#
3# regen.pl - a wrapper that runs all *.pl scripts to to autogenerate files
4
9ad884cb
JH
5require 5.003; # keep this compatible, an old perl is all we may have before
6 # we build the new one
36bb303b 7
9ad884cb
JH
8# The idea is to move the regen_headers target out of the Makefile so that
9# it is possible to rebuild the headers before the Makefile is available.
10# (and the Makefile is unavailable until after Configure is run, and we may
11# wish to make a clean source tree but with current headers without running
12# anything else.
36bb303b 13
9ad884cb
JH
14use strict;
15my $perl = $^X;
36bb303b 16
9ad884cb 17# keep warnings.pl in sync with the CPAN distribution by not requiring core
b6b9a099
JC
18# changes. Um, what ?
19# safer_unlink ("warnings.h", "lib/warnings.pm");
36bb303b 20
f014cfc2
DM
21# Which scripts to run. Note the ordering: embed.pl must run after
22# opcode.pl, since it depends on pp.sym, and autodoc.pl should run last as
23# it reads all *.[ch] files, some of which may have been changed by other
24# scripts (eg reentr.c)
25
26my @scripts = qw(
27warnings.pl
28regcomp.pl
29reentr.pl
30overload.pl
31opcode.pl
32keywords.pl
33embed.pl
34autodoc.pl
35);
36
37# Which files are (re)generated by each script.
38# *** We no longer need these values, as the "changed" message is
523b3031
NC
39# now generated by regen_lib.pl, so should we just drop them?
40
9ad884cb
JH
41my %gen = (
42 'autodoc.pl' => [qw[pod/perlapi.pod pod/perlintern.pod]],
9ad884cb
JH
43 'embed.pl' => [qw[proto.h embed.h embedvar.h global.sym
44 perlapi.h perlapi.c]],
45 'keywords.pl' => [qw[keywords.h]],
46 'opcode.pl' => [qw[opcode.h opnames.h pp_proto.h pp.sym]],
47 'regcomp.pl' => [qw[regnodes.h]],
0bfd2b7f 48 'warnings.pl' => [qw[warnings.h lib/warnings.pm]],
8c798f87 49 'reentr.pl' => [qw[reentr.c reentr.h]],
e2bcdfc0 50 'overload.pl' => [qw[overload.c overload.h lib/overload/numbers.pm]],
9ad884cb 51 );
36bb303b 52
9ad884cb
JH
53sub do_cksum {
54 my $pl = shift;
55 my %cksum;
56 for my $f (@{ $gen{$pl} }) {
57 local *FH;
58 if (open(FH, $f)) {
59 local $/;
60 $cksum{$f} = unpack("%32C*", <FH>);
61 close FH;
62 } else {
63 warn "$0: $f: $!\n";
64 }
65 }
66 return %cksum;
36bb303b
NC
67}
68
f014cfc2 69foreach my $pl (@scripts) {
95aa0565
RB
70 my @command = ($^X, $pl, @ARGV);
71 print "@command\n";
95aa0565 72 system @command;
36bb303b 73}