ignore build products on OS X
[imager.git] / dynfilt / Makefile.PL
CommitLineData
52db4f96 1use strict;
02d1d628
AMH
2use Config;
3use ExtUtils::MakeMaker;
52db4f96 4my $Verbose = 1;
02d1d628 5
52db4f96 6my $lddl=$Config{"lddlflags"};
02d1d628 7
52db4f96 8my @plugins= qw(dyntest dt2 mandelbrot flines);
02d1d628 9
52db4f96 10my $libstr=join(' ',map { $_.'.$(SO)' } @plugins);
02d1d628
AMH
11
12#print $libstr,"\n";
13#print $objstr,"\n";
14#print MY::top_targets();
15
16WriteMakefile(
17 NAME => 'Imager::plugins',
18 SKIP => [qw(all dynamic static )],
19 clean => {'FILES' => $libstr},
20);
21
22
23
24
25sub lddl_magic {
26 my $t;
27 $t=$lddl;
28 $t=~s/-bI:\$\(PERL_INC\)\/perl.exp//;
29 $t=~s/\$\(BASEEXT\)/$_[0]/;
30 return $t;
31}
32
33
34
35
36sub MY::top_targets {
37 use Config;
38if ($^O eq 'aix') {
39 '
40all :: dynamic
41
42dynamic :: '.$libstr.(join("\n",map { qq{
43
44$_.\$(SO): $_\$(OBJ_EXT)
45 LD_RUN_PATH="\$(LD_RUN_PATH)" \$(LD) -o \$\@ }.lddl_magic($_).qq{ \$(OTHERLDFLAGS) $_\$(OBJ_EXT)
46
47} } @plugins)).'
48
49
50pure_all ::
3e567f83 51 $(NOOP)
02d1d628
AMH
52
53';
54
55}
56elsif ($^O =~ /win32/i && $Config{cc} =~ /cl/) {
8a00cb26 57 my @libpth = grep /\S/, split /("[^"]*"|\S+)/,$Config{libpth};
02d1d628
AMH
58 '
59all :: dynamic
60
8a00cb26 61dynamic :: '.$libstr.(join("\n",map { qq{
02d1d628
AMH
62
63$_.\$(SO): $_\$(OBJ_EXT)
64 \$(LD) /OUT:\$\@ }.lddl_magic($_).qq{ \$(OTHERLDFLAGS) $_\$(OBJ_EXT) $Config{libs} }.join(' ', map "/libpath:$_", @libpth).qq{
65
66} } @plugins)).'
67
68
69pure_all ::
bd473100 70 $(NOOP)
02d1d628
AMH
71
72';
73
74} else {
8a00cb26
TC
75 my $ldrun = $^O =~ /win32/i ? '' : 'LD_RUN_PATH="$(LD_RUN_PATH)"';
76 my $phony_colon = $Config{make} eq 'dmake' ? ':' : '::';
77
78 "
79all $phony_colon dynamic
02d1d628 80
8a00cb26 81dynamic $phony_colon ".$libstr.(join("\n",map { qq{
02d1d628
AMH
82
83$_.\$(SO): $_\$(OBJ_EXT)
8a00cb26 84 $ldrun \$(LD) -o \$\@ \$(LDDLFLAGS) \$(OTHERLDFLAGS) $_\$(OBJ_EXT)
02d1d628
AMH
85
86} } @plugins)).'
87
88
89pure_all ::
3e567f83 90 $(NOOP)
02d1d628
AMH
91
92';
93
94}
95}
55932d2a
TC
96
97# EU::MM crashes without this when we define it in the base Makefile.PL
7fdbfba8
TC
98# but then warns about redefinition, so delete the GLOB entry
99BEGIN { delete $MY::{metafile} }
55932d2a
TC
100sub MY::metafile {
101 '';
102}