1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22use ExtUtils::MakeMaker;
23use Config;
24use File::Spec;
25
26my $e = $Config{'exe_ext'};
27my $o = $Config{'obj_ext'};
28my $exeout_flag = '-o ';
29if ($^O eq 'MSWin32') {
30    if ($Config{'cc'} =~ /^cl/i) {
31	$exeout_flag = '-Fe';
32    }
33    elsif ($Config{'cc'} =~ /^bcc/i) {
34	$exeout_flag = '-e';
35    }
36}
37
38WriteMakefile(
39    NAME	    => "B",
40    VERSION_FROM    => "B.pm",
41    PL_FILES	    => { 'defsubs_h.PL' => 'defsubs.h' },
42    MAN3PODS	    => {},
43    clean	    => {
44	FILES	    => "perl$e *$o B.c defsubs.h *~"
45    }
46);
47
48package MY;
49
50sub post_constants {
51    "\nLIBS = $Config::Config{libs}\n"
52}
53
54sub upupfile {
55    File::Spec->catfile(File::Spec->updir,
56			File::Spec->updir, $_[0]);
57}
58
59sub MY::postamble {
60    my $op_h   = upupfile('op.h');
61    my $cop_h  = upupfile('cop.h');
62    my $noecho = shift->{NOECHO};
63"
64B\$(OBJ_EXT) : defsubs.h
65
66defsubs.h :: $op_h $cop_h defsubs_h.PL
67	$noecho \$(NOOP)
68"
69}
70