Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 75 lines (63 sloc) 2.092 kb
36bb303 regen_headers outside Makefile (was Re: [PATCH] embed.pl doc)
Nicholas Clark authored
1 #!/usr/bin/perl -w
f014cfc @iabyn tidy up regen.pl (no functional changes)
iabyn authored
2 #
3 # regen.pl - a wrapper that runs all *.pl scripts to to autogenerate files
4
9ad884c @jhi regen_headers tiny tidying:
jhi authored
5 require 5.003; # keep this compatible, an old perl is all we may have before
6 # we build the new one
36bb303 regen_headers outside Makefile (was Re: [PATCH] embed.pl doc)
Nicholas Clark authored
7
9ad884c @jhi regen_headers tiny tidying:
jhi authored
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.
36bb303 regen_headers outside Makefile (was Re: [PATCH] embed.pl doc)
Nicholas Clark authored
13
9ad884c @jhi regen_headers tiny tidying:
jhi authored
14 use strict;
15 my $perl = $^X;
36bb303 regen_headers outside Makefile (was Re: [PATCH] embed.pl doc)
Nicholas Clark authored
16
9ad884c @jhi regen_headers tiny tidying:
jhi authored
17 # keep warnings.pl in sync with the CPAN distribution by not requiring core
b6b9a09 Re: [patch] refine make regen to be more selective
Jim Cromie authored
18 # changes. Um, what ?
19 # safer_unlink ("warnings.h", "lib/warnings.pm");
36bb303 regen_headers outside Makefile (was Re: [PATCH] embed.pl doc)
Nicholas Clark authored
20
f014cfc @iabyn tidy up regen.pl (no functional changes)
iabyn authored
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
26 my @scripts = qw(
27 keywords.pl
07d48c2 @iabyn make script execution order in regen.pl mostly alphabetical
iabyn authored
28 opcode.pl
29 overload.pl
30 reentr.pl
31 regcomp.pl
32 warnings.pl
33
f014cfc @iabyn tidy up regen.pl (no functional changes)
iabyn authored
34 embed.pl
35 autodoc.pl
36 );
37
38 # Which files are (re)generated by each script.
39 # *** We no longer need these values, as the "changed" message is
523b303 Move all the logic to print the "Changed" message into regen_lib.pl,
Nicholas Clark authored
40 # now generated by regen_lib.pl, so should we just drop them?
41
9ad884c @jhi regen_headers tiny tidying:
jhi authored
42 my %gen = (
43 'autodoc.pl' => [qw[pod/perlapi.pod pod/perlintern.pod]],
44 'embed.pl' => [qw[proto.h embed.h embedvar.h global.sym
45 perlapi.h perlapi.c]],
46 'keywords.pl' => [qw[keywords.h]],
47 'opcode.pl' => [qw[opcode.h opnames.h pp_proto.h pp.sym]],
48 'regcomp.pl' => [qw[regnodes.h]],
0bfd2b7 @rgs "make regen" should run reentr.pl
rgs authored
49 'warnings.pl' => [qw[warnings.h lib/warnings.pm]],
8c798f8 Fix typo spotted by Rafael. Close the file handle explicity and check
Nicholas Clark authored
50 'reentr.pl' => [qw[reentr.c reentr.h]],
e2bcdfc @iabyn add lib/overload/numbers.pm to (unused) output file list in regen.pl
iabyn authored
51 'overload.pl' => [qw[overload.c overload.h lib/overload/numbers.pm]],
9ad884c @jhi regen_headers tiny tidying:
jhi authored
52 );
36bb303 regen_headers outside Makefile (was Re: [PATCH] embed.pl doc)
Nicholas Clark authored
53
9ad884c @jhi regen_headers tiny tidying:
jhi authored
54 sub do_cksum {
55 my $pl = shift;
56 my %cksum;
57 for my $f (@{ $gen{$pl} }) {
58 local *FH;
59 if (open(FH, $f)) {
60 local $/;
61 $cksum{$f} = unpack("%32C*", <FH>);
62 close FH;
63 } else {
64 warn "$0: $f: $!\n";
65 }
66 }
67 return %cksum;
36bb303 regen_headers outside Makefile (was Re: [PATCH] embed.pl doc)
Nicholas Clark authored
68 }
69
f014cfc @iabyn tidy up regen.pl (no functional changes)
iabyn authored
70 foreach my $pl (@scripts) {
95aa056 add -v to regen.pl and friends
Robin Barker authored
71 my @command = ($^X, $pl, @ARGV);
72 print "@command\n";
73 system @command;
36bb303 regen_headers outside Makefile (was Re: [PATCH] embed.pl doc)
Nicholas Clark authored
74 }
Something went wrong with that request. Please try again.