Commit | Line | Data |
---|---|---|
79ee8297 MB |
1 | use ExtUtils::MakeMaker; |
2 | use Config; | |
3 | ||
4 | WriteMakefile( | |
5 | NAME => "B", | |
f64a6365 | 6 | VERSION => "a4", |
79ee8297 MB |
7 | OBJECT => "B.o ccop.o byterun.o", |
8 | depend => { | |
9 | "B.o" => "B.c ccop.h bytecode.h byterun.h", | |
10 | "ccop.o" => "ccop.c ccop.h" | |
11 | }, | |
12 | clean => { | |
f64a6365 | 13 | FILES => "perl byteperl btest btest.c *.o B.c *~" |
79ee8297 MB |
14 | } |
15 | ); | |
16 | ||
17 | sub MY::post_constants { | |
18 | "\nLIBS = $Config{libs}\n" | |
19 | } | |
20 | ||
21 | sub MY::top_targets { | |
22 | my $self = shift; | |
23 | my $targets = $self->MM::top_targets(); | |
24 | $targets =~ s/^(all ::.*)$/$1 byteperl/m; | |
25 | return <<'EOT' . $targets; | |
26 | # | |
27 | # byterun.h, byterun.c and Asmdata.pm are auto-generated. If any of the | |
28 | # files are missing or if you change bytecode.pl (which is what generates | |
29 | # them all) then you can "make regen_headers" to regenerate them. | |
30 | # | |
31 | regen_headers: | |
32 | $(PERL) bytecode.pl | |
33 | $(MV) Asmdata.pm B | |
34 | # | |
35 | # byteperl is *not* a standard perl+XSUB executable. It's a special | |
36 | # program for running standalone bytecode executables. It isn't an XSUB | |
37 | # at the moment because a standlone Perl program needs to set up curpad | |
38 | # which is overwritten on exit from an XSUB. | |
39 | # | |
40 | byteperl: byteperl.o B.o ccop.o byterun.o | |
41 | $(CC) -o byteperl byteperl.o B.o ccop.o byterun.o $(LDFLAGS) -L$(PERL_ARCHLIB)/CORE -lperl $(LIBS) | |
42 | EOT | |
43 | } |