make-rules/shared-macros.mk
author Norm Jacobs <Norm.Jacobs@Sun.COM>
Thu, 02 Sep 2010 11:07:22 -0500
changeset 32 280a7444e782
parent 31 90e0c3ea3281
child 34 d20b10eba317
permissions -rw-r--r--
automatically generate intercomponent dependencies for build ordering automatically generate component requirements for build environment construction add missing component dependencies add libmng for dependency validation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     1
#
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     2
# CDDL HEADER START
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     3
#
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     4
# The contents of this file are subject to the terms of the
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     5
# Common Development and Distribution License (the "License").
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     6
# You may not use this file except in compliance with the License.
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     7
#
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     8
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
     9
# or http://www.opensolaris.org/os/licensing.
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    10
# See the License for the specific language governing permissions
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    11
# and limitations under the License.
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    12
#
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    13
# When distributing Covered Code, include this CDDL HEADER in each
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    14
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    15
# If applicable, add the following below this CDDL HEADER, with the
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    16
# fields enclosed by brackets "[]" replaced with your own identifying
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    17
# information: Portions Copyright [yyyy] [name of copyright owner]
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    18
#
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    19
# CDDL HEADER END
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    20
#
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    21
# Copyright (c) 2010, Oracle and/or it's affiliates.  All rights reserved.
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    22
#
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    23
32
280a7444e782 automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 31
diff changeset
    24
PATH=/usr/bin:/usr/gnu/bin
280a7444e782 automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 31
diff changeset
    25
2
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    26
CONSOLIDATION =	userland
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    27
PUBLISHER =	$(CONSOLIDATION)-build
26
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 16
diff changeset
    28
29
eb4177698749 Generate the build number from the most recent mercurial tag
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 26
diff changeset
    29
# get the most recent build number from the last mercurial tag
eb4177698749 Generate the build number from the most recent mercurial tag
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 26
diff changeset
    30
LAST_HG_TAG =	$(shell hg tags -q | head -2 | tail -1)
eb4177698749 Generate the build number from the most recent mercurial tag
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 26
diff changeset
    31
LAST_BUILD_NUM = $(LAST_HG_TAG:build-%=%)
eb4177698749 Generate the build number from the most recent mercurial tag
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 26
diff changeset
    32
26
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 16
diff changeset
    33
OS_VERSION =		$(shell uname -r)
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 16
diff changeset
    34
SOLARIS_VERSION =	$(OS_VERSION:5.%=2.%)
29
eb4177698749 Generate the build number from the most recent mercurial tag
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 26
diff changeset
    35
BUILD_NUM =		0.$(shell expr $(LAST_BUILD_NUM) + 1)
26
8a9f4e791832 packaging changes including canonical manifest support with manifest validation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 16
diff changeset
    36
BUILD_VERSION =		$(OS_VERSION)-$(BUILD_NUM)
2
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    37
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    38
COMPILER =		studio
6
20f80c019d73 add compiler date/time chatter reduction tools
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 2
diff changeset
    39
BITS =			32
2
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    40
PYTHON_VERSION =	2.6
31
90e0c3ea3281 Implement support for builds with multiple versions of python.
Danek Duvall <danek.duvall@oracle.com>
parents: 29
diff changeset
    41
PYTHON_VERSIONS =	2.4 2.6
2
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    42
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    43
TOOLS =		$(WS_TOP)/tools
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    44
WS_LOGS =	$(WS_TOP)/logs
32
280a7444e782 automatically generate intercomponent dependencies for build ordering
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 31
diff changeset
    45
MAKE_RULES =	$(WS_TOP)/make-rules
2
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    46
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    47
PKG_REPO =	file://$(WS_TOP)/repo
12
41aeb1fd8c2d Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 7
diff changeset
    48
PROTO_DIR =	$(shell pwd)/$(COMPONENT_SRC)/installed-prototype-$(MACH)
2
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    49
16
33aaaec59991 update _DATE/_TIME compiler chatter reduction bits.
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 12
diff changeset
    50
# work around _TIME, _DATE, embedded date chatter in component builds
33aaaec59991 update _DATE/_TIME compiler chatter reduction bits.
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 12
diff changeset
    51
# to use, set TIME_CONSTANT in the component Makefile and add $(CONSTANT_TIME)
33aaaec59991 update _DATE/_TIME compiler chatter reduction bits.
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 12
diff changeset
    52
# to the appropriate {CONFIGURE|BUILD|INSTALL}_ENV
33aaaec59991 update _DATE/_TIME compiler chatter reduction bits.
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 12
diff changeset
    53
CONSTANT_TIME =		LD_PRELOAD_32=$(TOOLS)/time-$(MACH32).so
33aaaec59991 update _DATE/_TIME compiler chatter reduction bits.
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 12
diff changeset
    54
CONSTANT_TIME +=	LD_PRELOAD_64=$(TOOLS)/time-$(MACH64).so
33aaaec59991 update _DATE/_TIME compiler chatter reduction bits.
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 12
diff changeset
    55
CONSTANT_TIME +=	TIME_CONSTANT=$(TIME_CONSTANT)
6
20f80c019d73 add compiler date/time chatter reduction tools
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 2
diff changeset
    56
12
41aeb1fd8c2d Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 7
diff changeset
    57
# set MACH from uname -p to either sparc or i386
41aeb1fd8c2d Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 7
diff changeset
    58
MACH =		$(shell uname -p)
41aeb1fd8c2d Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 7
diff changeset
    59
41aeb1fd8c2d Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 7
diff changeset
    60
# set MACH32 from MACH to either sparcv7 or i86
41aeb1fd8c2d Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 7
diff changeset
    61
MACH32_1 =	$(MACH:sparc=sparcv7)
41aeb1fd8c2d Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 7
diff changeset
    62
MACH32 =	$(MACH32_1:i386=i86)
41aeb1fd8c2d Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 7
diff changeset
    63
41aeb1fd8c2d Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 7
diff changeset
    64
# set MACH64 from MACH to either sparcv9 or amd64
41aeb1fd8c2d Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 7
diff changeset
    65
MACH64_1 =	$(MACH:sparc=sparcv9)
41aeb1fd8c2d Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 7
diff changeset
    66
MACH64 =	$(MACH64_1:i386=amd64)
41aeb1fd8c2d Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 7
diff changeset
    67
41aeb1fd8c2d Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 7
diff changeset
    68
BUILD_32 =		$(COMPONENT_SRC)/build-$(MACH32)/.built
41aeb1fd8c2d Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 7
diff changeset
    69
BUILD_64 =		$(COMPONENT_SRC)/build-$(MACH64)/.built
41aeb1fd8c2d Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 7
diff changeset
    70
BUILD_32_and_64 =	$(BUILD_32) $(BUILD_64)
41aeb1fd8c2d Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 7
diff changeset
    71
41aeb1fd8c2d Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 7
diff changeset
    72
INSTALL_32 =		$(COMPONENT_SRC)/build-$(MACH32)/.installed
41aeb1fd8c2d Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 7
diff changeset
    73
INSTALL_64 =		$(COMPONENT_SRC)/build-$(MACH64)/.installed
41aeb1fd8c2d Fix MACH32/MACH64 so more than one architecture can build in the same workspace
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 7
diff changeset
    74
INSTALL_32_and_64 =	$(INSTALL_32) $(INSTALL_64)
2
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    75
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    76
SPRO_ROOT =	/opt/sunstudio12.1
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    77
GCC_ROOT =	/usr/gnu
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    78
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    79
CC.studio.32 =	$(SPRO_ROOT)/bin/cc -m32
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    80
CCC.studio.32 =	$(SPRO_ROOT)/bin/CC -m32
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    81
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    82
CC.studio.64 =	$(SPRO_ROOT)/bin/cc -m64
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    83
CCC.studio.64 =	$(SPRO_ROOT)/bin/CC -m64
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    84
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    85
CC.gcc.32 =	$(GCC_ROOT)/bin/cc -m32
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    86
CCC.gcc.32 =	$(GCC_ROOT)/bin/CC -m32
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    87
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    88
CC.gcc.64 =	$(GCC_ROOT)/bin/cc -m64
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    89
CCC.gcc.64 =	$(GCC_ROOT)/bin/CC -m64
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    90
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    91
CC =		$(CC.$(COMPILER).$(BITS))
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    92
CCC =		$(CCC.$(COMPILER).$(BITS))
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    93
16
33aaaec59991 update _DATE/_TIME compiler chatter reduction bits.
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 12
diff changeset
    94
LD =		/usr/bin/ld
33aaaec59991 update _DATE/_TIME compiler chatter reduction bits.
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 12
diff changeset
    95
2
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    96
PYTHON.2.4.32 =	/usr/bin/python2.4
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    97
PYTHON.2.4.64 =	/usr/bin/amd64/python2.4
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    98
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
    99
PYTHON.2.6.32 =	/usr/bin/python2.6
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   100
PYTHON.2.6.64 =	/usr/bin/amd64/python2.6
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   101
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   102
PYTHON.32 =	$(PYTHON.$(PYTHON_VERSION).$(BITS))
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   103
PYTHON.64 =	$(PYTHON.$(PYTHON_VERSION).$(BITS))
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   104
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   105
GMAKE =		/usr/gnu/bin/make
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   106
GPATCH =	/usr/gnu/bin/patch
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   107
GPATCH_FLAGS =	-p1 -b
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   108
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   109
PKGSEND =	/usr/bin/pkgsend
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   110
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   111
TOUCH =		/usr/bin/touch
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   112
MKDIR =		/bin/mkdir -p
125cd5d2cd9e include gmake example
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents:
diff changeset
   113
RM =		/bin/rm -f
7
d42300cb8715 add license/copyright info for ips generation
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 6
diff changeset
   114
CP =		/bin/cp -f
16
33aaaec59991 update _DATE/_TIME compiler chatter reduction bits.
Norm Jacobs <Norm.Jacobs@Sun.COM>
parents: 12
diff changeset
   115
ENV =		/usr/bin/env