Makefile revision c6e808750ddfd0119ee0388c350ebcaf7d4027b7
6c2a76b3e2ccd32c35814b6e0f54da00190749d7Evan Hunt# CDDL HEADER START
c7fd128f8ea8a527fe27c1b95ab46df7155bc8e4Tinderbox User# The contents of this file are subject to the terms of the
c7fd128f8ea8a527fe27c1b95ab46df7155bc8e4Tinderbox User# Common Development and Distribution License (the "License").
ba9e87b35e561bc7354ce3f4b9685b747b7be507Tinderbox User# You may not use this file except in compliance with the License.
59663800d2ec04777dae2791dd92aa563faf94c8Evan Hunt# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1f9754245cbd5eec2d2a667bb292f62f72386d4bMark Andrews# See the License for the specific language governing permissions
59663800d2ec04777dae2791dd92aa563faf94c8Evan Hunt# and limitations under the License.
0726d872f6f36901ea09321df57084614e5bb6faTinderbox User# When distributing Covered Code, include this CDDL HEADER in each
1ca2cf024391992fe14b2df7d3ae0f575d074452Evan Hunt# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
a2c370ca12bb0360ff7e969474ead3f788c65fffTinderbox User# If applicable, add the following below this CDDL HEADER, with the
8de3f14f1c300c3e1ed99084cc03485b42c92bf1Tinderbox User# fields enclosed by brackets "[]" replaced with your own identifying
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# information: Portions Copyright [yyyy] [name of copyright owner]
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User# CDDL HEADER END
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Use is subject to license terms.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# ident "%Z%%M% %I% %E% SMI"
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Note that libcurses installs commands along with its library.
415d630b6309922caee8469384a6fab75cf05032Mark Andrews# This is a minor bug which probably should be fixed.
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews# Note also that a few extra libraries are kept in cmd source.
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews# Certain libraries are linked with, hence depend on, other libraries.
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews# Although we have historically used .WAIT to express dependencies, it
415d630b6309922caee8469384a6fab75cf05032Mark Andrews# reduces the amount of parallelism and thus lengthens the time it
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews# takes to build the libraries. Thus, we now require that any new
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews# libraries explicitly call out their dependencies. Eventually, all
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User# the library dependencies will be called out explicitly. See
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews# "Library interdependencies" near the end of this file.
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews# Aside from explicit dependencies (and legacy .WAITs), all libraries
415d630b6309922caee8469384a6fab75cf05032Mark Andrews# are built in parallel.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# The $(CLOSED_BUILD) additions to SUBDIRS & MSGSUBDIRS are unfortunate,
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt# but required due to the "dependencies" of using .WAIT to barrier the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# parallel dmake builds. once 4631488 has been fixed, they can be
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# consolidated into one $(CLOSED_BUILD)SUBDIRS += (all closed libs) as
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt# shown in HDRSUBDIRS
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Create a special version of $(SUBDIRS) with no .WAIT's, for use with the
361967ea970ea8f0ef8875e769505ecdac74bfb0Tinderbox User# clean and clobber targets (for more information, see those targets, below).
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews# For the all and install targets, we clearly must respect library
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews# dependencies so that the libraries link correctly. However, for
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews# the remaining targets (check, clean, clobber, install_h, lint, _dc
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews# and _msg), libraries do not have any dependencies on one another
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews# and thus respecting dependencies just slows down the build.
ab833877278ad5535eef57e4f62291becaea5bc5Mark Andrews# As such, for these rules, we use pattern replacement to explicitly
3bd8b5a8fb126e45c67ff53b68183c889cc27918Tinderbox User# avoid triggering the dependency information. Note that for clean,
015055b6e23f5c08f6a5b34726f90b62597e9e45Tinderbox User# clobber and lint, we must use $(NOWAIT_SUBDIRS) rather than
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# $(SUBDIRS), to prevent `.WAIT' from expanding to `.WAIT-nodepend'.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# extra libraries kept in other source areas
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrewsclean clobber lint: $(NOWAIT_SUBDIRS:%=%-nodepend)
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews# dependencies for pam_modules (see below)
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User$(CLOSED_BUILD)SMARTCARD= $(CLOSED)/lib/smartcard
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Library interdependencies are called out explicitly here
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrewsgss_mechs/mech_krb5: libgss libnsl libsocket libresolv pkcs11
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonsasl_plugins: pkcs11 libgss libsocket libsasl
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonlibzonecfg: libc libsocket libnsl libuuid libnvpair libsysevent libsec \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonlibproc: ../cmd/sgs/librtld_db ../cmd/sgs/libelf libctf
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonlibwanboot: libnvpair libresolv libnsl libsocket libdevinfo libinetutil \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonpam_modules: libproject passwdutil $(SMARTCARD)
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonlibzfs: libdevinfo libdevid libgen libnvpair libuutil
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# The reason this rule checks for the existence of the
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Makefile is that some of the directories do not exist
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# in certain situations (e.g., exportable source builds,
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# OpenSolaris).
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington @if [ -f $@/Makefile ]; then \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington @if [ -f $(@:%-nodepend=%)/Makefile ]; then \
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews cd $(@:%-nodepend=%); pwd; $(MAKE) $(TARGET); \