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.
1f2ca518aeecee8616fccc0c46a339773faea7d5Dan McDonald# Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
7b07063d906859b2be1e88791f801b3c96e432f6Igor Kozhukhov# Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
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
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson# will get packaging failures building onbld, because pkgsend is
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# unable to find the tools binaries.
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson# 3. 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.
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson# 4. 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 PrazaEXCEPTIONS= packaging
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
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#
d34af1a4fea9785e1d7f8aff94fe157b2af0d2f5Mark J. Nelson$(PDIR)/developer-build-onbld.dep:= PKGROOT= $(TOOLSROOT)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaPKGPUBLISHER= $(PKGPUBLISHER_REDIST)
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#
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LowePM_TRANSFORMS= common_actions publish restart_fmri facets defaults \
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe extract_metadata
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LowePM_INC= transforms manifests
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) \
33392354a001a7e6e504717bd3f249456d36cc00Alexander Pyhalov PKGVERS=$(PKGVERS) \
1f2ca518aeecee8616fccc0c46a339773faea7d5Dan McDonald PERL_ARCH=$(PERL_ARCH) \
33392354a001a7e6e504717bd3f249456d36cc00Alexander Pyhalov PERL_VERSION=$(PERL_VERSION) \
9f9230833b50b8271840dc2c12bd1e94d9df7d12Alexander Pyhalov PERL_PKGVERS=$(PERL_PKGVERS) \
9f9230833b50b8271840dc2c12bd1e94d9df7d12Alexander Pyhalov PYTHON_VERSION=$(PYTHON_VERSION) \
9f9230833b50b8271840dc2c12bd1e94d9df7d12Alexander Pyhalov PYTHON_PKGVERS=$(PYTHON_PKGVERS)
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#
77c29b8ee88bf82021ff549b17b44e17f2ef7d7bRichard Lowe$(PDIR)/osnet-redist.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#
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon RossCLOBBERFILES= $(PDIR) proto_list_$(PKGMACH) install-$(PKGMACH).out \
b6805bf78d2bbbeeaea8909a05623587b42d58b3Gordon Ross license-list
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
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon Ross# or install targets. Using ls -1 (that's a one) or print or echo to
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon Ross# get the list of manifests is a little hackish, but avoids having a
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon Ross# 900+ line file to explicitly list them all.
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon Ross#
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon Ross# We want some manifests to optionally built based on environment
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon Ross# options, so those are excluded and optionally added back in.
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon Ross# We also want a relatively easy way to add files to the list of
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon Ross# manifests given special treatment. Add any other special ones
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon Ross# to the SPECIAL_MANIFESTS vaiable. It can contain wildcards in
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon Ross# regexp form, i.e. SUNW.* as one useful example.
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon Ross#
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon RossSPECIAL_MANIFESTS = print-lp-ipp-ipp-listener.mf
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon RossLIST_MANIFESTS_CMD = (cd manifests ; /usr/bin/ls -1 *.mf |\
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon Ross $(SED) $(SPECIAL_MANIFESTS:%=-e '/^%$$/d') )
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon RossMANIFESTS = $(LIST_MANIFESTS_CMD:sh)
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon Ross
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon Ross# Conditionally add back lp-ipp
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon Ross$(ENABLE_IPP_PRINTING) MANIFESTS += print-lp-ipp-ipp-listener.mf
14c3be3932e278c263b32fb17daff38fd4de18f8Gordon Ross
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 PrazaDEP_SYNTH_PKGS= $(SYNTH_PKGS:%=$(PDIR)/%.dep)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaPROC_SYNTH_PKGS= $(SYNTH_PKGS:%=$(PDIR)/%.mog)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ac823a0f31ed9c8cbe505cee2def262ac92ea6cdJon Tibble#
ac823a0f31ed9c8cbe505cee2def262ac92ea6cdJon Tibble# Root of pkg image to use for dependency resolution
ac823a0f31ed9c8cbe505cee2def262ac92ea6cdJon Tibble# Normally / on the machine used to build the binaries
ac823a0f31ed9c8cbe505cee2def262ac92ea6cdJon Tibble#
ac823a0f31ed9c8cbe505cee2def262ac92ea6cdJon TibblePKGDEP_RESOLVE_IMAGE = /
ac823a0f31ed9c8cbe505cee2def262ac92ea6cdJon Tibble
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 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# |
07b48dbef2d1395c82edeccaf10e42ea7c0b6b36Yuri Pankov# | pkgrepo refresh
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#
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson
e3c7c8f87921d6207a2ea7e79b31f9762e18116fMark J. NelsonALL_TARGETS= $(PROC_SYNTH_PKGS) proto_list_$(PKGMACH)
e3c7c8f87921d6207a2ea7e79b31f9762e18116fMark J. Nelson
e3c7c8f87921d6207a2ea7e79b31f9762e18116fMark J. Nelsonall: $(ALL_TARGETS)
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#
3d312ee2210d825807c3486aa998ebd8bc2f3a43Mark J. Nelson# We shouldn't have to ignore the error from pkgdepend, but until
3d312ee2210d825807c3486aa998ebd8bc2f3a43Mark J. Nelson# 16012 and its dependencies are resolved, pkgdepend will always exit
3d312ee2210d825807c3486aa998ebd8bc2f3a43Mark J. Nelson# with 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"; \
ac823a0f31ed9c8cbe505cee2def262ac92ea6cdJon Tibble pkgdepend -R $(PKGDEP_RESOLVE_IMAGE) resolve \
ac823a0f31ed9c8cbe505cee2def262ac92ea6cdJon Tibble -m $(DEP_SYNTH_PKGS) $(DEP_PKGS); \
a01be845e9dee367d46c5b5e02e8f1e9d7c98be3Mark J. Nelson for p in $(DEP_SYNTH_PKGS:%.dep=%) $(DEP_PKGS:%.dep=%); do \
d34af1a4fea9785e1d7f8aff94fe157b2af0d2f5Mark J. Nelson if [ "$$(print $$p.metadata.*)" = \
d34af1a4fea9785e1d7f8aff94fe157b2af0d2f5Mark J. Nelson "$$(print $$p.metadata.noincorp.*)" ]; \
d34af1a4fea9785e1d7f8aff94fe157b2af0d2f5Mark J. Nelson then \
d34af1a4fea9785e1d7f8aff94fe157b2af0d2f5Mark J. Nelson print "Removing dependency versions from $$p"; \
d34af1a4fea9785e1d7f8aff94fe157b2af0d2f5Mark J. Nelson $(PKGMOGRIFY) $(PKGMOG_VERBOSE) \
d34af1a4fea9785e1d7f8aff94fe157b2af0d2f5Mark J. Nelson -O $$p.res -I transforms \
d34af1a4fea9785e1d7f8aff94fe157b2af0d2f5Mark J. Nelson strip_versions $$p.dep.res; \
d34af1a4fea9785e1d7f8aff94fe157b2af0d2f5Mark J. Nelson $(RM) $$p.dep.res; \
d34af1a4fea9785e1d7f8aff94fe157b2af0d2f5Mark J. Nelson else \
d34af1a4fea9785e1d7f8aff94fe157b2af0d2f5Mark J. Nelson $(MV) $$p.dep.res $$p.res; \
d34af1a4fea9785e1d7f8aff94fe157b2af0d2f5Mark J. Nelson fi; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza done; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza fi
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(PKGDEBUG)$(TOUCH) $(@)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
e3c7c8f87921d6207a2ea7e79b31f9762e18116fMark J. Nelsoninstall: $(ALL_TARGETS) repository-metadata
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazarepository-metadata: publish_pkgs
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(PKGDEBUG)for r in $(REPOS); do \
07b48dbef2d1395c82edeccaf10e42ea7c0b6b36Yuri Pankov pkgrepo refresh -s $(PKGDEST)/repo.$$r; \
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
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson#
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson# Before publishing, we want to pull the license files from $CODEMGR_WS
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson# into the proto area. This allows us to NOT pass $SRC (or
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson# $CODEMGR_WS) as a basedir for publication.
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson#
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson$(PUB_PKGS): stage-licenses
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
ebbab6bbae913efeadfa3c6a1b082664a125f95bDan Price# variable assignments to stdout. Those are published to the
ebbab6bbae913efeadfa3c6a1b082664a125f95bDan Price# .vars temporary files, and then used as input to the eval
ebbab6bbae913efeadfa3c6a1b082664a125f95bDan Price# statement. This is done in stages specifically so that pkgmogrify
ebbab6bbae913efeadfa3c6a1b082664a125f95bDan Price# can signal failure if the manifest has a syntactic or other error.
ebbab6bbae913efeadfa3c6a1b082664a125f95bDan Price# The eval statement should begin with the default values, and the
ebbab6bbae913efeadfa3c6a1b082664a125f95bDan Price# output from pkgmogrify (if any) should be in the form of a
ebbab6bbae913efeadfa3c6a1b082664a125f95bDan Price# variable assignment to override those 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
77c29b8ee88bf82021ff549b17b44e17f2ef7d7bRichard Lowe# pkgmogrify encounters an abort in the publish transforms.
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)"
efcb7078c2d1766a6682e861629cafbc6724c14aYuri Pankov @env PKGFMT_OUTPUT=v1 pkgfmt -c $<
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(PKGDEBUG)$(RM) $(@) $(@:%.mog=%) $(@:%.mog=%.nodepend) \
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson $(@:%.mog=%.lics) $(PDIR)/$(@F:%.mog=%).metadata.* $(@).vars
ebbab6bbae913efeadfa3c6a1b082664a125f95bDan Price $(PKGDEBUG)$(PKGMOGRIFY) $(PKGMOG_VERBOSE) $(PM_INC:%= -I %) \
ebbab6bbae913efeadfa3c6a1b082664a125f95bDan Price $(PKGMOG_DEFINES:%=-D %) -P $(@).vars -O $(@) \
ebbab6bbae913efeadfa3c6a1b082664a125f95bDan Price $(<) $(PM_TRANSFORMS)
ebbab6bbae913efeadfa3c6a1b082664a125f95bDan Price $(PKGDEBUG)eval REPO=redist PKGSTAT=current NODEPEND=$(SUPPRESSPKGDEP) \
ebbab6bbae913efeadfa3c6a1b082664a125f95bDan Price `$(CAT) -s $(@).vars`; \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza if [ -f $(@) ]; then \
d34af1a4fea9785e1d7f8aff94fe157b2af0d2f5Mark J. Nelson if [ "$$NODEPEND" != "false" ]; 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; \
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson print $$LICS > $(@:%.mog=%.lics); \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza else \
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson $(TOUCH) $(@) $(@:%.mog=%.lics); \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza fi
ebbab6bbae913efeadfa3c6a1b082664a125f95bDan Price $(PKGDEBUG)$(RM) $(@).vars
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 \
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson -d $(PKGROOT) -d $(TOOLSROOT) \
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson -d license_files -d $(PKGROOT)/licenses \
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson --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)"
ebbab6bbae913efeadfa3c6a1b082664a125f95bDan Price $(PKGDEBUG)$(RM) $(@) $(PDIR)/$(@F:%.mog=%).metadata.* $(@).vars
ebbab6bbae913efeadfa3c6a1b082664a125f95bDan Price $(PKGDEBUG)$(PKGMOGRIFY) $(PKGMOG_VERBOSE) -I transforms -I $(PDIR) \
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza $(PKGMOG_DEFINES:%=-D %) -D PKGDEP_TYPE=$(PKGDEP_TYPE) \
ebbab6bbae913efeadfa3c6a1b082664a125f95bDan Price -P $(@).vars -O $(@) $(@F:%.mog=%.mf) \
ebbab6bbae913efeadfa3c6a1b082664a125f95bDan Price $(PM_TRANSFORMS) synthetic
ebbab6bbae913efeadfa3c6a1b082664a125f95bDan Price $(PKGDEBUG)eval REPO=redist PKGSTAT=current `$(CAT) -s $(@).vars`; \
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
ebbab6bbae913efeadfa3c6a1b082664a125f95bDan Price $(PKGDEBUG)$(RM) $(@).vars
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) $(@); \
7b07063d906859b2be1e88791f801b3c96e432f6Igor Kozhukhov $(AWK) '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
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson#
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson# The .lics files were created during pkgmogrification, and list the
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson# set of licenses to pull from $SRC for each package. Because
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson# licenses may be duplicated between packages, we uniquify them as
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson# well as aggregating them here.
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson#
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelsonlicense-list: makesilent
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson $(PKGDEBUG)( for l in `cat $(PROC_PKGS:%.mog=%.lics)`; \
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson do print $$l; done ) | sort -u > $@
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson#
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson# Staging the license and description files in the proto area allows
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson# us to do proper unreferenced file checking of both license and
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson# description files without blanket exceptions, and to pull license
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson# content without reference to $CODEMGR_WS during publication.
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson#
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelsonstage-licenses: license-list FRC
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson $(PKGDEBUG)$(MAKE) -e -f Makefile.lic \
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson PKGDEBUG=$(PKGDEBUG) LICROOT=$(PKGROOT)/licenses \
7b07063d906859b2be1e88791f801b3c96e432f6Igor Kozhukhov `$(AWK) '{ \
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson print "$(PKGROOT)/licenses/" $$0; \
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson print "$(PKGROOT)/licenses/" $$0 ".descrip"; \
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson }' license-list` > /dev/null;
5084e753b79a753c8b532c06eb3ad1d025e8e472Mark J. Nelson
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: