Makefile revision 1161
1337N/A############################################################################### 1337N/A# Makefile for X Consolidation packages 1337N/A# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. 0N/A# Permission is hereby granted, free of charge, to any person obtaining a 0N/A# copy of this software and associated documentation files (the "Software"), 1298N/A# to deal in the Software without restriction, including without limitation 1298N/A# the rights to use, copy, modify, merge, publish, distribute, sublicense, 1298N/A# and/or sell copies of the Software, and to permit persons to whom the 1298N/A# Software is furnished to do so, subject to the following conditions: 1298N/A# The above copyright notice and this permission notice (including the next 1298N/A# paragraph) shall be included in all copies or substantial portions of the 1298N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1298N/A# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1298N/A# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 1298N/A# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 1298N/A# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 1298N/A# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 0N/A# DEALINGS IN THE SOFTWARE. 0N/A############################################################################### 0N/A# Please read the comments in it and the accompanying README in ON for many 1298N/A# Major differences in the X implementation: 1298N/A# - X only supports building one repo, not redist + extra 0N/A# - X only supports building packages on the same platform as the binaries, 1298N/A# no cross-platform packaging 1298N/A# - X has no bfu legacy to deal with 1298N/A# - ON has all manifests in one directory, X splits into current & legacy 1298N/A### Include common definitions 115N/A# We don't yet support building packages cross-architecture, but would 1298N/A# need this if we ever did. (See "Cross platform packaging notes" in 1298N/A# Map X makefile names to the ones used in the rules copied from ON 1337N/A# More to be updated if we ever decide to support building cross-platform 1298N/A# Map the V=1 style of enabling more verbose build messages used in the 1298N/A# You can enable verbose output with either V=1 or PKGDEBUG="" 1298N/A# Commands used in rules copied from ON 1298N/A# To suppress package dependency generation on any system, regardless 1298N/A# of how it was installed, set SUPPRESSPKGDEP=true in the build 1298N/A# The packages directory will contain the processed manifests as 1298N/A# direct build targets and subdirectories for package metadata extracted 0N/A# incidentally during manifest processing. 1298N/A# Nothing underneath $(PDIR) should ever be managed by SCM. 1298N/A# By default, PKGS will list all manifests. To build and/or publish a 1298N/A# subset of packages, override this on the command line or in the 1298N/A# build environment and then reference (implicitly or explicitly) the all 1298N/A# Track the synthetic manifests separately so we can properly express 1298N/A# build rules and dependencies. The synthetic and real packages use 1298N/A# different sets of transforms and macros for pkgmogrify. 975N/A# Manifests are in either manifests or legacy directory - merge in $(PDIR) 979N/A### Additional metadata generation 975N/A# This should eventually move into pkg publication 975N/A @
print "## Generating font metadata in $(@F)" 975N/A### Manifest mogrification 975N/A# RELEASE = uname -r for the target release 1298N/A# Generate pkgmogrify transform file with correct build version info in 975N/A# Build number is derived from last nv_XXX tag in hg log 1298N/A @
print "## Substituting build info in versions transformation template" 1298N/A 'if ($$_ =~ m/^tag:\s+nv_([\d\.]+)/) { print $$1 ; exit}')}" ; \
975N/A $(PERL) -p -e
"s{_PKGVERS_BUILD_}{$${PKGVERS_BUILD}};" \
975N/A# Set variables used by pkgmogrify 975N/A# These are the macros that may be used in package manifests 975N/A# Most upstream packages provide specific version numbers instead of using 975N/A# the default of $(OSPKGVERS) 1298N/A# Some use $(X11PKGVERS) to refer to the X11 katamari version since they 975N/A# bundle together components from multiple upstream packages with individual 975N/A# Platform specific choices 975N/A# Architecture specific directory names 975N/A# Default transformations to apply 1298N/A# Additional transforms for specific types of packages 975N/A# Combine & uniq metadata & license attributes generated during build 1298N/A @
print "## Gathering metadata from build for $(@F)" 299N/A @
print "## Generating dependencies for $(<F)" 0N/A @
print "## Skipping dependency generation for $(@F:%.dep=%)" 1299N/A# Root of pkg image to use for dependency resolution 1299N/A# Normally / on the machine used to build the binaries 1299N/A# This rule resolves dependencies across all manifests for packages 1299N/A# currently delivering files. 1343N/A print "## Suppressing dependency resolution"; \
1343N/A print "## Resolving dependencies"; \
1343N/A# Post-processing of manifests after dependency resolution 1343N/A @
print "## Post-processing manifest for $(@F:%.res=%)" 1343N/A# Generate info for synthetic manifests 0N/A @
print "## Gathering package lists for synthetic package $(@F:%.res=%)" 979N/A### pkglint checking (pre-publication) 0N/A# This rule runs pkglint across all manifests to be published. 116N/A# We require that packages be free from lint ERRORs before allowing them 979N/A# to be published. Lint WARNINGs are acceptable (though unpleasant) 116N/A# The list of packages is the list of packages that did not resolve to 979N/A# 0-byte files, $CHECK_PKGS 979N/A @
print "## Checking packages" 979N/A if [[ -n
"$${CHECK_PKGS}" ]];
then \
116N/A# Default in developer builds is "xnv-devel" 979N/A# X RE cronjob build scripts override to "xnv-nightly" 1347N/A# Initialize the empty on-disk repositories 1347N/A @
print "## Initializing $(@F)" 1347N/A### Package publication to repo 1298N/A print "## Publishing $(@F:%.pub=%) to proto repository"; \
1298N/A @
print "## Creating repository metadata" 863N/A### pkglint checking (post-publication) 1301N/A# Perform a pkglint run on the published repositories. We remove package 1298N/A# version information from the lint output so that it is comparable across 1301N/A# rules to validate proto area against manifests, and check for safe 863N/A# should never be packaged 863N/A# Instead of fixing all the upstream packages to follow our permission rules 1321N/A# just fix the proto area to match our rules 1298N/A @
print "## Fixing proto area permissions"