Makefile revision 1cb875ae88fb9463b368e725c2444776595895cb
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").
1f9754245cbd5eec2d2a667bb292f62f72386d4bMark Andrews# You may not use this file except in compliance with the License.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
59663800d2ec04777dae2791dd92aa563faf94c8Evan Hunt# See the License for the specific language governing permissions
1ca2cf024391992fe14b2df7d3ae0f575d074452Evan Hunt# and limitations under the License.
1ca2cf024391992fe14b2df7d3ae0f575d074452Evan Hunt# When distributing Covered Code, include this CDDL HEADER in each
a2c370ca12bb0360ff7e969474ead3f788c65fffTinderbox User# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
8de3f14f1c300c3e1ed99084cc03485b42c92bf1Tinderbox User# If applicable, add the following below this CDDL HEADER, with the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# fields enclosed by brackets "[]" replaced with your own identifying
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# information: Portions Copyright [yyyy] [name of copyright owner]
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# CDDL HEADER END
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
b91d11bfcc30b96f2c80f3a76d12e3dcc8597a68Mark Andrews# Use is subject to license terms.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Note that libcurses installs commands along with its library.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# This is a minor bug which probably should be fixed.
415d630b6309922caee8469384a6fab75cf05032Mark Andrews# Note also that a few extra libraries are kept in cmd source.
415d630b6309922caee8469384a6fab75cf05032Mark Andrews# Certain libraries are linked with, hence depend on, other libraries.
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User# Although we have historically used .WAIT to express dependencies, it
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews# reduces the amount of parallelism and thus lengthens the time it
415d630b6309922caee8469384a6fab75cf05032Mark Andrews# takes to build the libraries. Thus, we now require that any new
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews# libraries explicitly call out their dependencies. Eventually, all
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews# the library dependencies will be called out explicitly. See
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User# "Library interdependencies" near the end of this file.
415d630b6309922caee8469384a6fab75cf05032Mark Andrews# Aside from explicit dependencies (and legacy .WAITs), all libraries
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews# are built in parallel.
015055b6e23f5c08f6a5b34726f90b62597e9e45Tinderbox User# The $(CLOSED_BUILD) additions to SUBDIRS & MSGSUBDIRS are unfortunate,
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# but required due to the "dependencies" of using .WAIT to barrier the
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt# parallel dmake builds. once 4631488 has been fixed, they can be
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# consolidated into one $(CLOSED_BUILD)SUBDIRS += (all closed libs) as
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# shown in HDRSUBDIRS
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Create a special version of $(SUBDIRS) with no .WAIT's, for use with the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# clean and clobber targets (for more information, see those targets, below).
ae7e54b14c946e0984c191554db9abb4893f9349Automatic Updater# For the all and install targets, we clearly must respect library
ae7e54b14c946e0984c191554db9abb4893f9349Automatic Updater# dependencies so that the libraries link correctly. However, for
b30ec46fec40a1b246f7965fbcd341fc6cfd1cc1Mark Andrews# the remaining targets (check, clean, clobber, install_h, lint, _dc
c11c7b47726c02eb05e29ff7be56a3343146e396Tinderbox User# and _msg), libraries do not have any dependencies on one another
c11c7b47726c02eb05e29ff7be56a3343146e396Tinderbox User# and thus respecting dependencies just slows down the build.
c11c7b47726c02eb05e29ff7be56a3343146e396Tinderbox User# As such, for these rules, we use pattern replacement to explicitly
c11c7b47726c02eb05e29ff7be56a3343146e396Tinderbox User# avoid triggering the dependency information. Note that for clean,
c11c7b47726c02eb05e29ff7be56a3343146e396Tinderbox User# clobber and lint, we must use $(NOWAIT_SUBDIRS) rather than
c11c7b47726c02eb05e29ff7be56a3343146e396Tinderbox User# $(SUBDIRS), to prevent `.WAIT' from expanding to `.WAIT-nodepend'.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# extra libraries kept in other source areas
c11c7b47726c02eb05e29ff7be56a3343146e396Tinderbox Userclean clobber lint: $(NOWAIT_SUBDIRS:%=%-nodepend)
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Library interdependencies are called out explicitly here
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrewsgss_mechs/mech_krb5: libgss libnsl libsocket libresolv pkcs11
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrewslibdhcpagent: libsocket libdhcputil libuuid libdlpi libcontract
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrewslibdladm: libdevinfo libinetutil libsocket libscf librcm libnvpair \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonlibidmap: libadutils libldap5 libavl libsldap
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonlibiscsit: libc libnvpair libstmf libuuid libnsl
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonlibrdc: libsocket libnsl libnsctl libunistat libdscfg
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonsasl_plugins: pkcs11 libgss libsocket libsasl
7adcb4de92bf4383a4c5624c4ed256736d02bc6dMark Andrewslibshell: libast libcmd libdll libsocket libsecdb
415d630b6309922caee8469384a6fab75cf05032Mark Andrewslibstmfproxy: libstmf libsocket libnsl libpthread
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrewslibsldap: libldap5 libtsol libnsl libc libscf libresolv
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrewslibzonecfg: libc libsocket libnsl libuuid libnvpair libsysevent libsec \
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrewslibproc: ../cmd/sgs/librtld_db ../cmd/sgs/libelf libctf
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrewslibwanboot: libnvpair libresolv libnsl libsocket libdevinfo libinetutil \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonlibzfs: libdevid libgen libnvpair libuutil libiscsitgt \
b7aab05edae933e169d5f83c653935b17c7f0a8bMark Andrewslibshare: libscf libzfs libuuid libfsmgt libsecdb libumem libsmbfs
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonlibexacct/demo: libexacct libproject libsocket libnsl
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonsmbsrv: libsocket libnsl libmd libxnet libpthread librt \
7adcb4de92bf4383a4c5624c4ed256736d02bc6dMark Andrewsmpapi: libpthread libdevinfo libsysevent libnvpair
9218b940febade3085fd6d95a15e67d5f94833f0Tinderbox User# The reason this rule checks for the existence of the
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews# 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 \
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews cd $(@:%-nodepend=%); pwd; $(MAKE) $(TARGET); \