Makefile
author henryzh <henry.zhao@oracle.com>
Tue, 24 Feb 2015 18:57:01 -0800
changeset 1510 ef06e61b3a1f
parent 1479 4a76cf532c2c
child 1533 ad1b269b27ae
permissions -rw-r--r--
20441798 Fix parfait errors for dsession
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1003
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     1
# Makefile for X Consolidation
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     2
#
1479
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1003
diff changeset
     3
# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
1003
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     4
#
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     5
# Permission is hereby granted, free of charge, to any person obtaining a
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     6
# copy of this software and associated documentation files (the "Software"),
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     7
# to deal in the Software without restriction, including without limitation
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     8
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
     9
# and/or sell copies of the Software, and to permit persons to whom the
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    10
# Software is furnished to do so, subject to the following conditions:
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    11
#
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    12
# The above copyright notice and this permission notice (including the next
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    13
# paragraph) shall be included in all copies or substantial portions of the
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    14
# Software.
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    15
#
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    16
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    17
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    18
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    19
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    20
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    21
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    22
# DEALINGS IN THE SOFTWARE.
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    23
#
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    24
#
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    25
###############################################################################
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    26
#
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    27
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    28
PWD:sh=pwd
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    29
TOP=$(PWD)
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    30
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    31
OS_SUBDIRS_common = open-src pkg
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    32
OS_SUBDIRS_sparc = $(OS_SUBDIRS_common)
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    33
OS_SUBDIRS_i386 = $(OS_SUBDIRS_common)
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    34
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    35
all: setup install check
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    36
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    37
# Choose options for branding, download sites, etc.
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    38
# Makefile.options is created as a link to a file containing the desired
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    39
# options, chosen by the first of these found in open-src/common:
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    40
#	1) Makefile.options.$(X_BUILD_OPTIONS)
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    41
#	2) Makefile.options.<last two components of `domainname`, lowercased>
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    42
#	3) Makefile.options.opensolaris
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    43
MK_OPTS = open-src/common/Makefile.options
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    44
1479
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1003
diff changeset
    45
setup: $(MK_OPTS)
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1003
diff changeset
    46
1003
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    47
$(MK_OPTS):
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    48
	@ if [[ -n "${X_BUILD_OPTIONS}" ]] ; then \
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    49
	    X_BUILD_OPTIONS="${X_BUILD_OPTIONS}" ; \
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    50
	    if [[ ! -f "$(MK_OPTS).$${X_BUILD_OPTIONS}" ]] ; then \
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    51
		print -u2 "Invalid X_BUILD_OPTIONS: " \
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    52
			"$(MK_OPTS).$${X_BUILD_OPTIONS} not found" ; \
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    53
		exit 1 ; \
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    54
	    fi \
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    55
	else \
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    56
	    X_BUILD_OPTIONS="$$(domainname | \
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    57
		awk -F. '{if (NF > 1) {printf "%s.%s", $$(NF-1), $$NF}}')" ; \
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    58
	    typeset -l X_BUILD_OPTIONS ; \
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    59
	    if [[ ! -f "$(MK_OPTS).$${X_BUILD_OPTIONS}" ]] ; then \
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    60
		X_BUILD_OPTIONS='opensolaris' ; \
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    61
	    fi \
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    62
	fi ; \
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    63
	print "Choosing build options from $(MK_OPTS).$${X_BUILD_OPTIONS}" ; \
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    64
	rm -f $@ ; \
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    65
	ln -s "Makefile.options.$${X_BUILD_OPTIONS}" $@
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    66
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    67
# install & check are run in each subdir via Makefile.subdirs 
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    68
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    69
### Include common definitions
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    70
DIRNAME=""
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
diff changeset
    71
include $(TOP)/open-src/common/Makefile.subdirs
1479
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1003
diff changeset
    72
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1003
diff changeset
    73
# Files & directories to include in source release zip files
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1003
diff changeset
    74
ZIP_GENERATED_FILES = BUILD_INSTRUCTIONS.txt pkglist.txt
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1003
diff changeset
    75
ZIP_CONTENTS  = $(ZIP_GENERATED_FILES)
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1003
diff changeset
    76
ZIP_CONTENTS += buildit download-tarballs make_release_packages Makefile
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1003
diff changeset
    77
ZIP_CONTENTS += open-src pkg exception_lists
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1003
diff changeset
    78
ZIP_CONTENTS += .hg .hgignore .hgtags 
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1003
diff changeset
    79
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1003
diff changeset
    80
ZIP_COMMENT_FILE = proto/x.zipcomment
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1003
diff changeset
    81
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1003
diff changeset
    82
# Don't include Makefile.options symlink in zipfile, so it gets correctly
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1003
diff changeset
    83
# autogenerated for the builder when they first build it
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1003
diff changeset
    84
ZIP_EXCLUDE_FILES = $(MK_OPTS)
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1003
diff changeset
    85
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1003
diff changeset
    86
proto/x.zip: $(ZIP_GENERATED_FILES)
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1003
diff changeset
    87
	-rm -f proto/x.zip
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1003
diff changeset
    88
	( print 'Oracle Solaris X Consolidation open source release' ; \
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1003
diff changeset
    89
	  LC_ALL=en_US.UTF-8 date ; \
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1003
diff changeset
    90
	  print -n 'hg id: ' ; hg id -it ) > $(ZIP_COMMENT_FILE)
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1003
diff changeset
    91
	zip -9rqyz proto/x.zip $(ZIP_CONTENTS) -x $(ZIP_EXCLUDE_FILES) \
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1003
diff changeset
    92
	  < $(ZIP_COMMENT_FILE)
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1003
diff changeset
    93
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1003
diff changeset
    94
BUILD_INSTRUCTIONS.txt:
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1003
diff changeset
    95
	cd open-src && $(MAKE) $(MAKEFLAGS) $(PASSDOWN_VARS) $(TOP)/$(@)
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1003
diff changeset
    96
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1003
diff changeset
    97
pkglist.txt:
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1003
diff changeset
    98
	cd pkg && $(MAKE) $(MAKEFLAGS) $(PASSDOWN_VARS) $(TOP)/$(@)