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