Makefile revision 1195
fb0951b02ebf51a93acf12721d8857d31ce57ba3Lennart Poettering# Makefile for X Consolidation
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering#
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers#
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers# Permission is hereby granted, free of charge, to any person obtaining a
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# copy of this software and associated documentation files (the "Software"),
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# to deal in the Software without restriction, including without limitation
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering# the rights to use, copy, modify, merge, publish, distribute, sublicense,
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering# and/or sell copies of the Software, and to permit persons to whom the
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# Software is furnished to do so, subject to the following conditions:
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering#
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# The above copyright notice and this permission notice (including the next
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# paragraph) shall be included in all copies or substantial portions of the
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# Software.
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering#
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
4e949c11a1df4547d5f102e4131e07b026369cd7Javier Jardón# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
4e949c11a1df4547d5f102e4131e07b026369cd7Javier Jardón# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
4e949c11a1df4547d5f102e4131e07b026369cd7Javier Jardón# DEALINGS IN THE SOFTWARE.
561471314c1a55660063467422509352192e3408Lennart Poettering#
1a435084b7f55bc24042f9bc47c18e4e2381f667Kay Sievers#
4e949c11a1df4547d5f102e4131e07b026369cd7Javier Jardón###############################################################################
4e949c11a1df4547d5f102e4131e07b026369cd7Javier Jardón#
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering
78a825f216d39ee0295b00647b059d45467e1d02Kay SieversPWD:sh=pwd
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart PoetteringTOP=$(PWD)
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering
a80db8bd5f7f15859e8891aab9fc3694ce4cd0bdJavier JardónOS_SUBDIRS_common = open-src pkg
a80db8bd5f7f15859e8891aab9fc3694ce4cd0bdJavier JardónOS_SUBDIRS_sparc = $(OS_SUBDIRS_common)
4db6d587c37c0357d20c79bf1a7c9afd4c7ced61Kay SieversOS_SUBDIRS_i386 = $(OS_SUBDIRS_common)
907dd1953b7517534d646f5b2777780020c896e2Kay Sievers
eb7bbee6cd182d5c4eb1e1180631c35158f59379Kay Sieversall: setup install check
6aad7f2cd75c88f990c7857bb173b3e8d0faee0fUmut Tezduyar Lindskog
91ca5bf0b6f3b487a16cc262527c9de6744db624Martin Pittsetup: open-src/common/Makefile.options
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# Choose options for branding, download sites, etc.
22be093ffb403a1c474037939ca9b88b1ee39f77Lennart Poettering# Makefile.options is created as a link to a file containing the desired
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers# options, chosen by the first of these found in open-src/common:
8666abb452db73d9a11ead61251eec42bc531cceKay Sievers# 1) Makefile.options.$(X_BUILD_OPTIONS)
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering# 2) Makefile.options.<last two components of `domainname`, lowercased>
5e63ce78b5018ba612e794a610a6f13c5eefade7Cristian Rodríguez# 3) Makefile.options.opensolaris
3d585edbb14b9705c80183aeb16dfd0a28df0ac9Lennart PoetteringMK_OPTS = open-src/common/Makefile.options
5e63ce78b5018ba612e794a610a6f13c5eefade7Cristian Rodríguez
0fa2cac4f0cdefaf1addd7f1fe0fd8113db9360bKay Sievers$(MK_OPTS):
0fa2cac4f0cdefaf1addd7f1fe0fd8113db9360bKay Sievers @ if [[ -n "${X_BUILD_OPTIONS}" ]] ; then \
0fa2cac4f0cdefaf1addd7f1fe0fd8113db9360bKay Sievers X_BUILD_OPTIONS="${X_BUILD_OPTIONS}" ; \
4c6abc93c708762ae3f377eab8dbd357262cc432Koen Kooi if [[ ! -f "$(MK_OPTS).$${X_BUILD_OPTIONS}" ]] ; then \
f15515b5e6a9ebe95c938cc670df6e576fcf9176Filipe Brandenburger print -u2 "Invalid X_BUILD_OPTIONS: " \
0fa2cac4f0cdefaf1addd7f1fe0fd8113db9360bKay Sievers "$(MK_OPTS).$${X_BUILD_OPTIONS} not found" ; \
f15515b5e6a9ebe95c938cc670df6e576fcf9176Filipe Brandenburger exit 1 ; \
f15515b5e6a9ebe95c938cc670df6e576fcf9176Filipe Brandenburger fi \
f15515b5e6a9ebe95c938cc670df6e576fcf9176Filipe Brandenburger else \
f15515b5e6a9ebe95c938cc670df6e576fcf9176Filipe Brandenburger X_BUILD_OPTIONS="$$(domainname | \
f15515b5e6a9ebe95c938cc670df6e576fcf9176Filipe Brandenburger awk -F. '{if (NF > 1) {printf "%s.%s", $$(NF-1), $$NF}}')" ; \
f15515b5e6a9ebe95c938cc670df6e576fcf9176Filipe Brandenburger typeset -l X_BUILD_OPTIONS ; \
f15515b5e6a9ebe95c938cc670df6e576fcf9176Filipe Brandenburger if [[ ! -f "$(MK_OPTS).$${X_BUILD_OPTIONS}" ]] ; then \
f15515b5e6a9ebe95c938cc670df6e576fcf9176Filipe Brandenburger X_BUILD_OPTIONS='opensolaris' ; \
f15515b5e6a9ebe95c938cc670df6e576fcf9176Filipe Brandenburger fi \
f15515b5e6a9ebe95c938cc670df6e576fcf9176Filipe Brandenburger fi ; \
2f96919bcdd0978164c801b21e053fb3b31e8bacFilipe Brandenburger print "Choosing build options from $(MK_OPTS).$${X_BUILD_OPTIONS}" ; \
a59f16ce4a11c440cb2136ad3d5e3184714c545eRobert Schiele rm -f $@ ; \
2f96919bcdd0978164c801b21e053fb3b31e8bacFilipe Brandenburger ln -s "Makefile.options.$${X_BUILD_OPTIONS}" $@
1c7dde3e475978c569a982d65fd86d4b4e3caad8Bastien Nocera
2f96919bcdd0978164c801b21e053fb3b31e8bacFilipe Brandenburger# install & check are run in each subdir via Makefile.subdirs
2f96919bcdd0978164c801b21e053fb3b31e8bacFilipe Brandenburger
2f96919bcdd0978164c801b21e053fb3b31e8bacFilipe Brandenburger### Include common definitions
2f96919bcdd0978164c801b21e053fb3b31e8bacFilipe BrandenburgerDIRNAME=""
2f96919bcdd0978164c801b21e053fb3b31e8bacFilipe Brandenburgerinclude $(TOP)/open-src/common/Makefile.subdirs
2f96919bcdd0978164c801b21e053fb3b31e8bacFilipe Brandenburger