Commit | Line | Data |
---|---|---|
a8a597b2 | 1 | use ExtUtils::MakeMaker; |
2 | use Config; | |
29fc1735 | 3 | use File::Spec; |
a8a597b2 | 4 | |
5 | my $e = $Config{'exe_ext'}; | |
6 | my $o = $Config{'obj_ext'}; | |
7 | my $exeout_flag = '-o '; | |
8 | if ($^O eq 'MSWin32') { | |
9 | if ($Config{'cc'} =~ /^cl/i) { | |
10 | $exeout_flag = '-Fe'; | |
11 | } | |
12 | elsif ($Config{'cc'} =~ /^bcc/i) { | |
13 | $exeout_flag = '-e'; | |
14 | } | |
15 | } | |
16 | ||
17 | WriteMakefile( | |
18 | NAME => "B", | |
19 | VERSION => "a5", | |
084610c0 | 20 | PL_FILES => { 'defsubs_h.PL' => 'defsubs.h' }, |
21 | MAN3PODS => {}, | |
a8a597b2 | 22 | clean => { |
e8edd1e6 | 23 | FILES => "perl$e *$o B.c defsubs.h *~" |
a8a597b2 | 24 | } |
4c1f658f | 25 | ); |
a8a597b2 | 26 | |
4c1f658f | 27 | package MY; |
28 | ||
29 | sub post_constants { | |
1c74f1bd | 30 | "\nLIBS = $Config::Config{libs}\n" |
4c1f658f | 31 | } |
32 | ||
29fc1735 | 33 | sub upupfile { |
34 | File::Spec->catfile(File::Spec->updir, | |
35 | File::Spec->updir, $_[0]); | |
36 | } | |
37 | ||
838c087d | 38 | sub MY::postamble { |
39 | my $op_h = upupfile('op.h'); | |
40 | my $cop_h = upupfile('cop.h'); | |
41 | my $noecho = shift->{NOECHO}; | |
29fc1735 | 42 | " |
838c087d | 43 | B\$(OBJ_EXT) : defsubs.h |
d19af0aa | 44 | |
838c087d | 45 | defsubs.h :: $op_h $cop_h |
5fc9822b | 46 | $noecho \$(NOOP) |
838c087d | 47 | " |
a8a597b2 | 48 | } |