Makefile revision ac823a0f31ed9c8cbe505cee2def262ac92ea6cd
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# CDDL HEADER START
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# The contents of this file are subject to the terms of the
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# Common Development and Distribution License (the "License").
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# You may not use this file except in compliance with the License.
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# See the License for the specific language governing permissions
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# and limitations under the License.
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# When distributing Covered Code, include this CDDL HEADER in each
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# If applicable, add the following below this CDDL HEADER, with the
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# fields enclosed by brackets "[]" replaced with your own identifying
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# information: Portions Copyright [yyyy] [name of copyright owner]
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# CDDL HEADER END
58796c10572cc1f7bf590f57194084c635afe096Matthew Petroff# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# Make sure we're getting a consistent execution environment for the
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# embedded scripts.
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# To suppress package dependency generation on any system, regardless
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# of how it was installed, set SUPPRESSPKGDEP=true in the build
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# environment.
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# Comment this line out or set "PKGDEBUG=" in your build environment
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# to get more verbose output from the make processes in usr/src/pkg
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# Cross platform packaging notes
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# By default, we package the proto area from the same architecture as
58796c10572cc1f7bf590f57194084c635afe096Matthew Petroff# the packaging build. In other words, if you're running nightly or
58796c10572cc1f7bf590f57194084c635afe096Matthew Petroff# bldenv on an x86 platform, it will take objects from the x86 proto
58796c10572cc1f7bf590f57194084c635afe096Matthew Petroff# area and use them to create x86 repositories.
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# If you want to create repositories for an architecture that's
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# different from $(uname -p), you do so by setting PKGMACH in your
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# build environment.
cf1b00269e6a363acfe397115fb123d1999759fdLiam P. White# For this to work correctly, the following must all happen:
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# 1. You need the desired proto area, which you can get either by
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# doing a gatekeeper-style build with the -U option to
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# nightly(1), or by using rsync. If you don't do this, you will
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# get packaging failures building all packages, because pkgsend
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# is unable to find the required binaries.
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# 2. You need the desired tools proto area, which you can get in the
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# same ways as the normal proto area. If you don't do this, you
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# will get packaging failures building onbld, because pkgsend is
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# unable to find the tools binaries.
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# 3. The remainder of this Makefile should never refer directly to
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# $(MACH). Instead, $(PKGMACH) should be used whenever an
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# architecture-specific path or token is needed. If this is done
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# incorrectly, then packaging will fail, and you will see the
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# value of $(uname -p) instead of the value of $(PKGMACH) in the
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# commands that fail.
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# 4. Each time a rule in this Makefile invokes $(MAKE), it should
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# pass PKGMACH=$(PKGMACH) explicitly on the command line. If
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# this is done incorrectly, then packaging will fail, and you
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# will see the value of $(uname -p) instead of the value of
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# $(PKGMACH) in the commands that fail.
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# Refer also to the convenience targets defined later in this
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# ROOT, TOOLS_PROTO, and PKGARCHIVE should be set by nightly or
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# bldenv. These macros translate them into terms of $PKGMACH, instead
2f48995b5616e7ec03e6731e508dfe8f641d4691John SmithPKGROOT.cmd= print $(ROOT) | sed -e s:/root_$(MACH):/root_$(PKGMACH):
2f48995b5616e7ec03e6731e508dfe8f641d4691John SmithTOOLSROOT.cmd= print $(TOOLS_PROTO) | sed -e s:/root_$(MACH):/root_$(PKGMACH):
2f48995b5616e7ec03e6731e508dfe8f641d4691John SmithPKGDEST.cmd= print $(PKGARCHIVE) | sed -e s:/$(MACH)/:/$(PKGMACH)/:
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# Always build the redistributable repository, but only build the
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# nonredistributable bits if we have access to closed source.
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# Some objects that result from the closed build are still
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# redistributable, and should be packaged as part of an open-only
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# build. Access to those objects is provided via the closed-bins
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# tarball. See usr/src/tools/scripts/bindrop.sh for details.
4b8d4136cf15a6811025301fa66d549200e1b99ajabiertxof# The packages directory will contain the processed manifests as
4b8d4136cf15a6811025301fa66d549200e1b99ajabiertxof# direct build targets and subdirectories for package metadata extracted
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# incidentally during manifest processing.
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# Nothing underneath $(PDIR) should ever be managed by SCM.
58796c10572cc1f7bf590f57194084c635afe096Matthew Petroff# The tools proto must be specified for dependency generation.
58796c10572cc1f7bf590f57194084c635afe096Matthew Petroff# Publication from the tools proto area is managed in the
58796c10572cc1f7bf590f57194084c635afe096Matthew Petroff# publication rule.
58796c10572cc1f7bf590f57194084c635afe096Matthew Petroff$(PDIR)/developer-build-onbld.dep:= PKGROOT= $(TOOLSROOT)
cf1b00269e6a363acfe397115fb123d1999759fdLiam P. White# To get these defaults, manifests should simply refer to $(PKGVERS).
2f48995b5616e7ec03e6731e508dfe8f641d4691John SmithPKGVERS= $(PKGVERS_COMPONENT),$(PKGVERS_BUILTON)-$(PKGVERS_BRANCH)
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# The ARCH32 and ARCH64 macros are used in the manifests to express
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# architecture-specific subdirectories in the installation paths
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# for isaexec'd commands.
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# We can't simply use $(MACH32) and $(MACH64) here, because they're
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# only defined for the build architecture. To do cross-platform
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# packaging, we need both values.
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# macros and transforms needed by pkgmogrify
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# If you append to this list using target-specific assignments (:=),
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# be very careful that the targets are of the form $(PDIR)/pkgname. If
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# you use a higher level target, or a package list, you'll trigger a
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# complete reprocessing of all manifests because they'll fail command
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# dependency checking.
2f48995b5616e7ec03e6731e508dfe8f641d4691John SmithPM_TRANSFORMS= common_actions publish restart_fmri defaults extract_metadata
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith 'PLATFORM=i86hvm' \
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith 'PLATFORM=i86pc' \
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith 'PLATFORM=i86xpv' \
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith 'ISALIST=amd64' \
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith 'ISALIST=i386'
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith 'PLATFORM=sun4u' \
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith 'PLATFORM=sun4v' \
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith 'ISALIST=sparcv9' \
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith 'ISALIST=sparc'
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# The package lists are generated with $(PKGDEP_TYPE) as their
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# dependency types, so that they can be included by either an
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith# incorporation or a group package.
2f48995b5616e7ec03e6731e508dfe8f641d4691John Smith$(PDIR)/osnet-incorporation.mog:= PKGDEP_TYPE= incorporate
PKGLISTS= \
# raw manifest (mypkg.mf)
# processed manifest (mypkg.mog)
# manifest with TBD dependencies (mypkg.dep)
# manifest with dependencies resolved (mypkg.res)
# placeholder to indicate successful publication (mypkg.pub)
# | pkg.depotd
$(PDIR):
@pkgfmt -c $<
# The full chain implies that there should be a .dep.res suffix rule,
# repo/pkgstat-specific subdir, in hopes of maybe giving some
} while ((e == 1) && (f !~ /name=pkg.fmri/)); \
FRC:
XMOD_PKGS= \
BRCMbnx \
BRCMbnxe \
SUNWkdc \