Makefile revision fb9f9b975cb9214fec5dab37d461199adab9b964
6825f304c5f0cc2d4ba22fa2b6f7a431f9c1de59Tinderbox User# CDDL HEADER START
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# The contents of this file are subject to the terms of the
4a14ce5ba00ab7bc55c99ffdcf59c7a4ab902721Automatic Updater# Common Development and Distribution License, Version 1.0 only
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# (the "License"). You may not use this file except in compliance
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# with the License.
af5073d03288a53b646ec3b807ac25ced64d7879Mark Andrews# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# See the License for the specific language governing permissions
af5073d03288a53b646ec3b807ac25ced64d7879Mark Andrews# and limitations under the License.
af5073d03288a53b646ec3b807ac25ced64d7879Mark Andrews# When distributing Covered Code, include this CDDL HEADER in each
af5073d03288a53b646ec3b807ac25ced64d7879Mark Andrews# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# If applicable, add the following below this CDDL HEADER, with the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# fields enclosed by brackets "[]" replaced with your own identifying
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# information: Portions Copyright [yyyy] [name of copyright owner]
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# CDDL HEADER END
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Use is subject to license terms.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# ident "%Z%%M% %I% %E% SMI"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Note that libcurses installs commands along with its library.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# This is a minor bug which probably should be fixed.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Note also that a few extra libraries are kept in cmd source.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Certain libraries are linked with, hence depend on, other libraries.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Although we have historically used .WAIT to express dependencies, it
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# reduces the amount of parallelism and thus lengthens the time it
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# takes to build the libraries. Thus, we now require that any new
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# libraries explicitly call out their dependencies. Eventually, all
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# the library dependencies will be called out explicitly. See
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User# "Library interdependencies" near the end of this file.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Aside from explicit dependencies (and legacy .WAITs), all libraries
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User# are built in parallel.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# The $(CLOSED_BUILD) additions to SUBDIRS & MSGSUBDIRS are unfortunate,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# but required due to the "dependencies" of using .WAIT to barrier the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# parallel dmake builds. once 4631488 has been fixed, they can be
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews# consolidated into one $(CLOSED_BUILD)SUBDIRS += (all closed libs) as
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User# shown in HDRSUBDIRS
0eea9763d88e3edf9b6de585f7cfbb08de977124Tinderbox User# Create a special version of $(SUBDIRS) with no .WAIT's, for use with the
0eea9763d88e3edf9b6de585f7cfbb08de977124Tinderbox User# clean and clobber targets (for more information, see those targets, below).
8e16b3078757ba3010c24aef805e9e29ed19518bTinderbox User# For the all and install targets, we clearly must respect library
8e16b3078757ba3010c24aef805e9e29ed19518bTinderbox User# dependencies so that the libraries link correctly. However, for
8e16b3078757ba3010c24aef805e9e29ed19518bTinderbox User# the remaining targets (check, clean, clobber, install_h, lint, _dc
8e16b3078757ba3010c24aef805e9e29ed19518bTinderbox User# and _msg), libraries do not have any dependencies on one another
8e16b3078757ba3010c24aef805e9e29ed19518bTinderbox User# and thus respecting dependencies just slows down the build.
8e16b3078757ba3010c24aef805e9e29ed19518bTinderbox User# As such, for these rules, we use pattern replacement to explicitly
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# avoid triggering the dependency information. Note that for clean,
8e16b3078757ba3010c24aef805e9e29ed19518bTinderbox User# clobber and lint, we must use $(NOWAIT_SUBDIRS) rather than
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# $(SUBDIRS), to prevent `.WAIT' from expanding to `.WAIT-nodepend'.
6bcac4b58d16ee91184a72bd4ff05c41538fd932Tinderbox User# extra libraries kept in other source areas
8e16b3078757ba3010c24aef805e9e29ed19518bTinderbox Userclean clobber lint: $(NOWAIT_SUBDIRS:%=%-nodepend)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# dependencies for pam_modules (see below)
d9f0b06dc2bba47e3fe63afdf41c638d3517ceffTinderbox User$(CLOSED_BUILD)SMARTCARD= $(CLOSED)/lib/smartcard
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Library interdependencies are called out explicitly here
8e16b3078757ba3010c24aef805e9e29ed19518bTinderbox Usergss_mechs/mech_krb5: libgss libnsl libsocket libresolv pkcs11
8e16b3078757ba3010c24aef805e9e29ed19518bTinderbox Userlibwanboot: libnvpair libresolv libnsl libsocket libdevinfo libinetutil \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userpam_modules: libproject passwdutil $(SMARTCARD)
8e16b3078757ba3010c24aef805e9e29ed19518bTinderbox Userlibzfs: libdevinfo libdevid libgen libnvpair libuutil
8e16b3078757ba3010c24aef805e9e29ed19518bTinderbox User# The reason this rule checks for the existence of the
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Makefile is that some of the directories do not exist
8e16b3078757ba3010c24aef805e9e29ed19518bTinderbox User# in certain situations (e.g., exportable source builds,
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# OpenSolaris).
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User @if [ -f $@/Makefile ]; then \
0226754d9e537fd56b690d5890cfe215a6c59f89Tinderbox User @if [ -f $(@:%-nodepend=%)/Makefile ]; then \
0226754d9e537fd56b690d5890cfe215a6c59f89Tinderbox User cd $(@:%-nodepend=%); pwd; $(MAKE) $(TARGET); \