-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.PL
65 lines (60 loc) · 1.7 KB
/
Makefile.PL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
use 5.006;
use strict;
use warnings;
use ExtUtils::MakeMaker;
use ExtUtils::Embed;
use Config;
sub MY::postamble {
my (undef,%inparams) = @_;
my @srcs = $inparams{C_EMBED_FILES};
my @objs = map { my $x = $_; $x=~s/\.c$/.o/i; $x } @srcs;
my @exes = map { my $x = $_; $x=~s/\.c$//i; $x } @srcs;
my @VARS = (
'PERL_EXT_INC = ' . $Config{archlibexp} . "/CORE",
'PERL_EXT_LIB = ' . $Config{sitearch},
'PERL_EXT_CPPFLAGS = ' . $Config{cppflags},
'PERL_EXT_LDFLAGS = ' . (
$Config{osname} eq 'darwin' ?
($Config{lddlflags} =~ s/-arch [^ ]+//gr)
: $Config{lddlflags}
) ,
'PERL_EXT_DLEXT = ' . $Config{'dlext'},
'PERL_EXT_PREFIX = ' . $Config{'prefix'},
'PERL_EXT_EMBED_CFLAGS = ' . eval { ExtUtils::Embed::ccopts },
'PERL_EXT_EMBED_LDFLAGS = ' . eval { ExtUtils::Embed::ldopts },
);
return "SRCS=@srcs"."\n"
. 'OBJS=$(SRCS:%.c=%.o)'."\n"
. 'EXES=$(SRCS:%.c=%)'."\n\n"
. 'CFLAGS+=${PERL_EXT_EMBED_CFLAGS}'."\n\n"
. 'LDFLAGS+=${PERL_EXT_EMBED_LDFLAGS}'."\n\n"
. join("\n", @VARS)
. << 'EOC'
embed: $(EXES)
clean:: myclean
myclean:
$(RM) $(OBJS) $(EXES)
EOC
}
WriteMakefile(
INSTALL_BASE => "$ENV{HOME}/usr",
NAME => 'Statistics::Running::Tiny',
AUTHOR => q{Andreas Hadjiprocopis <bliako@cpan.org>},
VERSION => '1.0',
ABSTRACT => '',
LICENSE => 'artistic_2',
PL_FILES => {},
MIN_PERL_VERSION => '5.006',
CONFIGURE_REQUIRES => {
'ExtUtils::MakeMaker' => '0',
},
BUILD_REQUIRES => {
'Test::More' => '0',
'Test::Harness' => '0',
},
PREREQ_PM => {
},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'Statistics-Running-Tiny-*' },
postamble => { C_EMBED_FILES => glob 'src/*.c' }
);