make-rules/ips.mk
author Norm Jacobs <Norm.Jacobs@Sun.COM>
Fri, 11 Jun 2010 12:23:59 -0500
changeset 22 b89eb90ac9c5
parent 21 e651c453e960
child 26 8a9f4e791832
permissions -rw-r--r--
Add locale facet tagging to IPS makefile rules
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     1
#
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     2
# CDDL HEADER START
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     3
#
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     4
# The contents of this file are subject to the terms of the
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     5
# Common Development and Distribution License (the "License").
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     6
# You may not use this file except in compliance with the License.
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     7
#
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     8
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     9
# or http://www.opensolaris.org/os/licensing.
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    10
# See the License for the specific language governing permissions
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    11
# and limitations under the License.
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    12
#
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    13
# When distributing Covered Code, include this CDDL HEADER in each
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    14
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    15
# If applicable, add the following below this CDDL HEADER, with the
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    16
# fields enclosed by brackets "[]" replaced with your own identifying
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    17
# information: Portions Copyright [yyyy] [name of copyright owner]
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    18
#
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    19
# CDDL HEADER END
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    20
#
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    21
# Copyright (c) 2010, Oracle and/or it's affiliates.  All rights reserved.
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    22
#
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    23
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    24
#
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    25
# Rules and Macros for generating an IPS package manifest and publishing an
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    26
# IPS package to a pkg depot.
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    27
#
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    28
# To use these rules, include ../make-rules/ips.mk in your Makefile
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    29
# and define an "install" target appropriate to building your component.
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    30
# Ex:
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    31
#
12
41aeb1fd8c2d Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 7
diff changeset
    32
#	install:	$(COMPONENT_SRC)/build-$(MACH32)/.installed \
41aeb1fd8c2d Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 7
diff changeset
    33
#	 		$(COMPONENT_SRC)/build-$(MACH64)/.installed
2
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    34
#
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    35
# This set of rules makes the "publish" target the default target for make(1)
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    36
#
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    37
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    38
PKGSEND =	/usr/bin/pkgsend
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    39
PKGMOGRIFY =	/usr/bin/pkgmogrify
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    40
PKGDEPEND =	/usr/bin/pkgdepend
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    41
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    42
# Add some default transforms that should apply to everyone
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    43
PKGMOGRIFY_TRANSFORMS +=	$(WS_TOP)/transforms/defaults
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    44
PKGMOGRIFY_TRANSFORMS +=	$(WS_TOP)/transforms/actuators
4
3d5acfe9dab4 build zone creation rules
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 2
diff changeset
    45
PKGMOGRIFY_TRANSFORMS +=	$(WS_TOP)/transforms/devel
3d5acfe9dab4 build zone creation rules
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 2
diff changeset
    46
PKGMOGRIFY_TRANSFORMS +=	$(WS_TOP)/transforms/docs
22
b89eb90ac9c5 Add locale facet tagging to IPS makefile rules
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 21
diff changeset
    47
PKGMOGRIFY_TRANSFORMS +=	$(WS_TOP)/transforms/locale
2
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    48
12
41aeb1fd8c2d Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 7
diff changeset
    49
MANIFEST =	manifest-$(MACH)
41aeb1fd8c2d Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 7
diff changeset
    50
2
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    51
.DEFAULT:	publish
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    52
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    53
publish:	$(COMPONENT_SRC)/.published
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    54
7
d42300cb8715 add license/copyright info for ips generation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 4
diff changeset
    55
COPYRIGHT_FILE =	$(COMPONENT_NAME)-$(COMPONENT_VERSION).copyright
21
e651c453e960 forgot a couple of changes while breaking up bits
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 12
diff changeset
    56
IPS_COMPONENT_VERSION =	$(COMPONENT_VERSION)
7
d42300cb8715 add license/copyright info for ips generation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 4
diff changeset
    57
d42300cb8715 add license/copyright info for ips generation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 4
diff changeset
    58
$(PROTO_DIR)/$(COPYRIGHT_FILE):	$(COMPONENT_COPYRIGHT)
d42300cb8715 add license/copyright info for ips generation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 4
diff changeset
    59
	$(CP) $< [email protected]
d42300cb8715 add license/copyright info for ips generation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 4
diff changeset
    60
12
41aeb1fd8c2d Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 7
diff changeset
    61
$(COMPONENT_SRC)/$(MANIFEST):	install
2
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    62
	pkgsend generate $(PROTO_DIR) >[email protected]
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    63
12
41aeb1fd8c2d Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 7
diff changeset
    64
$(COMPONENT_SRC)/$(MANIFEST).mog:	$(COMPONENT_SRC)/$(MANIFEST) $(PROTO_DIR)/$(COPYRIGHT_FILE)
21
e651c453e960 forgot a couple of changes while breaking up bits
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 12
diff changeset
    65
	echo "set name=pkg.fmri value=pkg:/$(PUBLISHER)/$(COMPONENT_NAME)@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)" >[email protected]
2
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    66
	echo "set name=pkg.description value=\"$(COMPONENT_DESCRIPTION)\"" >>[email protected]
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    67
	echo "set name=pkg.name value=\"$(COMPONENT_DESCRIPTION)\"" >>[email protected]
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    68
	echo "set name=org.opensolaris.consolidation value=$(CONSOLIDATION)" >>[email protected]
7
d42300cb8715 add license/copyright info for ips generation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 4
diff changeset
    69
	echo "license $(COPYRIGHT_FILE) license=$(COPYRIGHT_FILE)" >>[email protected]
2
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    70
	pkgmogrify $(PKGMOGRIFY_MACROS:%=-D %) $(PKGMOGRIFY_TRANSFORMS) $< >>[email protected]
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    71
12
41aeb1fd8c2d Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 7
diff changeset
    72
$(COMPONENT_SRC)/$(MANIFEST).fdeps:	$(COMPONENT_SRC)/$(MANIFEST).mog
2
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    73
	pkgdepend generate -m $< $(PROTO_DIR) >[email protected]
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    74
12
41aeb1fd8c2d Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 7
diff changeset
    75
$(COMPONENT_SRC)/$(MANIFEST).fdeps.res:	$(COMPONENT_SRC)/$(MANIFEST).fdeps
2
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    76
	pkgdepend resolve -m $<
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    77
12
41aeb1fd8c2d Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 7
diff changeset
    78
$(COMPONENT_SRC)/.published:	$(COMPONENT_SRC)/$(MANIFEST).fdeps.res
2
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    79
	pkgsend -s $(PKG_REPO) publish --fmri-in-manifest \
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    80
		-d $(PROTO_DIR) $<
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    81
	$(TOUCH) [email protected]