Makefile revision 1527
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi###############################################################################
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Makefile for X Consolidation packages
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Permission is hereby granted, free of charge, to any person obtaining a
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# copy of this software and associated documentation files (the "Software"),
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# to deal in the Software without restriction, including without limitation
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# the rights to use, copy, modify, merge, publish, distribute, sublicense,
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# and/or sell copies of the Software, and to permit persons to whom the
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Software is furnished to do so, subject to the following conditions:
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# The above copyright notice and this permission notice (including the next
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# paragraph) shall be included in all copies or substantial portions of the
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# DEALINGS IN THE SOFTWARE.
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi###############################################################################
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Heavily inspired by / borrowed from the ON usr/src/pkg/Makefile
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Please read the comments in it and the accompanying README in ON for many
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# details omitted here.
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Major differences in the X implementation:
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# - X only supports building one repo, not redist + extra
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# - X only supports building packages on the same platform as the binaries,
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# no cross-platform packaging
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# - X has no bfu legacy to deal with
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# - ON has all manifests in one directory, X splits into current & legacy
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# - Integrates with X consolidation makefile/build system instead of ON's
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi### Include common definitions
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# We don't yet support building packages cross-architecture, but would
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# need this if we ever did. (See "Cross platform packaging notes" in
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# the ON usr/src/pkg/Makefile for what we'd have to do.)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Map X makefile names to the ones used in the rules copied from ON
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# More to be updated if we ever decide to support building cross-platform
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Map the V=1 style of enabling more verbose build messages used in the
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# X.Org/automake builds to the macro used in the rules copied from ON
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# You can enable verbose output with either V=1 or PKGDEBUG=""
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Commands used in rules copied from ON
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# To suppress package dependency generation on any system, regardless
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# of how it was installed, set SUPPRESSPKGDEP=true in the build
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# environment.
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# The packages directory will contain the processed manifests as
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# direct build targets and subdirectories for package metadata extracted
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# incidentally during manifest processing.
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Nothing underneath $(PDIR) should ever be managed by SCM.
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# By default, PKGS will list all manifests. To build and/or publish a
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# subset of packages, override this on the command line or in the
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# build environment and then reference (implicitly or explicitly) the all
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# or install targets.
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiCURRENT_MANIFESTS :sh= (cd manifests; print *.p5m)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiLEGACY_MANIFESTS :sh= (cd legacy; print *.p5m)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiMANIFESTS = $(CURRENT_MANIFESTS) $(LEGACY_MANIFESTS)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Track the synthetic manifests separately so we can properly express
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# build rules and dependencies. The synthetic and real packages use
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# different sets of transforms and macros for pkgmogrify.
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Special manifest for exceptions to pass to pkglint & validate_pkg
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiEXCEPTION_MANIFESTS = exceptions-validate_pkg.p5m
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Manifests are in either manifests or legacy directory - merge in $(PDIR)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiALL_MANIFEST_SRCS = $(MANIFESTS) $(SYNTH_MANIFESTS) $(EXCEPTION_MANIFESTS)
92cbfdaf682dca9cf60243f23c2e911181bfc7abKATOH YasufumiALL_MANIFESTS = $(ALL_MANIFEST_SRCS:%=$(PDIR)/%)
92cbfdaf682dca9cf60243f23c2e911181bfc7abKATOH Yasufumi### Additional metadata generation
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Generate default copyright notice for packages without contents
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi$(PROTOMETA)/%/cr_Oracle: $(PDIR)/%.p5m $(PROTOMETA)/%/
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi $(PKGDEBUG)gsed -n -e '/# Copyright .* Oracle/ {' \
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiSYNTH_LICENSES = $(SYNTH_PKGS:%=$(PROTOMETA)/%/cr_Oracle)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# This should eventually move into pkg publication
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiFONT_MANIFESTS :sh= (cd manifests; print system-font-*.p5m)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiFONT_METADATA = $(FONT_MANIFESTS:%.p5m=$(PDIR)/%.font)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiFONT_ATTRS = $(FONT_MANIFESTS:%.p5m=$(PDIR)/%.attr)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiFONT_LIBS_PATH=$(PROTODIR)$(X11_SERVERLIBS_DIR)$(LIBSUBDIR_64):$(PROTODIR)$(X11_DIR)/lib$(LIBSUBDIR_64):$(PROTODIR)/usr/lib$(LIBSUBDIR_64)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi @print "## Generating font metadata in $(@F)"
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi $(PKGDEBUG)LD_LIBRARY_PATH=$(FONT_LIBS_PATH) \
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi -p $(PROTODIR) -m $< > $@ || ( rm $@ ; exit 1 )
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi### Manifest mogrification
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# RELEASE = uname -r for the target release
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# The PKGVERS_BRANCH is determined by the values in the Makefile.buildnum
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# PSARC 2012/240 for package version scheme
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiPKGVERS_BRANCH_MAIN = 5.12.$(UPDATENUM).$(SRUNUM).$(PLATNUM)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiPKGVERS_BRANCH = $(PKGVERS_BRANCH_MAIN).$(BUILDID).$(NIGHTLYID)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiPKGVERS_BUILD = $(PKGVERS_BUILTON)-$(PKGVERS_BRANCH)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Generate pkgmogrify transform file with correct build version info in
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Build number is derived from last nv_XXX tag in hg log
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi$(PDIR)/versions: transforms/versions.tmpl $(PDIR)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi @print "## Substituting build info in versions transformation template"
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi $(PERL) -p -e "s{_PKGVERS_BUILD_}{$(PKGVERS_BUILD)};" \
db821c3a4168c9c1072a433340e6009892e26cf2KATOH Yasufumi -e "s{_HG_ID_}{$${HG_ID}}" transforms/versions.tmpl > $@
db821c3a4168c9c1072a433340e6009892e26cf2KATOH Yasufumi# Set variables used by pkgmogrify
db821c3a4168c9c1072a433340e6009892e26cf2KATOH Yasufumi# These are the macros that may be used in package manifests
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Most upstream packages provide specific version numbers instead of using
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# the default of $(OSPKGVERS)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Some use $(X11PKGVERS) to refer to the X11 katamari version since they
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# bundle together components from multiple upstream packages with individual
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# version numbers
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Base URL for ARC cases used in opensolaris.arc_url metadata
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiPKGMOG_DEFINES += ARC_URL='http://arc.opensolaris.org/caselog/'
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Platform specific choices
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiPKGMOG_DEFINES += i386_ONLY=$(POUND_SIGN) sparc_ONLY=$(POUND_SIGN)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Architecture specific directory names
0dc296145715c36795ad0ad561f115afdd758223KATOH YasufumiPKGMOG_DEFINES += ARCH32=$(SUBDIR32_$(PKGMACH))
a1e4c206d5373b8ecd7906bff37f2601d65f022cKATOH YasufumiPKGMOG_DEFINES += ARCH64=$(SUBDIR64_$(PKGMACH))
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Perl version string used in package names, such as pkg:/runtime/perl-512
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiPERL_PKG_VERSION_CMD = print $(PERL_VERSION) | tr -d '.'
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiPKGMOG_DEFINES += PERL_PKG_VERSION=$(PERL_PKG_VERSION_CMD:sh)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Python version string used in path names, such as /usr/lib/python2.6
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiPKGMOG_DEFINES += PYTHON_PATH_VERSION=$(PYTHON_VERSION)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Python version string used in package names, such as pkg:/runtime/python-26
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiPYTHON_PKG_VERSION_CMD = print $(PYTHON_VERSION) | tr -d '.'
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiPKGMOG_DEFINES += PYTHON_PKG_VERSION=$(PYTHON_PKG_VERSION_CMD:sh)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# automake version needed for build dependencies
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiAUTOMAKE_PKG_VERSION_CMD = print $(AUTOMAKE_VERSION) | tr -d '.'
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiPKGMOG_DEFINES += AUTOMAKE_PKG_VERSION=$(AUTOMAKE_PKG_VERSION_CMD:sh)
41e8e807c8e85289bb717a365056b9437555e25aKATOH Yasufumi# gcc version needed for build dependencies
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiGCC_PKG_VERSION_CMD = print $(GCC_VERSION) | tr -d '.'
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiPKGMOG_DEFINES += GCC_PKG_VERSION=$(GCC_PKG_VERSION_CMD:sh)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiPROC_CURRENT_PKGS = $(CURRENT_MANIFESTS:%.p5m=$(PDIR)/%.mog)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiPROC_LEGACY_PKGS = $(LEGACY_MANIFESTS:%.p5m=$(PDIR)/%.mog)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiPROC_SYNTH_PKGS = $(SYNTH_MANIFESTS:%.p5m=$(PDIR)/%.mog)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiPROC_EXCEPTIONS = $(EXCEPTION_MANIFESTS:%.p5m=$(PDIR)/%.mog)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Default transformations to apply
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Additional transforms for specific types of packages
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi$(PROC_CURRENT_PKGS) $(PROC_SYNTH_PKGS) $(PROC_EXCEPTIONS) := \
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi$(PROC_PKGS) $(PROC_SYNTH_PKGS): $(PDIR)/versions
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Combine & uniq metadata & license attributes generated during build
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi @print "## Gathering metadata from build for $(@F)"
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi system-font-*) ADDITIONAL_ATTRS="$(@:%.attr=%.font)" ;; \
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi $(PERL) merge-metadata.pl $${ADDITIONAL_ATTRS} \
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi ~(N)$(PROTOMETA)/$(@F:.attr=)/attributes_*.p5m \
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi ~(N)$(PROTOMETA)/$(@F:.attr=)/license_*.p5m /dev/null > $@
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi @print "## Processing manifest $(@F:.mog=.p5m)"
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi $(PKGDEBUG)$(PKGMOGRIFY) $(PKGMOG_VERBOSE) $(PM_INC:%= -I %) \
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# List of all packages we build, used in open source code release zip files
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi @print "## Generating pkglist.txt"
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi $(PKGDEBUG)$(PKGMOGRIFY) $(PKGMOG_VERBOSE) $(PM_INC:%= -I %) \
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi -I manifests -I legacy $(ALL_MANIFEST_SRCS) extract_names \
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi### Dependency detection
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Package manifest containing list of packages to use in dependency
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# resolution, and not containing any dependencies to be detected/resolved.
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiDEP_CURRENT_PKGS_1 = $(CURRENT_MANIFESTS:%.p5m=$(PDIR)/%.dep)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiDEP_CURRENT_PKGS = $(DEP_CURRENT_PKGS_1:$(PDIR)/$(DEP_LIST_PKG).dep=)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiDEP_LEGACY_PKGS = $(LEGACY_MANIFESTS:%.p5m=$(PDIR)/%.dep)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiDEP_LEGACY_PKGS += $(DEP_LIST_PKG:%=$(PDIR)/%.dep)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiDEP_SYNTH_PKGS = $(SYNTH_MANIFESTS:%.p5m=$(PDIR)/%.dep)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi 'PLATFORM=i86hvm' \
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi 'PLATFORM=i86pc' \
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi 'PLATFORM=i86xpv' \
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi 'ISALIST=amd64' \
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi 'ISALIST=i386'
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi 'PLATFORM=sun4u' \
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi 'PLATFORM=sun4v' \
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi 'ISALIST=sparcv9' \
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi 'ISALIST=sparc'
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi @print "## Generating dependencies for $(<F)"
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi $(PKGDEBUG)if [[ "$(SUPPRESSPKGDEP)" != "true" ]]; then \
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi pkgdepend generate -m $(PKGDEP_TOKENS:%=-D %) $(<) \
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi$(DEP_SYNTH_PKGS) $(DEP_LEGACY_PKGS): $$(@:%.dep=%.mog)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi @print "## Skipping dependency generation for $(@F:%.dep=%)"
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi### Dependency resolution
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiDEP_RES_CURRENT_PKGS = $(DEP_CURRENT_PKGS:%=%.res)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiDEP_RES_LEGACY_PKGS = $(DEP_LEGACY_PKGS:%=%.res)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiDEP_RES_SYNTH_PKGS = $(DEP_SYNTH_PKGS:%=%.res)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiPKGDEP_VERBOSE_FLAG = $(PKGDEP_VERBOSE_FLAG_$(V))
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Root of pkg image to use for dependency resolution
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Normally / on the machine used to build the binaries
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# File listing packages to consider in dependency resolution.
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Automatically generated from the developer package to ensure they
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# stay in sync.
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi$(PKGDEP_RESOLVE_LIST): $(PDIR)/$(DEP_LIST_PKG).mog
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi @print "## Generating package list for dependency resolution"
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi $(PKGDEBUG)$(PKGMOGRIFY) $(PKGMOG_VERBOSE) $(PM_INC:%= -I %) \
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi -O /dev/null -P $(@) $(PDIR)/$(DEP_LIST_PKG).mog extract_depends
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# This rule resolves dependencies across all manifests for packages
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# currently delivering files.
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi$(PDIR)/gendeps: $(DEP_CURRENT_PKGS) $(PKGDEP_RESOLVE_LIST)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi $(PKGDEBUG)if [[ "$(SUPPRESSPKGDEP)" = "true" ]]; then \
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi print "## Suppressing dependency resolution"; \
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi print "## Resolving dependencies"; \
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi pkgdepend -R $(PKGDEP_RESOLVE_IMAGE) resolve -E \
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi $(PKGDEP_VERBOSE_FLAG) -e $(PKGDEP_RESOLVE_LIST) \
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi$(DEP_RES_SYNTH_PKGS) $(DEP_RES_LEGACY_PKGS): $$(@:%.dep.res=%.dep)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi @print "## Skipping dependency generation for $(@F:%.dep.res=%)"
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# Post-processing of manifests after dependency resolution
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiRES_CURRENT_PKGS = $(CURRENT_MANIFESTS:%.p5m=$(PDIR)/%.res)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiRES_LEGACY_PKGS = $(LEGACY_MANIFESTS:%.p5m=$(PDIR)/%.res)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiRES_SYNTH_PKGS = $(SYNTH_MANIFESTS:%.p5m=$(PDIR)/%.res)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH YasufumiPOST_TRANSFORMS = post-pkgdepend extract_metadata
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi @print "## Post-processing manifest for $(@F:%.res=%)"
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi $(PKGDEBUG)if [[ -s $< ]] ; then \
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi $(PKGMOGRIFY) $(PKGMOG_VERBOSE) $(PM_INC:%= -I %) \
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi -O $@ -P $(@:%.res=%.synth) $< $(POST_TRANSFORMS) ; \
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi $(CP) $< $@ ; \
853d58fdf5af0960b7b6edc9dea0fadddb8535f1Elan Ruusamäe# Generate info for synthetic manifests
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi$(RES_SYNTH_PKGS): $(RES_PKGS) $$(@:%.res=%.dep.res)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi @print "## Gathering package lists for synthetic package $(@F:%.res=%)"
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi $(PKGDEBUG)$(PKGMOGRIFY) $(PKGMOG_VERBOSE) $(PM_INC:%= -I %) \
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi $(PKGDEBUG)$(SED) -n -f $(@:%.res=%.synth.sed) $(PDIR)/*.synth >> $(@)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi### pkglint checking (pre-publication)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# This rule runs pkglint across all manifests to be published.
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# We require that packages be free from lint ERRORs before allowing them
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# to be published. Lint WARNINGs are acceptable (though unpleasant)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# The list of packages is the list of packages that did not resolve to
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi# 0-byte files, $CHECK_PKGS
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi$(PDIR)/checkmf: $(PDIR)/gendeps $(DEP_SYNTH_PKGS) $(DEP_PKGS)
cab79123082bef9ba265c9c8b9176b8b8afedd64KATOH Yasufumi @print "## Checking packages"
if [[ -s $$p.res ]]; then \
@$(TOUCH) $@
$(PKGDEST):
lint:
$(PKGLINT_REFERENCE_REPO:%=-r %) \
# Automatically exclude all pkg-config uninstalled.pc files, since those