Makefile revision 1120
bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch###############################################################################
53d794b1cb99c0cc437ec9449d19abf504058390Timo Sirainen# Makefile for X Consolidation packages
53d794b1cb99c0cc437ec9449d19abf504058390Timo Sirainen# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
1904e2fc786dbc037039d284b371730777277fc5Aki Tuomi# Permission is hereby granted, free of charge, to any person obtaining a
1904e2fc786dbc037039d284b371730777277fc5Aki Tuomi# copy of this software and associated documentation files (the "Software"),
1904e2fc786dbc037039d284b371730777277fc5Aki Tuomi# to deal in the Software without restriction, including without limitation
a95a4743552a44f95f72e9bd3ad41cc44609632dTimo Sirainen# the rights to use, copy, modify, merge, publish, distribute, sublicense,
1904e2fc786dbc037039d284b371730777277fc5Aki Tuomi# and/or sell copies of the Software, and to permit persons to whom the
fb09842fd58e4f8c30de9dd0836434c712c62198Timo Sirainen# Software is furnished to do so, subject to the following conditions:
5a35caefcf8cf38c347f8406b26701487c8cda57Timo Sirainen# The above copyright notice and this permission notice (including the next
53d794b1cb99c0cc437ec9449d19abf504058390Timo Sirainen# paragraph) shall be included in all copies or substantial portions of the
cd2ed64888b42b481cde6bb9548c8520516fa3e9Timo Sirainen# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
53d794b1cb99c0cc437ec9449d19abf504058390Timo Sirainen# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
cd2ed64888b42b481cde6bb9548c8520516fa3e9Timo Sirainen# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
53d794b1cb99c0cc437ec9449d19abf504058390Timo Sirainen# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
cd2ed64888b42b481cde6bb9548c8520516fa3e9Timo Sirainen# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
53d794b1cb99c0cc437ec9449d19abf504058390Timo Sirainen# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
cd2ed64888b42b481cde6bb9548c8520516fa3e9Timo Sirainen# DEALINGS IN THE SOFTWARE.
94d0d29f23083c4e79a3fc6b76e9ed761b0e3511Timo Sirainen###############################################################################
53d794b1cb99c0cc437ec9449d19abf504058390Timo Sirainen# Heavily inspired by / borrowed from the ON usr/src/pkg/Makefile
cd2ed64888b42b481cde6bb9548c8520516fa3e9Timo Sirainen# Please read the comments in it and the accompanying README in ON for many
cd2ed64888b42b481cde6bb9548c8520516fa3e9Timo Sirainen# details omitted here.
cd2ed64888b42b481cde6bb9548c8520516fa3e9Timo Sirainen# Major differences in the X implementation:
cd2ed64888b42b481cde6bb9548c8520516fa3e9Timo Sirainen# - X only supports building one repo, not redist + extra
cd2ed64888b42b481cde6bb9548c8520516fa3e9Timo Sirainen# - X only supports building packages on the same platform as the binaries,
cd2ed64888b42b481cde6bb9548c8520516fa3e9Timo Sirainen# no cross-platform packaging
35283613d4c04ce18836e9fc431582c87b3710a0Timo Sirainen# - X has no bfu legacy to deal with
35283613d4c04ce18836e9fc431582c87b3710a0Timo Sirainen# - ON has all manifests in one directory, X splits into current & legacy
cd2ed64888b42b481cde6bb9548c8520516fa3e9Timo Sirainen# - Integrates with X consolidation makefile/build system instead of ON's
cd2ed64888b42b481cde6bb9548c8520516fa3e9Timo Sirainen### Include common definitions
a07b1d77c546256eebda95b7c403e92e1bbcbe94Timo Sirainen# We don't yet support building packages cross-architecture, but would
a07b1d77c546256eebda95b7c403e92e1bbcbe94Timo Sirainen# need this if we ever did. (See "Cross platform packaging notes" in
a07b1d77c546256eebda95b7c403e92e1bbcbe94Timo Sirainen# the ON usr/src/pkg/Makefile for what we'd have to do.)
a07b1d77c546256eebda95b7c403e92e1bbcbe94Timo Sirainen# Map X makefile names to the ones used in the rules copied from ON
53d794b1cb99c0cc437ec9449d19abf504058390Timo Sirainen# More to be updated if we ever decide to support building cross-platform
cd2ed64888b42b481cde6bb9548c8520516fa3e9Timo Sirainen# Map the V=1 style of enabling more verbose build messages used in the
cd2ed64888b42b481cde6bb9548c8520516fa3e9Timo Sirainen# X.Org/automake builds to the macro used in the rules copied from ON
cd2ed64888b42b481cde6bb9548c8520516fa3e9Timo Sirainen# You can enable verbose output with either V=1 or PKGDEBUG=""
53d794b1cb99c0cc437ec9449d19abf504058390Timo Sirainen# Commands used in rules copied from ON
94d0d29f23083c4e79a3fc6b76e9ed761b0e3511Timo Sirainen# To suppress package dependency generation on any system, regardless
a3fe8c0c54d87822f4b4f8f0d10caac611861b2bTimo Sirainen# of how it was installed, set SUPPRESSPKGDEP=true in the build
94d0d29f23083c4e79a3fc6b76e9ed761b0e3511Timo Sirainen# environment.
cd2ed64888b42b481cde6bb9548c8520516fa3e9Timo Sirainen# The packages directory will contain the processed manifests as
94d0d29f23083c4e79a3fc6b76e9ed761b0e3511Timo Sirainen# direct build targets and subdirectories for package metadata extracted
94d0d29f23083c4e79a3fc6b76e9ed761b0e3511Timo Sirainen# incidentally during manifest processing.
94d0d29f23083c4e79a3fc6b76e9ed761b0e3511Timo Sirainen# Nothing underneath $(PDIR) should ever be managed by SCM.
a3fe8c0c54d87822f4b4f8f0d10caac611861b2bTimo Sirainen# By default, PKGS will list all manifests. To build and/or publish a
94d0d29f23083c4e79a3fc6b76e9ed761b0e3511Timo Sirainen# subset of packages, override this on the command line or in the
a3fe8c0c54d87822f4b4f8f0d10caac611861b2bTimo Sirainen# build environment and then reference (implicitly or explicitly) the all
a3fe8c0c54d87822f4b4f8f0d10caac611861b2bTimo Sirainen# or install targets.
a3fe8c0c54d87822f4b4f8f0d10caac611861b2bTimo SirainenCURRENT_MANIFESTS :sh= (cd manifests; print *.p5m)
53d794b1cb99c0cc437ec9449d19abf504058390Timo SirainenMANIFESTS = $(CURRENT_MANIFESTS) $(LEGACY_MANIFESTS)
eb627e89fba85791ec894e57f96752b1bd64d001Timo Sirainen# Track the synthetic manifests separately so we can properly express
eb627e89fba85791ec894e57f96752b1bd64d001Timo Sirainen# build rules and dependencies. The synthetic and real packages use
cd2ed64888b42b481cde6bb9548c8520516fa3e9Timo Sirainen# different sets of transforms and macros for pkgmogrify.
cd2ed64888b42b481cde6bb9548c8520516fa3e9Timo Sirainen# Any given package list may be empty, but we can only determine that
cd2ed64888b42b481cde6bb9548c8520516fa3e9Timo Sirainen# dynamically, so we always generate all lists.
cd2ed64888b42b481cde6bb9548c8520516fa3e9Timo Sirainen# The meanings of each package status are as follows:
cd2ed64888b42b481cde6bb9548c8520516fa3e9Timo Sirainen# PKGSTAT meaning
cd2ed64888b42b481cde6bb9548c8520516fa3e9Timo Sirainen# ---------- ----------------------------------------------------
cd2ed64888b42b481cde6bb9548c8520516fa3e9Timo Sirainen# noincorp Do not include in incorporation or group package
53d794b1cb99c0cc437ec9449d19abf504058390Timo Sirainen# grouponly Include in group package, but not incorporation
53d794b1cb99c0cc437ec9449d19abf504058390Timo Sirainen# obsolete Include in incorporation, but not group package
53d794b1cb99c0cc437ec9449d19abf504058390Timo Sirainen# renamed Include in incorporation, but not group package
53d794b1cb99c0cc437ec9449d19abf504058390Timo Sirainen# current Include in incorporation and group package
53d794b1cb99c0cc437ec9449d19abf504058390Timo Sirainen# Since the semantics of the "noincorp" package status dictate that
cd2ed64888b42b481cde6bb9548c8520516fa3e9Timo Sirainen# such packages are not included in the incorporation or group packages,
a857fb61f1cc77a81d18adee6a95ae04c27a5ffbTimo Sirainen# there is no need to build noincorp package lists.
a857fb61f1cc77a81d18adee6a95ae04c27a5ffbTimo Sirainen# Since packages depend on their incorporation, noincorp necessarily
cd2ed64888b42b481cde6bb9548c8520516fa3e9Timo Sirainen# implies nodepend, or it would inadvertently pull in other packages.
a3fe8c0c54d87822f4b4f8f0d10caac611861b2bTimo Sirainen# Manifests are in either manifests or legacy directory - merge in $(PDIR)
cd2ed64888b42b481cde6bb9548c8520516fa3e9Timo Sirainen### Additional metadata generation
d2470b3dfe91ca07459185384ee25080b42a1636Timo Sirainen# This should eventually move into pkg publication
53d794b1cb99c0cc437ec9449d19abf504058390Timo SirainenFONT_MANIFESTS :sh= (cd manifests; print system-font-*.p5m)
53d794b1cb99c0cc437ec9449d19abf504058390Timo SirainenFONT_METADATA = $(FONT_MANIFESTS:%.p5m=$(PDIR)/%.font)
94d0d29f23083c4e79a3fc6b76e9ed761b0e3511Timo SirainenFONT_ATTRS = $(FONT_MANIFESTS:%.p5m=$(PDIR)/%.attr)
94d0d29f23083c4e79a3fc6b76e9ed761b0e3511Timo Sirainen $(PKGDEBUG)$(PERL) generate_font_metadata.pl \
abc014a64d1f63e01ea134700c67af4e098bf54fTimo Sirainen -p $(PROTODIR) -m $< > $@ || ( rm $@ ; exit 1 )
29ca4c8015b4936378d49937f97049f33d3aaaf9Timo Sirainen### Manifest mogrification
29ca4c8015b4936378d49937f97049f33d3aaaf9Timo Sirainen# RELEASE = uname -r for the target release
29ca4c8015b4936378d49937f97049f33d3aaaf9Timo Sirainen# Generate pkgmogrify transform file with correct build version info in
29ca4c8015b4936378d49937f97049f33d3aaaf9Timo Sirainen# Build number is derived from last nv_XXX tag in hg log
29ca4c8015b4936378d49937f97049f33d3aaaf9Timo Sirainen$(PDIR)/versions: transforms/versions.tmpl $(PDIR)
29ca4c8015b4936378d49937f97049f33d3aaaf9Timo Sirainen @print "## Substituting build info in versions transformation template"
29ca4c8015b4936378d49937f97049f33d3aaaf9Timo Sirainen $(PKGDEBUG)XNV_BUILDNUM="$${XNV_BUILDNUM:-$$(hg log | \
abc014a64d1f63e01ea134700c67af4e098bf54fTimo Sirainen 'if ($$_ =~ m/^tag:\s+nv_([\d\.]+)/) { print $$1 ; exit}')}" ; \
# Base URL for ARC cases used in opensolaris.arc_url metadata
-e 'if ($$_ =~ m{name=pkg.fmri value=(\S+)}) {' \
$(PKGDEST):
# Automatically exclude all pkg-config uninstalled.pc files, since those
# Handle exceptions list exceptions-validate_pkg.p5m