Makefile revision 1105
70N/A############################################################################### 286N/A# Makefile for X Consolidation packages 70N/A# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. 70N/A# Permission is hereby granted, free of charge, to any person obtaining a 70N/A# copy of this software and associated documentation files (the "Software"), 70N/A# to deal in the Software without restriction, including without limitation 70N/A# the rights to use, copy, modify, merge, publish, distribute, sublicense, 70N/A# and/or sell copies of the Software, and to permit persons to whom the 70N/A# Software is furnished to do so, subject to the following conditions: 70N/A# The above copyright notice and this permission notice (including the next 70N/A# paragraph) shall be included in all copies or substantial portions of the 70N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 70N/A# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 70N/A# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 70N/A# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 70N/A# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 70N/A# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 70N/A# DEALINGS IN THE SOFTWARE. 70N/A############################################################################### 70N/A# Please read the comments in it and the accompanying README in ON for many 70N/A# details omitted here. 70N/A# Major differences in the X implementation: 439N/A# - X only supports building one repo, not redist + extra 70N/A# - X only supports building packages on the same platform as the binaries, 70N/A# no cross-platform packaging 70N/A# - X has no bfu legacy to deal with 359N/A# - ON has all manifests in one directory, X splits into current & legacy 213N/A### Include common definitions 320N/A# We don't yet support building packages cross-architecture, but would 332N/A# need this if we ever did. (See "Cross platform packaging notes" in 346N/A# Map X makefile names to the ones used in the rules copied from ON 425N/A# More to be updated if we ever decide to support building cross-platform 316N/A# Map the V=1 style of enabling more verbose build messages used in the 332N/A# You can enable verbose output with either V=1 or PKGDEBUG="" 335N/A# Commands used in rules copied from ON 434N/A# To suppress package dependency generation on any system, regardless 277N/A# of how it was installed, set SUPPRESSPKGDEP=true in the build 424N/A# The packages directory will contain the processed manifests as 286N/A# direct build targets and subdirectories for package metadata extracted 90N/A# incidentally during manifest processing. 70N/A# Nothing underneath $(PDIR) should ever be managed by SCM. 319N/A# By default, PKGS will list all manifests. To build and/or publish a 280N/A# subset of packages, override this on the command line or in the 319N/A# build environment and then reference (implicitly or explicitly) the all 156N/A# Track the synthetic manifests separately so we can properly express 156N/A# build rules and dependencies. The synthetic and real packages use 98N/A# different sets of transforms and macros for pkgmogrify. 70N/A# Any given package list may be empty, but we can only determine that 70N/A# dynamically, so we always generate all lists. 70N/A# The meanings of each package status are as follows: 70N/A# ---------- ---------------------------------------------------- 70N/A# noincorp Do not include in incorporation or group package 70N/A# grouponly Include in group package, but not incorporation 70N/A# obsolete Include in incorporation, but not group package 70N/A# renamed Include in incorporation, but not group package 380N/A# current Include in incorporation and group package 380N/A# Since the semantics of the "noincorp" package status dictate that 70N/A# such packages are not included in the incorporation or group packages, 70N/A# there is no need to build noincorp package lists. 70N/A# Since packages depend on their incorporation, noincorp necessarily 253N/A# implies nodepend, or it would inadvertently pull in other packages. # Manifests are in either manifests or legacy directory - merge in $(PDIR) ### Additional metadata generation # This should eventually move into pkg publication @
print "## Generating font metadata in $(@F)"### Manifest mogrification # RELEASE = uname -r for the target release # Generate pkgmogrify transform file with correct build version info in # Build number is derived from last nv_XXX tag in hg log @
print "## Substituting build info in versions transformation template" 'if ($$_ =~ m/^tag:\s+nv_([\d\.]+)/) { print $$1 ; exit}')}" ; \
$(PERL) -p -e
"s{_PKGVERS_BUILD_}{$${PKGVERS_BUILD}};" \
# Set variables used by pkgmogrify # Most upstream packages provide specific version numbers instead of using # the default of $(OSPKGVERS) # Some use $(X11PKGVERS) to refer to the X11 katamari version since they # bundle together components from multiple upstream packages with individual # These are the macros that may be used in package manifests # Default transformations to apply # Extra transforms for non-legacy packages # Combine & uniq metadata & license attributes generated during build @
print "## Gathering metadata from build for $(@F)" @
print "## Processing manifest $(@F:.mog=.p5m)"# make the package lists from the real manifests for the synthetic manifests @
print "## Generating $(@F:packages.%=%) package list" -e
'if ($$_ =~ m{name=pkg.fmri value=(\S+)}) {' \
-e
' printf "depend fmri=$$1 type=\$$(PKGDEP_TYPE)\n";' \
# The package lists are generated with $(PKGDEP_TYPE) as their # dependency types, so that they can be included by either an # incorporation or a group package. # rule to build the synthetic manifests @
print "## Processing synthetic manifest $(@F:%.mog=%.p5m)" @
print "## Generating dependencies for $(<F)" @
print "## Skipping dependency generation for $(@F:%.dep=%)"### Dependency resolution # This rule resolves dependencies across all published manifests. # We should be able to do this with # pkgdepend resolve -m $(PUB_PKGS:%.pub=%.dep) # but until 14113 is fixed, the incorporations confuse pkgdepend, so we # just create the .res file for DEP_SYNTH_PKGS directly. # Root of pkg image to use for dependency resolution # Normally / on the machine used to build the binaries print "## Suppressing dependency resolution"; \
print "## Resolving dependencies"; \
# Default in developer builds is "xnv-devel" # X RE cronjob build scripts override to "xnv-nightly" or "xnv-biweekly" # Initialize the empty on-disk repositories @
print "## Initializing $(@F)"### Package publication to repo print "## Publishing $(@F:%.pub=%) to proto repository"; \
@
print "## Creating repository metadata"# rules to validate proto area against manifests, and check for safe # Automatically exclude all pkg-config uninstalled.pc files, since those # should never be packaged # Instead of fixing all the upstream packages to follow our permission rules # just fix the proto area to match our rules @
print "## Fixing proto area permissions"