Makefile revision dbed73cbda2229fd1aa6dc5743993cae7f0a7ee9
cd348e325366620fe047edcc849e3c9424828599Peter Bray# CDDL HEADER START
cd348e325366620fe047edcc849e3c9424828599Peter Bray# The contents of this file are subject to the terms of the
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# Common Development and Distribution License (the "License").
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# You may not use this file except in compliance with the License.
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray# See the License for the specific language governing permissions
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# and limitations under the License.
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# When distributing Covered Code, include this CDDL HEADER in each
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray# If applicable, add the following below this CDDL HEADER, with the
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray# fields enclosed by brackets "[]" replaced with your own identifying
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# information: Portions Copyright [yyyy] [name of copyright owner]
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# CDDL HEADER END
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# Use is subject to license terms.
cd71fb134e037849c77364b50940b1870c4684ceVladimir Kotal# Note that libcurses installs commands along with its library.
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# This is a minor bug which probably should be fixed.
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# Note also that a few extra libraries are kept in cmd source.
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# Certain libraries are linked with, hence depend on, other libraries.
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal# Although we have historically used .WAIT to express dependencies, it
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal# reduces the amount of parallelism and thus lengthens the time it
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# takes to build the libraries. Thus, we now require that any new
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray# libraries explicitly call out their dependencies. Eventually, all
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal# the library dependencies will be called out explicitly. See
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal# "Library interdependencies" near the end of this file.
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal# Aside from explicit dependencies (and legacy .WAITs), all libraries
b17cb0705d90907337b3528aa7b8ed1700806f26Vladimir Kotal# are built in parallel.
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal# The $(CLOSED_BUILD) additions to SUBDIRS & MSGSUBDIRS are unfortunate,
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal# but required due to the "dependencies" of using .WAIT to barrier the
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal# parallel dmake builds. once 4631488 has been fixed, they can be
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal# consolidated into one $(CLOSED_BUILD)SUBDIRS += (all closed libs) as
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal# shown in HDRSUBDIRS
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray# Create a special version of $(SUBDIRS) with no .WAIT's, for use with the
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray# clean and clobber targets (for more information, see those targets, below).
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# For the all and install targets, we clearly must respect library
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# dependencies so that the libraries link correctly. However, for
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# the remaining targets (check, clean, clobber, install_h, lint, _dc
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# and _msg), libraries do not have any dependencies on one another
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# and thus respecting dependencies just slows down the build.
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# As such, for these rules, we use pattern replacement to explicitly
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# avoid triggering the dependency information. Note that for clean,
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# clobber and lint, we must use $(NOWAIT_SUBDIRS) rather than
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# $(SUBDIRS), to prevent `.WAIT' from expanding to `.WAIT-nodepend'.
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# extra libraries kept in other source areas
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Brayclean clobber lint: $(NOWAIT_SUBDIRS:%=%-nodepend)
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# Library interdependencies are called out explicitly here
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Braygss_mechs/mech_krb5: libgss libnsl libsocket libresolv pkcs11
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Braylibdhcpagent: libsocket libdhcputil libuuid libdlpi libcontract
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Braylibdladm: libdevinfo libinetutil libsocket libscf librcm libnvpair \
56d93b0c761868f813ac0bc0b5bc21a7a9fefd89Vladimir Kotallibiscsit: libc libnvpair libstmf libuuid libnsl
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Braylibrdc: libsocket libnsl libnsctl libunistat libdscfg
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Braylibsldap: libldap5 libtsol libnsl libc libscf libresolv
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Braylibzonecfg: libc libsocket libnsl libuuid libnvpair libsysevent libsec \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Braylibproc: ../cmd/sgs/librtld_db ../cmd/sgs/libelf libctf
56d93b0c761868f813ac0bc0b5bc21a7a9fefd89Vladimir Kotallibwanboot: libnvpair libresolv libnsl libsocket libdevinfo libinetutil \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Braylibzfs: libdevinfo libdevid libgen libnvpair libuutil libiscsitgt \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Braylibshare: libscf libzfs libuuid libfsmgt libsecdb libumem libsmbfs
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Braylibexacct/demo: libexacct libproject libsocket libnsl
0b2998be561e7bf5e3479d686a5af36f712b0d9aVladimir Kotalsmbsrv: libsocket libnsl libmd libxnet libpthread librt \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Braympapi: libpthread libdevinfo libsysevent libnvpair
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# The reason this rule checks for the existence of the
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# Makefile is that some of the directories do not exist
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# in certain situations (e.g., exportable source builds,
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# OpenSolaris).
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray @if [ -f $@/Makefile ]; then \