Makefile revision 14c3be3932e278c263b32fb17daff38fd4de18f8
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# CDDL HEADER START
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# The contents of this file are subject to the terms of the
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# Common Development and Distribution License (the "License").
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# You may not use this file except in compliance with the License.
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# See the License for the specific language governing permissions
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# and limitations under the License.
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# When distributing Covered Code, include this CDDL HEADER in each
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# If applicable, add the following below this CDDL HEADER, with the
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# fields enclosed by brackets "[]" replaced with your own identifying
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# information: Portions Copyright [yyyy] [name of copyright owner]
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# CDDL HEADER END
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# Make sure we're getting a consistent execution environment for the
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# embedded scripts.
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# To suppress package dependency generation on any system, regardless
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# of how it was installed, set SUPPRESSPKGDEP=true in the build
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# environment.
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# Comment this line out or set "PKGDEBUG=" in your build environment
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# to get more verbose output from the make processes in usr/src/pkg
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# Cross platform packaging notes
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# By default, we package the proto area from the same architecture as
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# the packaging build. In other words, if you're running nightly or
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# bldenv on an x86 platform, it will take objects from the x86 proto
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# area and use them to create x86 repositories.
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# If you want to create repositories for an architecture that's
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# different from $(uname -p), you do so by setting PKGMACH in your
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# build environment.
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# For this to work correctly, the following must all happen:
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# 1. You need the desired proto area, which you can get either by
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# doing a gatekeeper-style build with the -U option to
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# nightly(1), or by using rsync. If you don't do this, you will
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# get packaging failures building all packages, because pkgsend
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# is unable to find the required binaries.
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# 2. You need the desired tools proto area, which you can get in the
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# same ways as the normal proto area. If you don't do this, you
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# will get packaging failures building onbld, because pkgsend is
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# unable to find the tools binaries.
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# 3. The remainder of this Makefile should never refer directly to
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# $(MACH). Instead, $(PKGMACH) should be used whenever an
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# architecture-specific path or token is needed. If this is done
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# incorrectly, then packaging will fail, and you will see the
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# value of $(uname -p) instead of the value of $(PKGMACH) in the
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# commands that fail.
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# 4. Each time a rule in this Makefile invokes $(MAKE), it should
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# pass PKGMACH=$(PKGMACH) explicitly on the command line. If
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# this is done incorrectly, then packaging will fail, and you
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# will see the value of $(uname -p) instead of the value of
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# $(PKGMACH) in the commands that fail.
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# Refer also to the convenience targets defined later in this
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# ROOT, TOOLS_PROTO, and PKGARCHIVE should be set by nightly or
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# bldenv. These macros translate them into terms of $PKGMACH, instead
b40d4afa431b31f3ac966f1b539e589c79a06512fuankgPKGROOT.cmd= print $(ROOT) | sed -e s:/root_$(MACH):/root_$(PKGMACH):
b40d4afa431b31f3ac966f1b539e589c79a06512fuankgTOOLSROOT.cmd= print $(TOOLS_PROTO) | sed -e s:/root_$(MACH):/root_$(PKGMACH):
b40d4afa431b31f3ac966f1b539e589c79a06512fuankgPKGDEST.cmd= print $(PKGARCHIVE) | sed -e s:/$(MACH)/:/$(PKGMACH)/:
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# Always build the redistributable repository, but only build the
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# nonredistributable bits if we have access to closed source.
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# Some objects that result from the closed build are still
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# redistributable, and should be packaged as part of an open-only
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# build. Access to those objects is provided via the closed-bins
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# tarball. See usr/src/tools/scripts/bindrop.sh for details.
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# The packages directory will contain the processed manifests as
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# direct build targets and subdirectories for package metadata extracted
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# incidentally during manifest processing.
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# Nothing underneath $(PDIR) should ever be managed by SCM.
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# The tools proto must be specified for dependency generation.
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# Publication from the tools proto area is managed in the
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# publication rule.
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg$(PDIR)/developer-build-onbld.dep:= PKGROOT= $(TOOLSROOT)
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# To get these defaults, manifests should simply refer to $(PKGVERS).
b40d4afa431b31f3ac966f1b539e589c79a06512fuankgPKGVERS= $(PKGVERS_COMPONENT),$(PKGVERS_BUILTON)-$(PKGVERS_BRANCH)
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# The ARCH32 and ARCH64 macros are used in the manifests to express
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# architecture-specific subdirectories in the installation paths
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# for isaexec'd commands.
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# We can't simply use $(MACH32) and $(MACH64) here, because they're
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# only defined for the build architecture. To do cross-platform
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# packaging, we need both values.
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# macros and transforms needed by pkgmogrify
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# If you append to this list using target-specific assignments (:=),
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# be very careful that the targets are of the form $(PDIR)/pkgname. If
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# you use a higher level target, or a package list, you'll trigger a
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# complete reprocessing of all manifests because they'll fail command
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# dependency checking.
b40d4afa431b31f3ac966f1b539e589c79a06512fuankgPM_TRANSFORMS= common_actions publish restart_fmri facets defaults \
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg 'PLATFORM=i86hvm' \
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg 'PLATFORM=i86pc' \
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg 'PLATFORM=i86xpv' \
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg 'ISALIST=amd64' \
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg 'ISALIST=i386'
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg 'PLATFORM=sun4u' \
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg 'PLATFORM=sun4v' \
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg 'ISALIST=sparcv9' \
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg 'ISALIST=sparc'
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# The package lists are generated with $(PKGDEP_TYPE) as their
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# dependency types, so that they can be included by either an
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# incorporation or a group package.
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg$(PDIR)/osnet-incorporation.mog:= PKGDEP_TYPE= incorporate
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg depend fmri=consolidation/osnet/osnet-incorporation type=require
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# All packaging build products should go into $(PDIR), so they don't
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# need to be included separately in CLOBBERFILES.
b40d4afa431b31f3ac966f1b539e589c79a06512fuankgCLOBBERFILES= $(PDIR) proto_list_$(PKGMACH) install-$(PKGMACH).out \
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# By default, PKGS will list all manifests. To build and/or publish a
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# subset of packages, override this on the command line or in the
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# build environment and then reference (implicitly or explicitly) the all
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# or install targets. Using ls -1 (that's a one) or print or echo to
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# get the list of manifests is a little hackish, but avoids having a
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# 900+ line file to explicitly list them all.
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# We want some manifests to optionally built based on environment
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# options, so those are excluded and optionally added back in.
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# We also want a relatively easy way to add files to the list of
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# manifests given special treatment. Add any other special ones
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# to the SPECIAL_MANIFESTS vaiable. It can contain wildcards in
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# regexp form, i.e. SUNW.* as one useful example.
b40d4afa431b31f3ac966f1b539e589c79a06512fuankgLIST_MANIFESTS_CMD = (cd manifests ; /usr/bin/ls -1 *.mf |\
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# Conditionally add back lp-ipp
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg$(ENABLE_IPP_PRINTING) MANIFESTS += print-lp-ipp-ipp-listener.mf
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# Track the synthetic manifests separately so we can properly express
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# build rules and dependencies. The synthetic and real packages use
b40d4afa431b31f3ac966f1b539e589c79a06512fuankg# different sets of transforms and macros for pkgmogrify.
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)
$(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: