Makefile revision ae39239e04452933e89d03a1fb502e3e2836a332
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# CDDL HEADER START
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# The contents of this file are subject to the terms of the
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# Common Development and Distribution License (the "License").
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# You may not use this file except in compliance with the License.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# or http://www.opensolaris.org/os/licensing.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# See the License for the specific language governing permissions
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# and limitations under the License.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# When distributing Covered Code, include this CDDL HEADER in each
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# If applicable, add the following below this CDDL HEADER, with the
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# fields enclosed by brackets "[]" replaced with your own identifying
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# information: Portions Copyright [yyyy] [name of copyright owner]
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# CDDL HEADER END
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
6f269e977ae7318d374676a38d516ed59c43135eMark J. Nelson# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazainclude $(SRC)/Makefile.master
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazainclude $(SRC)/Makefile.buildnum
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# Make sure we're getting a consistent execution environment for the
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# embedded scripts.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaSHELL= /usr/bin/ksh93
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# To suppress package dependency generation on any system, regardless
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# of how it was installed, set SUPPRESSPKGDEP=true in the build
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# environment.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ae39239e04452933e89d03a1fb502e3e2836a332Mark J. NelsonSUPPRESSPKGDEP= false
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# Comment this line out or set "PKGDEBUG=" in your build environment
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# to get more verbose output from the make processes in usr/src/pkg
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaPKGDEBUG= @
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# Cross platform packaging notes
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# By default, we package the proto area from the same architecture as
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# the packaging build. In other words, if you're running nightly or
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# bldenv on an x86 platform, it will take objects from the x86 proto
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# area and use them to create x86 repositories.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# If you want to create repositories for an architecture that's
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# different from $(uname -p), you do so by setting PKGMACH in your
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# build environment.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# For this to work correctly, the following must all happen:
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# 1. You need the desired proto area, which you can get either by
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# doing a gatekeeper-style build with the -U option to
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# nightly(1), or by using rsync. If you don't do this, you will
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# get packaging failures building all packages, because pkgsend
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# is unable to find the required binaries.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# 2. You need the desired tools proto area, which you can get in the
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# same ways as the normal proto area. If you don't do this, you
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# will get packaging failures building SUNWonbld, because pkgsend is
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# unable to find the tools binaries.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# 3. You need to have built the appropriate third party license
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# files in $SRC, which generally means you should override SRC in
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# your build environment. If you don't do this, you will get
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# packaging failures because pkgsend is unable to find various
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# THIRDPARTYLICENSE files.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# 4. The remainder of this Makefile should never refer directly to
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# $(MACH). Instead, $(PKGMACH) should be used whenever an
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# architecture-specific path or token is needed. If this is done
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# incorrectly, then packaging will fail, and you will see the
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# value of $(uname -p) instead of the value of $(PKGMACH) in the
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# commands that fail.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# 5. Each time a rule in this Makefile invokes $(MAKE), it should
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# pass PKGMACH=$(PKGMACH) explicitly on the command line. If
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# this is done incorrectly, then packaging will fail, and you
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# will see the value of $(uname -p) instead of the value of
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# $(PKGMACH) in the commands that fail.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# Refer also to the convenience targets defined later in this
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# Makefile.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaPKGMACH= $(MACH)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# ROOT, TOOLS_PROTO, and PKGARCHIVE should be set by nightly or
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# bldenv. These macros translate them into terms of $PKGMACH, instead
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# of $ARCH.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaPKGROOT.cmd= print $(ROOT) | sed -e s:/root_$(MACH):/root_$(PKGMACH):
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaPKGROOT= $(PKGROOT.cmd:sh)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaTOOLSROOT.cmd= print $(TOOLS_PROTO) | sed -e s:/root_$(MACH):/root_$(PKGMACH):
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaTOOLSROOT= $(TOOLSROOT.cmd:sh)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaPKGDEST.cmd= print $(PKGARCHIVE) | sed -e s:/$(MACH)/:/$(PKGMACH)/:
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaPKGDEST= $(PKGDEST.cmd:sh)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# The publish transforms, EXCEPTIONS list, and some manifests need to
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# know when we're building open-only and when we're using internal
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# crypto bits.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# We only use internal crypto when we're doing a closed build, the
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# CODESIGN_USER env variable is not set, and ON_CRYPTO_BINS is not set.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# This matches the conditions under which the internal key and cert
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# are needed for the packaged objects.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# We use X_FLAG, as exported by nightly and bldenv, to decide when we
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# need IHV-related exceptions for protocmp.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza$(CLOSED_BUILD)OPEN_ONLY_BUILD= $(POUND_SIGN)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaUSE_INTERNAL_CRYPTO= $(POUND_SIGN)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaUI1= $(CODESIGN_USER:%=$(POUND_SIGN))
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza$(UI1)UI2= $(ON_CRYPTO_BINS:%=$(POUND_SIGN))
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza$(CLOSED_BUILD)USE_INTERNAL_CRYPTO= $(UI1)$(UI2)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaUSE_SIGNED_CRYPTO=
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza$(USE_INTERNAL_CRYPTO)USE_SIGNED_CRYPTO= $(POUND_SIGN)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaX_FLAG= n
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaIHV_COPY_BUILD1= $(X_FLAG:n%=$(POUND_SIGN)%)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaIHV_COPY_BUILD= $(IHV_COPY_BUILD1:y%=%)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaEXCEPTIONS= packaging
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza$(CLOSED_BUILD)EXCEPTIONS += packaging.closed
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza$(OPEN_ONLY_BUILD)EXCEPTIONS += packaging.open
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza$(IHV_COPY_BUILD)EXCEPTIONS += packaging.ihv
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaPKGMOGRIFY= pkgmogrify
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# Always build the redistributable repository, but only build the
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# nonredistributable bits if we have access to closed source.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# Some objects that result from the closed build are still
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# redistributable, and should be packaged as part of an open-only
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# build. Access to those objects is provided via the closed-bins
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# tarball. See usr/src/tools/scripts/bindrop.sh for details.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaREPOS= redist
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza$(CLOSED_BUILD)REPOS += extra
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# The packages directory will contain the processed manifests as
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# direct build targets and subdirectories for package metadata extracted
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# incidentally during manifest processing.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# Nothing underneath $(PDIR) should ever be managed by SCM.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaPDIR= packages.$(PKGMACH)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# The tools proto must be specified for dependency generation.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# Publication from the tools proto area is managed in the
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# publication rule.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza$(PDIR)/SUNWonbld.dep:= PKGROOT= $(TOOLSROOT)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaPKGPUBLISHER= $(PKGPUBLISHER_REDIST)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza$(PKGDEST)/repo.extra:= PKGPUBLISHER= $(PKGPUBLISHER_NONREDIST)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# To get these defaults, manifests should simply refer to $(PKGVERS).
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaPKGVERS_COMPONENT= 0.$(RELEASE)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaPKGVERS_BUILTON= $(RELEASE)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaPKGVERS_BRANCH= 0.$(ONNV_BUILDNUM)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaPKGVERS= $(PKGVERS_COMPONENT),$(PKGVERS_BUILTON)-$(PKGVERS_BRANCH)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# The ARCH32 and ARCH64 macros are used in the manifests to express
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# architecture-specific subdirectories in the installation paths
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# for isaexec'd commands.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# We can't simply use $(MACH32) and $(MACH64) here, because they're
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# only defined for the build architecture. To do cross-platform
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# packaging, we need both values.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazai386_ARCH32= i86
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazasparc_ARCH32= sparcv7
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazai386_ARCH64= amd64
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazasparc_ARCH64= sparcv9
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# macros and transforms needed by pkgmogrify
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# If you append to this list using target-specific assignments (:=),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# be very careful that the targets are of the form $(PDIR)/pkgname. If
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# you use a higher level target, or a package list, you'll trigger a
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# complete reprocessing of all manifests because they'll fail command
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# dependency checking.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaPM_TRANSFORMS= publish restart_fmri defaults extract_metadata
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaPM_INC= transforms
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaPKGMOG_DEFINES= \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza i386_ONLY=$(POUND_SIGN) \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza sparc_ONLY=$(POUND_SIGN) \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(PKGMACH)_ONLY= \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza ARCH=$(PKGMACH) \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza ARCH32=$($(PKGMACH)_ARCH32) \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza ARCH64=$($(PKGMACH)_ARCH64) \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza PKGVERS_COMPONENT=$(PKGVERS_COMPONENT) \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza PKGVERS_BUILTON=$(PKGVERS_BUILTON) \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza PKGVERS_BRANCH=$(PKGVERS_BRANCH) \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza PKGVERS=$(PKGVERS) \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza SRC=$(SRC) \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza CLOSED_BUILD=$(CLOSED_BUILD) \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza OPEN_BUILD=$(OPEN_ONLY_BUILD) \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza USE_INTERNAL_CRYPTO=$(USE_INTERNAL_CRYPTO) \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza USE_SIGNED_CRYPTO=$(USE_SIGNED_CRYPTO)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaPKGDEP_TOKENS_i386= \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza 'PLATFORM=i86hvm' \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza 'PLATFORM=i86pc' \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza 'PLATFORM=i86xpv' \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza 'ISALIST=amd64' \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza 'ISALIST=i386'
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaPKGDEP_TOKENS_sparc= \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza 'PLATFORM=sun4u' \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza 'PLATFORM=sun4v' \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza 'ISALIST=sparcv9' \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza 'ISALIST=sparc'
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaPKGDEP_TOKENS= $(PKGDEP_TOKENS_$(PKGMACH))
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# The package lists are generated with $(PKGDEP_TYPE) as their
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# dependency types, so that they can be included by either an
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# incorporation or a group package.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza$(PDIR)/osnet-redist.mog $(PDIR)/osnet-extra.mog:= PKGDEP_TYPE= require
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza$(PDIR)/osnet-incorporation.mog:= PKGDEP_TYPE= incorporate
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaPKGDEP_INCORP= \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza depend fmri=consolidation/osnet/osnet-incorporation type=require
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# All packaging build products should go into $(PDIR), so they don't
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# need to be included separately in CLOBBERFILES.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaCLOBBERFILES= $(PDIR) proto_list_$(PKGMACH)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# By default, PKGS will list all manifests. To build and/or publish a
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# subset of packages, override this on the command line or in the
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# build environment and then reference (implicitly or explicitly) the all
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# or install targets.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaMANIFESTS :sh= (cd manifests; print *.mf)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaPKGS= $(MANIFESTS:%.mf=%)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaDEP_PKGS= $(PKGS:%=$(PDIR)/%.dep)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaPROC_PKGS= $(PKGS:%=$(PDIR)/%.mog)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# Track the synthetic manifests separately so we can properly express
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# build rules and dependencies. The synthetic and real packages use
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# different sets of transforms and macros for pkgmogrify.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaSYNTH_PKGS= osnet-incorporation osnet-redist
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza$(CLOSED_BUILD)SYNTH_PKGS += osnet-extra
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaDEP_SYNTH_PKGS= $(SYNTH_PKGS:%=$(PDIR)/%.dep)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaPROC_SYNTH_PKGS= $(SYNTH_PKGS:%=$(PDIR)/%.mog)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# For each package, we determine the target repository based on
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# manifest-embedded metadata. Because we make that determination on
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# the fly, the publication target cannot be expressed as a
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# subdirectory inside the unknown-by-the-makefile target repository.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# In order to limit the target set to real files in known locations,
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# we use a ".pub" file in $(PDIR) for each processed manifest, regardless
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# of content or target repository.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaPUB_PKGS= $(SYNTH_PKGS:%=$(PDIR)/%.pub) $(PKGS:%=$(PDIR)/%.pub)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# Any given repository- and status-specific package list may be empty,
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# but we can only determine that dynamically, so we always generate all
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# lists for each repository we're building.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# The meanings of each package status are as follows:
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# PKGSTAT meaning
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# ---------- ----------------------------------------------------
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# noincorp Do not include in incorporation or group package
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# obsolete Include in incorporation, but not group package
0ea64585698b885134cf212069f5ff7ebda376a6Liane Praza# renamed Include in incorporation, but not group package
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# current Include in incorporation and group package
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# Since the semantics of the "noincorp" package status dictate that
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# such packages are not included in the incorporation or group packages,
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# there is no need to build noincorp package lists.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# Since packages depend on their incorporation, noincorp necessarily
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# implies nodepend, or it would inadvertently pull in other packages.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaPKGLISTS= \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(REPOS:%=$(PDIR)/packages.%.current) \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(REPOS:%=$(PDIR)/packages.%.renamed) \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(REPOS:%=$(PDIR)/packages.%.obsolete)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza.KEEP_STATE:
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza.PARALLEL: $(PKGS) $(PROC_PKGS) $(DEP_PKGS) \
ae39239e04452933e89d03a1fb502e3e2836a332Mark J. Nelson $(PROC_SYNTH_PKGS) $(DEP_SYNTH_PKGS) $(PUB_PKGS)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# For a single manifest, the dependency chain looks like this:
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# raw manifest (mypkg.mf)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# |
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# | use pkgmogrify to process raw manifest
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# |
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# processed manifest (mypkg.mog)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# |
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# * | use pkgdepend generate to generate dependencies
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# |
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# manifest with TBD dependencies (mypkg.dep)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# |
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# % | use pkgdepend resolve to resolve dependencies
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# |
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# manifest with dependencies resolved (mypkg.res)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# |
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# | use pkgsend to publish the package
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# |
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# placeholder to indicate successful publication (mypkg.pub)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# * This may be suppressed via SUPPRESSPKGDEP. The resulting
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# packages will install correctly, but care must be taken to
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# install all dependencies, because pkg will not have the input
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# it needs to determine this automatically.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# % This is included in this diagram to make the picture complete, but
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# this is a point of synchronization in the build process.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# Dependency resolution is actually done once on the entire set of
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# manifests, not on a per-package basis.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# The full dependency chain for generating everything that needs to be
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# published, without actually publishing it, looks like this:
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# processed synthetic packages
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# | |
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# package lists synthetic package manifests
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# |
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# processed real packages
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# | |
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# package dir real package manifests
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# Here, each item is a set of real or synthetic packages. For this
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# portion of the build, no reference is made to the proto area. It is
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# therefore suitable for the "all" target, as opposed to "install."
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# Since each of these steps is expressed explicitly, "all" need only
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# depend on the head of the chain.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# From the end of manifest processing, the publication dependency
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# chain looks like this:
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# repository metadata (catalogs and search indices)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# |
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# | pkg.depotd
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# |
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# published packages
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# | |
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# | | pkgsend publish
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# | |
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# repositories resolved dependencies
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# | |
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# pkgsend | | pkgdepend resolve
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# create-repository |
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# | generated dependencies
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# repo directories |
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# | pkgdepend
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# |
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# processed manifests
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# Due to limitations in pkgdepend, we cannot simply treat synthetic
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# and real manifests identically. But we don't really want to
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# maintain a separate chain for synthetic manifests, so for the left
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# side of this diagram, we actually do faux dependency generation and
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# resolution, so we end up with the expected set of files in $(PDIR),
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# per the individual file chain described above: mf, mog, dep, res,
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# and pub files for each manifest.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazaall: $(PROC_SYNTH_PKGS) proto_list_$(PKGMACH)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# This will build the directory to contain the processed manifests
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# and the metadata symlinks.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza$(PDIR):
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza @print "Creating $(@)"
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(PKGDEBUG)$(INS.dir)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# This rule resolves dependencies across all published manifests.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# We should be able to do this with
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# pkgdepend resolve -m $(PUB_PKGS:%.pub=%.dep)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# but until 14113 is fixed, the incorporations confuse pkgdepend, so we
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# just create the .res file for DEP_SYNTH_PKGS directly.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# We also shouldn't have to ignore the error from pkgdepend, but
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# until at least 14110 is resolved, pkgdepend will always exit with
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# an error.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza$(PDIR)/gendeps: $(DEP_SYNTH_PKGS) $(DEP_PKGS)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza -$(PKGDEBUG)if [ "$(SUPPRESSPKGDEP)" = "true" ]; then \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza print "Suppressing dependency resolution"; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza for p in $(DEP_PKGS:%.dep=%); do \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(CP) $$p.dep $$p.res; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza done; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza else \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza print "Resolving dependencies"; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza pkgdepend resolve -m $(DEP_PKGS); \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza for p in $(DEP_PKGS:%.dep=%); do \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(MV) $$p.dep.res $$p.res; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza done; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza fi
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(PKGDEBUG)for p in $(DEP_SYNTH_PKGS:%.dep=%); \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza do \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(CP) $$p.dep $$p.res; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza done
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(PKGDEBUG)$(TOUCH) $(@)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazainstall: repository-metadata
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazarepository-metadata: publish_pkgs
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza @print "Creating repository metadata"
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(PKGDEBUG)for r in $(REPOS); do \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza /usr/lib/pkg.depotd -d $(PKGDEST)/repo.$$r \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza --add-content --exit-ready; \
6f269e977ae7318d374676a38d516ed59c43135eMark J. Nelson chmod a+r $(PKGDEST)/repo.$$r/cfg_cache; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza done
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# Since we create zero-length processed manifests for a graceful abort
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# from pkgmogrify, we need to detect that here and make no effort to
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# publish the package.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# For all other packages, we publish them regardless of status. We
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# derive the target repository as a component of the metadata-derived
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# symlink for each package.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazapublish_pkgs: $(REPOS:%=$(PKGDEST)/repo.%) $(PDIR)/gendeps .WAIT $(PUB_PKGS)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza$(PUB_PKGS): FRC
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# Initialize the empty on-disk repositories
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza$(REPOS:%=$(PKGDEST)/repo.%):
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza @print "Initializing $(@F)"
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(PKGDEBUG)$(INS.dir)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(PKGDEBUG)pkgsend -s file://$(@) create-repository \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza --set-property publisher.prefix=$(PKGPUBLISHER)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# rule to process real manifests
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# To allow redistributability and package status to change, we must
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# remove not only the actual build target (the processed manifest), but
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# also the incidental ones (the metadata-derived symlinks).
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# If pkgmogrify exits cleanly but fails to create the specified output
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# file, it means that it encountered an abort directive. That means
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# that this package should not be published for this particular build
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# environment. Since we can't prune such packages from $(PKGS)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# retroactively, we need to create an empty target file to keep make
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# from trying to rebuild it every time. For these empty targets, we
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# do not create metadata symlinks.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# Automatic dependency resolution to files is also done at this phase of
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# processing. The skipped packages are skipped due to existing bugs
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# in pkgdepend.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# The incorporation dependency is tricky: it needs to go into all
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# current and renamed manifests (ie all incorporated packages), but we
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# don't know which those are until after we run pkgmogrify. So
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# instead of expressing it as a transform, we tack it on ex post facto.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# Implementation notes:
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# - The first $(RM) must not match other manifests, or we'll run into
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# race conditions with parallel manifest processing.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# - The make macros [ie $(MACRO)] are evaluated when the makefile is
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# read in, and will result in a fixed, macro-expanded rule for each
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# target enumerated in $(PROC_PKGS).
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# - The shell variables (ie $$VAR) are assigned on the fly, as the rule
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# is executed. The results may only be referenced in the shell in
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# which they are assigned, so from the perspective of make, all code
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# that needs these variables needs to be part of the same line of
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# code. Hence the use of command separators and line continuation
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# characters.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# - The extract_metadata transforms are designed to spit out shell
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# variable assignments to stdout. So the eval statement should
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# begin with the default values, and any output from pkgmogrify
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# should be in the form of a variable assignment to override those
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# defaults.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# - When this rule completes execution, it must leave an updated
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# target file ($@) in place, or make will reprocess the package
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# every time it encounters it as a dependency. Hence the "touch"
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# statement to ensure that the target is created, even when
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# pkgmogrify encounters an abort in the publish transforms. This
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# will not cause publication failures when switching build
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# environments, because $(CLOSED_BUILD) and $(OPEN_ONLY) are
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# referenced in $(PKGMOG_DEFINES), and changes will therefore
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# trigger a rebuild for command dependency failure. (Command
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# dependency checking is turned on by .KEEP_STATE: above.)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza.SUFFIXES: .mf .mog .dep .res .pub
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza$(PDIR)/%.mog: manifests/%.mf
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza @print "Processing manifest $(<F)"
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(PKGDEBUG)$(RM) $(@) $(@:%.mog=%) $(@:%.mog=%.nodepend) \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(PDIR)/$(@F:%.mog=%).metadata.*
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(PKGDEBUG)eval REPO=redist PKGSTAT=current \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza NODEPEND=$(SUPPRESSPKGDEP) \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza `$(PKGMOGRIFY) $(PKGMOG_VERBOSE) $(PM_INC:%= -I %) \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(PKGMOG_DEFINES:%=-D %) -O $(@) $(<) $(PM_TRANSFORMS)`; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza if [ -f $(@) ]; then \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza if [ \( "$$NODEPEND" != "false" \) -o \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza \( "$$PKGSTAT" = "noincorp" \) ]; then \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(TOUCH) $(@:%.mog=%.nodepend); \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza fi; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(LN) -s $(@F) \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(PDIR)/$(@F:%.mog=%).metadata.$$PKGSTAT.$$REPO; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza if [ \( "$$PKGSTAT" = "current" \) -o \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza \( "$$PKGSTAT" = "renamed" \) ]; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza then print $(PKGDEP_INCORP) >> $(@); \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza fi; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza else \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(TOUCH) $(@); \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza fi
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza$(PDIR)/%.dep: $(PDIR)/%.mog
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza @print "Generating dependencies for $(<F)"
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(PKGDEBUG)$(RM) $(@)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(PKGDEBUG)if [ ! -f $(@:%.dep=%.nodepend) ]; then \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza pkgdepend generate -m $(PKGDEP_TOKENS:%=-D %) $(<) \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(PKGROOT) > $(@); \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza else \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(CP) $(<) $(@); \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza fi
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# The full chain implies that there should be a .dep.res suffix rule,
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# but dependency generation is done on a set of manifests, rather than
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# on a per-manifest basis. Instead, see the gendeps rule above.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza$(PDIR)/%.pub: $(PDIR)/%.res
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(PKGDEBUG)m=$$(basename $(@:%.pub=%).metadata.*); \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza r=$${m#$(@F:%.pub=%.metadata.)+(?).}; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza if [ -s $(<) ]; then \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza print "Publishing $(@F:%.pub=%) to $$r repository"; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza pkgsend -s file://$(PKGDEST)/repo.$$r publish \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza -d $(PKGROOT) -d $(TOOLSROOT) -d $(SRC)/pkg/license_files \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza -d $(SRC) --fmri-in-manifest --no-index --no-catalog $(<) \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza > /dev/null; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza fi; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(TOUCH) $(@);
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# rule to build the synthetic manifests
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# This rule necessarily has PKGDEP_TYPE that changes according to
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# the specific synthetic manifest. Rather than escape command
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# dependency checking for the real manifest processing, or failing to
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# express the (indirect) dependency of synthetic manifests on real
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# manifests, we simply split this rule out from the one above.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# The implementation notes from the previous rule are applicable
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# here, too.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza$(PROC_SYNTH_PKGS): $(PKGLISTS) $$(@F:%.mog=%.mf)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza @print "Processing synthetic manifest $(@F:%.mog=%.mf)"
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(PKGDEBUG)$(RM) $(@) $(PDIR)/$(@F:%.mog=%).metadata.*
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(PKGDEBUG)eval REPO=redist PKGSTAT=current \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza `$(PKGMOGRIFY) $(PKGMOG_VERBOSE) -I transforms -I $(PDIR) \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(PKGMOG_DEFINES:%=-D %) -D PKGDEP_TYPE=$(PKGDEP_TYPE) \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza -O $(@) $(@F:%.mog=%.mf) $(PM_TRANSFORMS) synthetic` ; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza if [ -f $(@) ]; then \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(LN) -s $(@F) \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(PDIR)/$(@F:%.mog=%).metadata.$$PKGSTAT.$$REPO; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza else \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(TOUCH) $(@); \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza fi
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza$(DEP_SYNTH_PKGS): $$(@:%.dep=%.mog)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza @print "Skipping dependency generation for $(@F:%.dep=%)"
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(PKGDEBUG)$(CP) $(@:%.dep=%.mog) $(@)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazaclean:
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazaclobber: clean
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(RM) -r $(CLOBBERFILES)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# This rule assumes that all links in the $PKGSTAT directories
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# point to valid manifests, and will fail the make run if one
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# does not contain an fmri.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# We do this in the BEGIN action instead of using pattern matching
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# because we expect the fmri to be at or near the first line of each input
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# file, and this way lets us avoid reading the rest of the file after we
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# find what we need.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# We keep track of a failure to locate an fmri, so we can fail the
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# make run, but we still attempt to process each package in the
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# repo/pkgstat-specific subdir, in hopes of maybe giving some
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# additional useful info.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# The protolist is used for bfu archive creation, which may be invoked
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# interactively by the user. Both protolist and PKGLISTS targets
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# depend on $(PROC_PKGS), but protolist builds them recursively.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# To avoid collisions, we insert protolist into the dependency chain
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# here. This has two somewhat subtle benefits: it allows bfu archive
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# creation to work correctly, even when -a was not part of NIGHTLY_OPTIONS,
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# and it ensures that a protolist file here will always correspond to the
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# contents of the processed manifests, which can vary depending on build
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# environment.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza$(PKGLISTS): $(PROC_PKGS)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(PKGDEBUG)sdotr=$(@F:packages.%=%); \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza r=$${sdotr%.+(?)}; s=$${sdotr#+(?).}; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza print "Generating $$r $$s package list"; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(RM) $(@); $(TOUCH) $(@); \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(NAWK) 'BEGIN { \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza if (ARGC < 2) { \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza exit; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza } \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza retcode = 0; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza for (i = 1; i < ARGC; i++) { \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza do { \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza e = getline f < ARGV[i]; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza } while ((e == 1) && (f !~ /name=pkg.fmri/)); \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza close(ARGV[i]); \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza if (e == 1) { \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza l = split(f, a, "="); \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza print "depend fmri=" a[l], \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza "type=$$(PKGDEP_TYPE)"; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza } else { \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza print "no fmri in " ARGV[i] >> "/dev/stderr"; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza retcode = 2; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza } \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza } \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza exit retcode; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza }' `find $(PDIR) -type l -a \( $(PKGS:%=-name %.metadata.$$s.$$r -o) \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza -name NOSUCHFILE \)` >> $(@)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# rules to validate proto area against manifests, check for safe
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# file permission modes, and generate a faux proto list
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# For the check targets, the dependencies on $(PROC_PKGS) is specified
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# as a subordinate make process in order to suppress output.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazamakesilent:
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza @$(MAKE) -e $(PROC_PKGS) PKGMACH=$(PKGMACH) \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza SUPPRESSPKGDEP=$(SUPPRESSPKGDEP) > /dev/null
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazaprotocmp: makesilent
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza @validate_pkg -a $(PKGMACH) -v \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(EXCEPTIONS:%=-e $(CODEMGR_WS)/exception_lists/%) \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza -m $(PDIR) -p $(PKGROOT) -p $(TOOLSROOT)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazapmodes: makesilent
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza @validate_pkg -a $(PKGMACH) -M -m $(PDIR) \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza -e $(CODEMGR_WS)/exception_lists/pmodes
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazacheck: protocmp pmodes
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazaprotolist: proto_list_$(PKGMACH)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazaproto_list_$(PKGMACH): $(PROC_PKGS)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza @validate_pkg -a $(PKGMACH) -L -m $(PDIR) > $(@)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza$(PROC_PKGS): $(PDIR)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# This is a convenience target to allow package names to function as
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# build targets. Generally, using it is only useful when iterating on
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# development of a manifest.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# When processing a manifest, use the basename (without extension) of
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# the package. When publishing, use the basename with a ".pub"
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# extension.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# Other than during manifest development, the preferred usage is to
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# avoid these targets and override PKGS on the make command line and
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# use the provided all and install targets.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza$(PKGS) $(SYNTH_PKGS): $(PDIR)/$$(@:%=%.mog)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza$(PKGS:%=%.pub) $(SYNTH_PKGS:%=%.pub): $(PDIR)/$$(@)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# This is a convenience target to resolve dependencies without publishing
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# packages.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazagendeps: $(PDIR)/gendeps
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# These are convenience targets for cross-platform packaging. If you
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# want to build any of "the normal" targets for a different
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# architecture, simply use "arch/target" as your build target.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# Since the most common use case for this is "install," the architecture
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# specific install targets have been further abbreviated to elide "/install."
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazai386/% sparc/%:
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(MAKE) -e $(@F) PKGMACH=$(@D) SUPPRESSPKGDEP=$(SUPPRESSPKGDEP)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazai386 sparc: $$(@)/install
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaFRC:
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# EXPORT DELETE START
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaXMOD_PKGS= \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza BRCMbnx \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza BRCMbnxe \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza SUNWadpu320 \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza SUNWcryptoint \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza SUNWibsdpib \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza SUNWkdc \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza SUNWlsimega \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza SUNWspwr \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza SUNWsvvs \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza SUNWwbint \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza SUNWwbsup
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaEXPORT_SRC: CRYPT_SRC
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(RM) $(XMOD_PKGS:%=manifests/%.mf)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(RM) Makefile+
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(SED) -e "/^# EXPORT DELETE START/,/^# EXPORT DELETE END/d" \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza < Makefile > Makefile+
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(MV) -f Makefile+ Makefile
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(CHMOD) 444 Makefile
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaCRYPT_SRC:
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(RM) manifests/SUNWcryptoint.mf+
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(SED) -e "/^# CRYPT DELETE START/,/^# CRYPT DELETE END/d" \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza < manifests/SUNWcryptoint.mf > manifests/SUNWcryptoint.mf+
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(MV) manifests/SUNWcryptoint.mf+ manifests/SUNWcryptoint.mf
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(CHMOD) 444 manifests/SUNWcryptoint.mf
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# EXPORT DELETE END