Upgrade to Devel::PPPort 3.07
[p5sagit/p5-mst-13.2.git] / ext / Devel / PPPort / Makefile.PL
CommitLineData
adfe19db 1################################################################################
2#
3# Makefile.PL -- generate Makefile
4#
5################################################################################
6#
0d0f8426 7# $Revision: 17 $
adfe19db 8# $Author: mhx $
0d0f8426 9# $Date: 2006/01/14 18:07:57 +0100 $
adfe19db 10#
11################################################################################
12#
0d0f8426 13# Version 3.x, Copyright (C) 2004-2006, Marcus Holland-Moritz.
adfe19db 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.
0d0f8426 31 @moreopts = ( MAN3PODS => {} );
9fdbfc11 32}
33else {
adfe19db 34 # Devel::PPPort is in the core since 5.7.3
0d0f8426 35 @moreopts = ( INSTALLDIRS => ($] >= 5.007003 ? 'perl' : 'site') );
adfe19db 36}
37
38@ARGV = map { /^--with-(.*)/ && ++$opt{$1} ? () : $_ } @ARGV;
39
841abb5c 40%PL_FILES = ( 'ppport_h.PL' => 'ppport.h' ),
adfe19db 41
42@C_FILES = qw{ module2.c module3.c };
43
44@clean = qw{ $(H_FILES) PPPort.c };
45
46if ($opt{'apicheck'}) {
47 $PL_FILES{'apicheck_c.PL'} = 'apicheck.c';
48 push @C_FILES, qw{ apicheck.c };
49 push @clean, qw{ apicheck.c };
9fdbfc11 50}
51
0d0f8426 52if (eval $ExtUtils::MakeMaker::VERSION >= 6.30_01) {
53 print "Setting license tag...\n";
54 push @moreopts, LICENSE => 'perl';
55}
56
0a7c7f4f 57WriteMakefile(
adfe19db 58 NAME => 'Devel::PPPort',
59 VERSION_FROM => 'PPPort_pm.PL',
60 PL_FILES => \%PL_FILES,
61 PM => { 'PPPort.pm' => '$(INST_LIBDIR)/PPPort.pm' },
62 C => \@C_FILES,
63 H => [ qw(ppport.h) ],
64 OBJECT => '$(BASEEXT)$(OBJ_EXT) $(O_FILES)',
65 XSPROTOARG => '-noprototypes',
66 clean => { FILES => "@clean" },
67 depend => { '$(OBJECT)' => '$(H_FILES)' },
0d0f8426 68 @moreopts,
0a7c7f4f 69);
adfe19db 70
71sub MY::postamble {
72 package MY;
73 my $post = shift->SUPER::postamble(@_);
74 $post .= <<'POSTAMBLE';
75
76purge_all: realclean
77 @$(RM_F) PPPort.pm PPPort.xs t/*.t
78
79regen:
80 $(PERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) PPPort_pm.PL
81 $(PERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) PPPort_xs.PL
82 $(PERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) mktests.PL
83 $(PERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) ppport_h.PL
84
85POSTAMBLE
86 return $post;
87}
88