Upgrade to Devel::PPPort 3.00.
[p5sagit/p5-mst-13.2.git] / ext / Devel / PPPort / Makefile.PL
CommitLineData
adfe19db 1################################################################################
2#
3# Makefile.PL -- generate Makefile
4#
5################################################################################
6#
7# $Revision: 13 $
8# $Author: mhx $
9# $Date: 2004/08/13 12:49:26 +0200 $
10#
11################################################################################
12#
13# Version 3.x, Copyright (C) 2004, Marcus Holland-Moritz.
14# Version 2.x, Copyright (C) 2001, Paul Marquess.
15# Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
16#
17# This program is free software; you can redistribute it and/or
18# modify it under the same terms as Perl itself.
19#
20################################################################################
21
0a7c7f4f 22use ExtUtils::MakeMaker;
adfe19db 23require 5.003;
0a7c7f4f 24
adfe19db 25unless ($ENV{'PERL_CORE'}) {
26 $ENV{'PERL_CORE'} = 1 if grep { $_ eq 'PERL_CORE=1' } @ARGV;
9fdbfc11 27}
adfe19db 28
29if ($ENV{'PERL_CORE'}) {
30 # Pods will be built by installman.
31 @coreopts = ( MAN3PODS => {} );
9fdbfc11 32}
33else {
adfe19db 34 # Devel::PPPort is in the core since 5.7.3
35 @coreopts = ( INSTALLDIRS => ($] >= 5.007003 ? 'perl' : 'site') );
36}
37
38@ARGV = map { /^--with-(.*)/ && ++$opt{$1} ? () : $_ } @ARGV;
39
40%PL_FILES = ( 'PPPort_pm.PL' => 'PPPort.pm',
41 'PPPort_xs.PL' => 'PPPort.xs',
42 'ppport_h.PL' => 'ppport.h' ),
43
44@C_FILES = qw{ module2.c module3.c };
45
46@clean = qw{ $(H_FILES) PPPort.c };
47
48if ($opt{'apicheck'}) {
49 $PL_FILES{'apicheck_c.PL'} = 'apicheck.c';
50 push @C_FILES, qw{ apicheck.c };
51 push @clean, qw{ apicheck.c };
9fdbfc11 52}
53
0a7c7f4f 54WriteMakefile(
adfe19db 55 NAME => 'Devel::PPPort',
56 VERSION_FROM => 'PPPort_pm.PL',
57 PL_FILES => \%PL_FILES,
58 PM => { 'PPPort.pm' => '$(INST_LIBDIR)/PPPort.pm' },
59 C => \@C_FILES,
60 H => [ qw(ppport.h) ],
61 OBJECT => '$(BASEEXT)$(OBJ_EXT) $(O_FILES)',
62 XSPROTOARG => '-noprototypes',
63 clean => { FILES => "@clean" },
64 depend => { '$(OBJECT)' => '$(H_FILES)' },
65 @coreopts,
0a7c7f4f 66);
adfe19db 67
68sub MY::postamble {
69 package MY;
70 my $post = shift->SUPER::postamble(@_);
71 $post .= <<'POSTAMBLE';
72
73purge_all: realclean
74 @$(RM_F) PPPort.pm PPPort.xs t/*.t
75
76regen:
77 $(PERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) PPPort_pm.PL
78 $(PERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) PPPort_xs.PL
79 $(PERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) mktests.PL
80 $(PERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) ppport_h.PL
81
82POSTAMBLE
83 return $post;
84}
85