Makefile revision 1533
43b4c41fbb07705c9df321221ab9cb9832460407Christian Maeder# Makefile for X Consolidation
63f0e65a37b95621334db9ee4ba0cd9d826f5c0fChristian Maeder# Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# Permission is hereby granted, free of charge, to any person obtaining a
43b4c41fbb07705c9df321221ab9cb9832460407Christian Maeder# copy of this software and associated documentation files (the "Software"),
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# to deal in the Software without restriction, including without limitation
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# the rights to use, copy, modify, merge, publish, distribute, sublicense,
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# and/or sell copies of the Software, and to permit persons to whom the
43b4c41fbb07705c9df321221ab9cb9832460407Christian Maeder# Software is furnished to do so, subject to the following conditions:
d8c71aacc9f1c8cd40a8ad8dcdad9be8854b849fChristian Maeder# The above copyright notice and this permission notice (including the next
f2f9df2e17e70674f0bf426ed1763c973ee4cde0Christian Maeder# paragraph) shall be included in all copies or substantial portions of the
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
96646aed2ae087b942ae23f15bbe729a8f7c43d3Christian Maeder# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
c90087f49069855bf684b699f9ca1e2d65eac20bChristian Maeder# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
96646aed2ae087b942ae23f15bbe729a8f7c43d3Christian Maeder# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
01e383014b555bbcf639c0ca60c5810b3eff83c0Christian Maeder# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
83394c6b6e6de128e71b67c9251ed7a84485d082Christian Maeder# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
83394c6b6e6de128e71b67c9251ed7a84485d082Christian Maeder# DEALINGS IN THE SOFTWARE.
e7757995211bd395dc79d26fe017d99375f7d2a6Christian Maeder###############################################################################
6a79849bed67264c396dddb3e9c184bdfc1a1bc9Christian Maeder# Choose options for branding, download sites, etc.
63f0e65a37b95621334db9ee4ba0cd9d826f5c0fChristian Maeder# Makefile.options is created as a link to a file containing the desired
8410667510a76409aca9bb24ff0eda0420088274Christian Maeder# options, chosen by the first of these found in open-src/common:
404166b9366552e9ec5abb87a37c76ec8a815fb7Klaus Luettich# 1) Makefile.options.$(X_BUILD_OPTIONS)
eee4b2ee739f163e09d6af6e45c025681e6c01a0Christian Maeder# 2) Makefile.options.<last two components of `domainname`, lowercased>
eee4b2ee739f163e09d6af6e45c025681e6c01a0Christian Maeder @ if [[ -n "${X_BUILD_OPTIONS}" ]] ; then \
eee4b2ee739f163e09d6af6e45c025681e6c01a0Christian Maeder if [[ ! -f "$(MK_OPTS).$${X_BUILD_OPTIONS}" ]] ; then \
eee4b2ee739f163e09d6af6e45c025681e6c01a0Christian Maeder "$(MK_OPTS).$${X_BUILD_OPTIONS} not found" ; \
55adfe57a4de1f36adc3e3bfc16f342e44a7d444Christian Maeder awk -F. '{if (NF > 1) {printf "%s.%s", $$(NF-1), $$NF}}')" ; \
d23b0cc79c0d204e6ec758dff8d0ba71c9f693f7Christian Maeder if [[ ! -f "$(MK_OPTS).$${X_BUILD_OPTIONS}" ]] ; then \
e7757995211bd395dc79d26fe017d99375f7d2a6Christian Maeder print "Choosing build options from $(MK_OPTS).$${X_BUILD_OPTIONS}" ; \
2e2094a642e3775b0d76b890556407941d3a53b6Christian Maeder ln -s "Makefile.options.$${X_BUILD_OPTIONS}" $@
96646aed2ae087b942ae23f15bbe729a8f7c43d3Christian Maeder# install & check are run in each subdir via Makefile.subdirs
e7757995211bd395dc79d26fe017d99375f7d2a6Christian Maeder### Include common definitions
c6fcd42c6d6d9dae8c7835c24fcb7ce8531a9050Christian Maederinclude $(TOP)/open-src/common/Makefile.subdirs
c55a0f77be7e88d3620b419ec8961f4379a586e3Klaus Luettich# Files & directories to include in source release zip files
6a79849bed67264c396dddb3e9c184bdfc1a1bc9Christian MaederZIP_GENERATED_FILES = BUILD_INSTRUCTIONS.txt pkglist.txt
abf2487c3aece95c371ea89ac64319370dcb6483Klaus LuettichZIP_CONTENTS += buildit download-tarballs make_release_packages Makefile
8cacad2a09782249243b80985f28e9387019fe40Christian MaederZIP_CONTENTS += open-src pkg exception_lists
d3ae0072823e2ef0d41d4431fcc768e66489c20eChristian Maeder# Don't include Makefile.options symlink in zipfile, so it gets correctly
9e748851c150e1022fb952bab3315e869aaf0214Christian Maeder# autogenerated for the builder when they first build it
6a79849bed67264c396dddb3e9c184bdfc1a1bc9Christian Maeder ( print 'Oracle Solaris X Consolidation open source release' ; \
6a79849bed67264c396dddb3e9c184bdfc1a1bc9Christian Maeder print -n 'hg id: ' ; hg id -it ) > $(ZIP_COMMENT_FILE)
6a79849bed67264c396dddb3e9c184bdfc1a1bc9Christian Maeder zip -9rqyz proto/x.zip $(ZIP_CONTENTS) -x $(ZIP_EXCLUDE_FILES) \
9e748851c150e1022fb952bab3315e869aaf0214Christian Maeder cd open-src && $(MAKE) $(MAKEFLAGS) $(PASSDOWN_VARS) $(TOP)/$(@)
f1541d4a151dbd08002dbd14e7eb1d5dde253689Christian Maeder cd pkg && $(MAKE) $(MAKEFLAGS) $(PASSDOWN_VARS) $(TOP)/$(@)