Makefile revision 70f9559bd0c02885d84a425eaafc8c280df10efb
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync# CDDL HEADER START
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync# The contents of this file are subject to the terms of the
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync# Common Development and Distribution License (the "License").
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync# You may not use this file except in compliance with the License.
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync# See the License for the specific language governing permissions
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync# and limitations under the License.
9eb499828dd875d229531b50d05f016b8a1f1dd9vboxsync# When distributing Covered Code, include this CDDL HEADER in each
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# If applicable, add the following below this CDDL HEADER, with the
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# fields enclosed by brackets "[]" replaced with your own identifying
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# information: Portions Copyright [yyyy] [name of copyright owner]
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync# CDDL HEADER END
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# Make sure we're getting a consistent execution environment for the
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# embedded scripts.
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# To suppress package dependency generation on any system, regardless
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# of how it was installed, set SUPPRESSPKGDEP=true in the build
da6747c2419b9cea8b5e2c576a30a5de999a8ab3vboxsync# environment.
bffb24521128f5183aafbef6542e7dacf20b5132vboxsync# Comment this line out or set "PKGDEBUG=" in your build environment
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# to get more verbose output from the make processes in usr/src/pkg
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# Cross platform packaging notes
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# By default, we package the proto area from the same architecture as
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync# the packaging build. In other words, if you're running nightly or
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync# bldenv on an x86 platform, it will take objects from the x86 proto
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync# area and use them to create x86 repositories.
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# If you want to create repositories for an architecture that's
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# different from $(uname -p), you do so by setting PKGMACH in your
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# build environment.
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# For this to work correctly, the following must all happen:
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync# 1. You need the desired proto area, which you can get either by
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# doing a gatekeeper-style build with the -U option to
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync# nightly(1), or by using rsync. If you don't do this, you will
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# get packaging failures building all packages, because pkgsend
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# is unable to find the required binaries.
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# 2. You need the desired tools proto area, which you can get in the
da6747c2419b9cea8b5e2c576a30a5de999a8ab3vboxsync# same ways as the normal proto area. If you don't do this, you
0a724db1030736c131a45392c0ebb6bb25362917vboxsync# will get packaging failures building onbld, because pkgsend is
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# unable to find the tools binaries.
13c94cb9d95cf4865646e86b944c09e1af2fe48cvboxsync# 3. The remainder of this Makefile should never refer directly to
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# $(MACH). Instead, $(PKGMACH) should be used whenever an
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# architecture-specific path or token is needed. If this is done
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# incorrectly, then packaging will fail, and you will see the
c33cfcef143f5dc2148c35d7b1dd1a32183f1926vboxsync# value of $(uname -p) instead of the value of $(PKGMACH) in the
bffb24521128f5183aafbef6542e7dacf20b5132vboxsync# commands that fail.
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# 4. Each time a rule in this Makefile invokes $(MAKE), it should
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# pass PKGMACH=$(PKGMACH) explicitly on the command line. If
13c94cb9d95cf4865646e86b944c09e1af2fe48cvboxsync# this is done incorrectly, then packaging will fail, and you
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# will see the value of $(uname -p) instead of the value of
ad34209dccf31d54e2277d732a90ce6ea4374362vboxsync# $(PKGMACH) in the commands that fail.
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# Refer also to the convenience targets defined later in this
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync# ROOT, TOOLS_PROTO, and PKGARCHIVE should be set by nightly or
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# bldenv. These macros translate them into terms of $PKGMACH, instead
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncPKGROOT.cmd= print $(ROOT) | sed -e s:/root_$(MACH):/root_$(PKGMACH):
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncTOOLSROOT.cmd= print $(TOOLS_PROTO) | sed -e s:/root_$(MACH):/root_$(PKGMACH):
da6747c2419b9cea8b5e2c576a30a5de999a8ab3vboxsyncPKGDEST.cmd= print $(PKGARCHIVE) | sed -e s:/$(MACH)/:/$(PKGMACH)/:
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# Always build the redistributable repository, but only build the
27efd9329f6a90f7cacf840031e5305f98975960vboxsync# nonredistributable bits if we have access to closed source.
ad34209dccf31d54e2277d732a90ce6ea4374362vboxsync# Some objects that result from the closed build are still
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# redistributable, and should be packaged as part of an open-only
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync# build. Access to those objects is provided via the closed-bins
27efd9329f6a90f7cacf840031e5305f98975960vboxsync# tarball. See usr/src/tools/scripts/bindrop.sh for details.
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# The packages directory will contain the processed manifests as
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# direct build targets and subdirectories for package metadata extracted
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync# incidentally during manifest processing.
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# Nothing underneath $(PDIR) should ever be managed by SCM.
a0a9f39e8864357c2e1e61106958411240f5bf6bvboxsync# The tools proto must be specified for dependency generation.
a0a9f39e8864357c2e1e61106958411240f5bf6bvboxsync# Publication from the tools proto area is managed in the
a0a9f39e8864357c2e1e61106958411240f5bf6bvboxsync# publication rule.
a0a9f39e8864357c2e1e61106958411240f5bf6bvboxsync$(PDIR)/developer-build-onbld.dep:= PKGROOT= $(TOOLSROOT)
2b66a097b19f31e00af3abc508a3ff8c74ca1f8avboxsync# To get these defaults, manifests should simply refer to $(PKGVERS).
27efd9329f6a90f7cacf840031e5305f98975960vboxsyncPKGVERS= $(PKGVERS_COMPONENT),$(PKGVERS_BUILTON)-$(PKGVERS_BRANCH)
2b66a097b19f31e00af3abc508a3ff8c74ca1f8avboxsync# The ARCH32 and ARCH64 macros are used in the manifests to express
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# architecture-specific subdirectories in the installation paths
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# for isaexec'd commands.
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# We can't simply use $(MACH32) and $(MACH64) here, because they're
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# only defined for the build architecture. To do cross-platform
03e380b03da26ad4a2309190f35ba86843d3d824vboxsync# packaging, we need both values.
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncOPENSSL10.cmd = $(OPENSSL) version | $(NAWK) '{if($$2<1){print "\043";}}'
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# macros and transforms needed by pkgmogrify
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# If you append to this list using target-specific assignments (:=),
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# be very careful that the targets are of the form $(PDIR)/pkgname. If
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# you use a higher level target, or a package list, you'll trigger a
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# complete reprocessing of all manifests because they'll fail command
4726db8b47db329039ce8f8e13ecd2c1f696fa60vboxsync# dependency checking.
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsyncPM_TRANSFORMS= common_actions publish restart_fmri facets defaults \
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync 'PLATFORM=i86hvm' \
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync 'PLATFORM=i86pc' \
1c2c968fd241148110002d75b2c0fdeddc211e14vboxsync 'PLATFORM=i86xpv' \
1c2c968fd241148110002d75b2c0fdeddc211e14vboxsync 'ISALIST=amd64' \
bffb24521128f5183aafbef6542e7dacf20b5132vboxsync 'ISALIST=i386'
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync 'PLATFORM=sun4u' \
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync 'PLATFORM=sun4v' \
7e958a4329e4f9d83f597e26c72121969091e87bvboxsync 'ISALIST=sparcv9' \
f3f687b00a9f7c98dc0b81899090bc5f659ae7bdvboxsync 'ISALIST=sparc'
80b853528b74d686eebf9331ee762891d0038f06vboxsync# The package lists are generated with $(PKGDEP_TYPE) as their
80b853528b74d686eebf9331ee762891d0038f06vboxsync# dependency types, so that they can be included by either an
80b853528b74d686eebf9331ee762891d0038f06vboxsync# incorporation or a group package.
20b950300ed7ebcdf78f414c3d98b20d010ff74fvboxsync$(PDIR)/osnet-incorporation.mog:= PKGDEP_TYPE= incorporate
a0a9f39e8864357c2e1e61106958411240f5bf6bvboxsync depend fmri=consolidation/osnet/osnet-incorporation type=require
2b66a097b19f31e00af3abc508a3ff8c74ca1f8avboxsync# All packaging build products should go into $(PDIR), so they don't
2b66a097b19f31e00af3abc508a3ff8c74ca1f8avboxsync# need to be included separately in CLOBBERFILES.
a0a9f39e8864357c2e1e61106958411240f5bf6bvboxsync# By default, PKGS will list all manifests. To build and/or publish a
a0a9f39e8864357c2e1e61106958411240f5bf6bvboxsync# subset of packages, override this on the command line or in the
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync# build environment and then reference (implicitly or explicitly) the all
8eb4989e815c8f374b965265ccf184d6ce17d9e8vboxsync# or install targets.
9d473abea9a9b6597b2b20bedc950ba33a2e73a5vboxsync# Track the synthetic manifests separately so we can properly express
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# build rules and dependencies. The synthetic and real packages use
bffb24521128f5183aafbef6542e7dacf20b5132vboxsync# different sets of transforms and macros for pkgmogrify.
2b66a097b19f31e00af3abc508a3ff8c74ca1f8avboxsync# Root of pkg image to use for dependency resolution
2b66a097b19f31e00af3abc508a3ff8c74ca1f8avboxsync# Normally / on the machine used to build the binaries
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync# For each package, we determine the target repository based on
7529922bd11d7d1c38fbdc7bad6aec83eb2ec0advboxsync# manifest-embedded metadata. Because we make that determination on
5b802b5e11fed6e163afca32e9118d2599d312fbvboxsync# the fly, the publication target cannot be expressed as a
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# subdirectory inside the unknown-by-the-makefile target repository.
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# In order to limit the target set to real files in known locations,
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# we use a ".pub" file in $(PDIR) for each processed manifest, regardless
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# of content or target repository.
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsyncPUB_PKGS= $(SYNTH_PKGS:%=$(PDIR)/%.pub) $(PKGS:%=$(PDIR)/%.pub)
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync# Any given repository- and status-specific package list may be empty,
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync# but we can only determine that dynamically, so we always generate all
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync# lists for each repository we're building.
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync# The meanings of each package status are as follows:
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync# PKGSTAT meaning
bbfc28b1a00ce00001b2ead074d47254bec3e5cfvboxsync# ---------- ----------------------------------------------------
da6747c2419b9cea8b5e2c576a30a5de999a8ab3vboxsync# noincorp Do not include in incorporation or group package
da6747c2419b9cea8b5e2c576a30a5de999a8ab3vboxsync# obsolete Include in incorporation, but not group package
ad34209dccf31d54e2277d732a90ce6ea4374362vboxsync# renamed Include in incorporation, but not group package
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# current Include in incorporation and group package
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# Since the semantics of the "noincorp" package status dictate that
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# such packages are not included in the incorporation or group packages,
6be66de4257f4f564e35f7b8ee57a282e3cf3e96vboxsync# there is no need to build noincorp package lists.
# 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):
# 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 \