make-rules/makemaker.mk
changeset 260 cc1837bbe69e
child 774 d0cbca26a17c
equal deleted inserted replaced
259:520697a05dde 260:cc1837bbe69e
       
     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 (the "License").
       
     6 # You may not use this file except in compliance with the License.
       
     7 #
       
     8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
       
     9 # or http://www.opensolaris.org/os/licensing.
       
    10 # See the License for the specific language governing permissions
       
    11 # and limitations under the License.
       
    12 #
       
    13 # When distributing Covered Code, include this CDDL HEADER in each
       
    14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
       
    15 # If applicable, add the following below this CDDL HEADER, with the
       
    16 # fields enclosed by brackets "[]" replaced with your own identifying
       
    17 # information: Portions Copyright [yyyy] [name of copyright owner]
       
    18 #
       
    19 # CDDL HEADER END
       
    20 #
       
    21 # Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
       
    22 #
       
    23 
       
    24 # we only do 32 bit perl for now.
       
    25 BITS=32
       
    26 
       
    27 COMMON_PERL_ENV +=	MAKE=$(GMAKE)
       
    28 COMMON_PERL_ENV +=	PATH=$(dir $(CC)):$(PATH)
       
    29 COMMON_PERL_ENV +=	LANG=""
       
    30 COMMON_PERL_ENV +=	CC="$(CC)"
       
    31 COMMON_PERL_ENV +=	CFLAGS="$(PERL_OPTIMIZE)"
       
    32 
       
    33 # Yes.  Perl is just scripts, for now, but we need architecture
       
    34 # directories so that it populates all architecture prototype
       
    35 # directories.
       
    36 PERLBD_ARCH = $(BUILD_DIR)/$(MACH32)
       
    37 
       
    38 $(PERLBD_ARCH)-5.8.4/.configured:		PERL_VERSION=5.8.4
       
    39 $(PERLBD_ARCH)-5.12/.configured:		PERL_VERSION=5.12
       
    40 
       
    41 BUILD_32 =	$(PERL_VERSIONS:%=$(PERLBD_ARCH)-%/.built)
       
    42 INSTALL_32 =	$(BUILD_32:%/.built=%/.installed)
       
    43 TEST_32 =	$(BUILD_32:%/.built=%/.tested)
       
    44 
       
    45 
       
    46 COMPONENT_CONFIGURE_ENV +=	$(COMMON_PERL_ENV)
       
    47 COMPONENT_CONFIGURE_ENV +=	PERL="$(PERL)"
       
    48 $(PERLBD_ARCH)-%/.configured:	$(SOURCE_DIR)/.prep
       
    49 	($(RM) -r $(@D) ; $(MKDIR) $(@D))
       
    50 	$(CLONEY) $(SOURCE_DIR) $(@D)
       
    51 	$(COMPONENT_PRE_CONFIGURE_ACTION)
       
    52 	(cd $(@D) ; $(COMPONENT_CONFIGURE_ENV) $(PERL) $(PERL_FLAGS) \
       
    53 				Makefile.PL $(CONFIGURE_OPTIONS))
       
    54 	$(COMPONENT_POST_CONFIGURE_ACTION)
       
    55 	$(TOUCH) $@
       
    56 
       
    57 
       
    58 COMPONENT_BUILD_ENV +=	$(COMMON_PERL_ENV)
       
    59 $(PERLBD_ARCH)-%/.built:	$(PERLBD_ARCH)-%/.configured
       
    60 	$(COMPONENT_PRE_BUILD_ACTION)
       
    61 	(cd $(@D) ; $(ENV) $(COMPONENT_BUILD_ENV) \
       
    62 		$(GMAKE) $(COMPONENT_BUILD_ARGS) $(COMPONENT_BUILD_TARGETS))
       
    63 	$(COMPONENT_POST_BUILD_ACTION)
       
    64 	$(TOUCH) $@
       
    65 
       
    66 
       
    67 COMPONENT_INSTALL_ARGS +=	DESTDIR="$(PROTO_DIR)"
       
    68 COMPONENT_INSTALL_TARGETS =	install_vendor
       
    69 COMPONENT_INSTALL_ENV +=	$(COMMON_PERL_ENV)
       
    70 $(PERLBD_ARCH)-%/.installed:	$(PERLBD_ARCH)-%/.built
       
    71 	$(COMPONENT_PRE_INSTALL_ACTION)
       
    72 	(cd $(@D) ; $(ENV) $(COMPONENT_INSTALL_ENV) $(GMAKE) \
       
    73 			$(COMPONENT_INSTALL_ARGS) $(COMPONENT_INSTALL_TARGETS))
       
    74 	$(COMPONENT_POST_INSTALL_ACTION)
       
    75 	$(TOUCH) $@
       
    76 
       
    77 
       
    78 COMPONENT_TEST_TARGETS =	check
       
    79 COMPONENT_TEST_ENV +=	$(COMMON_PERL_ENV)
       
    80 $(PERLBD_ARCH)-%/.tested:	$(PERLBD_ARCH)-%/.built
       
    81 	$(COMPONENT_PRE_TEST_ACTION)
       
    82 	(cd $(@D) ; $(ENV) $(COMPONENT_TEST_ENV) $(GMAKE) \
       
    83 			$(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS))
       
    84 	$(COMPONENT_POST_TEST_ACTION)
       
    85 	$(TOUCH) $@
       
    86 
       
    87 clean:: 
       
    88 	$(RM) -r $(BUILD_DIR) $(PROTO_DIR)