make-rules/perl-generic.mk
author Norm Jacobs <Norm.Jacobs@Oracle.COM>
Wed, 13 Apr 2011 09:58:06 -0700
changeset 181 87e11e685b1f
parent 157 accde06c81c4
permissions -rw-r--r--
7003927 userland should postprocess packaged files 7034188 userland should have common lint library rules 7034992 userland packages should include opensolaris.arc_url data 7019309 move ghostscript to userland (fix build)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
157
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
     1
#
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
     2
# CDDL HEADER START
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
     3
#
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
     4
# The contents of this file are subject to the terms of the
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
     5
# Common Development and Distribution License (the "License").
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
     6
# You may not use this file except in compliance with the License.
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
     7
#
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
     8
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
     9
# or http://www.opensolaris.org/os/licensing.
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    10
# See the License for the specific language governing permissions
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    11
# and limitations under the License.
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    12
#
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    13
# When distributing Covered Code, include this CDDL HEADER in each
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    14
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    15
# If applicable, add the following below this CDDL HEADER, with the
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    16
# fields enclosed by brackets "[]" replaced with your own identifying
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    17
# information: Portions Copyright [yyyy] [name of copyright owner]
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    18
#
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    19
# CDDL HEADER END
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    20
#
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    21
# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    22
#
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    23
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    24
include ../../../make-rules/prep.mk
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    25
include ../../../make-rules/ips.mk
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    26
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    27
# Maybe not necessary, but won't do any harm neither
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    28
PERL_ENV = MAKE=$(GMAKE)
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    29
# PATH has to contain the same CC compiler which was used for perl component
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    30
# itself
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    31
PERL_ENV += PATH=$(dir $(CC.studio.32)):$(PATH)
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    32
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    33
PERL_ARCH=$(shell arch)
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    34
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    35
PKG_MACROS             +=      PERL_ARCH=$(PERL_ARCH)
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    36
PKG_MACROS             +=      PERL_VERSION=$(PERL_VERSION)
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    37
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    38
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    39
################
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    40
# Prepare
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    41
################
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    42
$(BUILD_DIR)/%/.configured:	$(SOURCE_DIR)/.prep
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    43
	($(RM) -rf $(@D) ; $(MKDIR) $(@D))
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    44
	$(CLONEY) $(SOURCE_DIR) $(@D)
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    45
	$(COMPONENT_PRE_CONFIGURE_ACTION)
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    46
	(cd $(@D) ; $(PERL_ENV) $(PERL) Makefile.PL)
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    47
	$(COMPONENT_POST_CONFIGURE_ACTION)
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    48
	$(TOUCH) [email protected]
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    49
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    50
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    51
################
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    52
# Build
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    53
################
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    54
COMPONENT_BUILD_ENV	+= $(PERL_ENV)
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    55
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    56
# build the configured source
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    57
$(BUILD_DIR)/%/.built:	$(BUILD_DIR)/%/.configured
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    58
	$(COMPONENT_PRE_BUILD_ACTION)
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    59
	(cd $(@D) ; $(ENV) $(COMPONENT_BUILD_ENV) \
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    60
		$(GMAKE) $(COMPONENT_BUILD_ARGS) $(COMPONENT_BUILD_TARGETS))
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    61
	$(COMPONENT_POST_BUILD_ACTION)
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    62
	$(TOUCH) [email protected]
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    63
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    64
build:		$(VARIANTS:%=%/.built)
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    65
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    66
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    67
################
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    68
# Install
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    69
################
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    70
COMPONENT_INSTALL_TARGETS = \
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    71
	DESTDIR="$(PROTO_DIR)" install_vendor
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    72
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    73
$(BUILD_DIR)/%/.installed:	$(BUILD_DIR)/%/.built
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    74
	$(COMPONENT_PRE_INSTALL_ACTION)
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    75
	(cd $(@D) ; $(ENV) $(COMPONENT_INSTALL_ENV) $(GMAKE) \
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    76
			$(COMPONENT_INSTALL_ARGS) $(COMPONENT_INSTALL_TARGETS))
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    77
	# Now walk the files which should have the magic line #!/usr/bin/perl
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    78
	# changed to comply with Solaris standards
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    79
	(cd $(PROTO_DIR); \
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    80
		for file in $(PERL_FILES_TO_UPDATE_MAGIC_LINE); do \
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    81
			$(CHMOD) +w $$file; \
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    82
			$(PERL) -pi -e 's,^#!.*?perl,#!$(PERL), if $$.==1' $$file; \
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    83
		done)
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    84
	$(COMPONENT_POST_INSTALL_ACTION)
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    85
	$(TOUCH) [email protected]
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    86
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    87
install:	$(VARIANTS:%=%/.installed)
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    88
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    89
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    90
################
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    91
# Test
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    92
################
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    93
# Do not create .tested file, so that test can be re-run anytime
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    94
$(BUILD_DIR)/%/.tested:	$(BUILD_DIR)/%/.built
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    95
	@cd $(@D); $(GMAKE) test
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    96
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    97
test:  $(VARIANTS:%=%/.tested)
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    98
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
    99
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
   100
################
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
   101
# General stuff
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
   102
################
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
   103
BUILD_PKG_DEPENDENCIES =	$(BUILD_TOOLS)
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
   104
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
   105
clean:: 
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
   106
	$(RM) -r $(BUILD_DIR) $(PROTO_DIR) $(VARIANTS)
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
   107
accde06c81c4 7030521 move perl DBI module to userland
Vladimir Marek <Vladimir.Marek@oracle.com>
parents:
diff changeset
   108
include ../../../make-rules/depend.mk