Makefile revision 5fbacb6048c95ef1fe242a6a164168d2624111da
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 (the "License").
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# You may not use this file except in compliance with the License.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
af5073d03288a53b646ec3b807ac25ced64d7879Mark Andrews# See the License for the specific language governing permissions
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# 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.
af5073d03288a53b646ec3b807ac25ced64d7879Mark Andrews# If applicable, add the following below this CDDL HEADER, with the
fb84f9014321c5f33c4682de5661b579fcde318fAndreas Gustafsson# fields enclosed by brackets "[]" replaced with your own identifying
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# information: Portions Copyright [yyyy] [name of copyright owner]
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# CDDL HEADER END
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Use is subject to license terms.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Note that libcurses installs commands along with its library.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# This is a minor bug which probably should be fixed.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# 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
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# takes to build the libraries. Thus, we now require that any new
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# libraries explicitly call out their dependencies. Eventually, all
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# the library dependencies will be called out explicitly. See
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# "Library interdependencies" near the end of this file.
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User# Aside from explicit dependencies (and legacy .WAITs), all libraries
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# are built in parallel.
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User# 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
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# consolidated into one $(CLOSED_BUILD)SUBDIRS += (all closed libs) as
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# shown in HDRSUBDIRS
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Create a special version of $(SUBDIRS) with no .WAIT's, for use with the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# clean and clobber targets (for more information, see those targets, below).
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# For the all and install targets, we clearly must respect library
8e16b3078757ba3010c24aef805e9e29ed19518bTinderbox User# dependencies so that the libraries link correctly. However, for
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox 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.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# As such, for these rules, we use pattern replacement to explicitly
8e16b3078757ba3010c24aef805e9e29ed19518bTinderbox User# avoid triggering the dependency information. Note that for clean,
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# clobber and lint, we must use $(NOWAIT_SUBDIRS) rather than
8e16b3078757ba3010c24aef805e9e29ed19518bTinderbox User# $(SUBDIRS), to prevent `.WAIT' from expanding to `.WAIT-nodepend'.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# extra libraries kept in other source areas
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox Userclean clobber lint: $(NOWAIT_SUBDIRS:%=%-nodepend)
77dccf2a5d9327d16b4374a135cdb99bdd48620eAutomatic Updaterinstall_h check: $(HDRSUBDIRS:%=%-nodepend)
8e16b3078757ba3010c24aef805e9e29ed19518bTinderbox User# Library interdependencies are called out explicitly here
8e16b3078757ba3010c24aef805e9e29ed19518bTinderbox Usergss_mechs/mech_krb5: libgss libnsl libsocket libresolv pkcs11
8e16b3078757ba3010c24aef805e9e29ed19518bTinderbox Userlibadutils: libldap5 libresolv libsocket libnsl
8e16b3078757ba3010c24aef805e9e29ed19518bTinderbox Userlibdhcpagent: libsocket libdhcputil libuuid libdlpi libcontract
78ec962d9828200d18cd0e41b7d6b9792a74923dTinderbox Userlibdhcputil: libnsl libgen libinetutil libdlpi
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userlibdladm: libdevinfo libinetutil libsocket libscf librcm libnvpair \
78ec962d9828200d18cd0e41b7d6b9792a74923dTinderbox Userlibdscfg: libnsctl libunistat libsocket libnsl
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userlibiscsit: libc libnvpair libstmf libuuid libnsl
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userlibrdc: libsocket libnsl libnsctl libunistat libdscfg
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User$(CLOSED_BUILD)libike: libipsecutil libxnet libcryptoutil
8e16b3078757ba3010c24aef805e9e29ed19518bTinderbox Userlibshell: libast libcmd libdll libsocket libsecdb
8e16b3078757ba3010c24aef805e9e29ed19518bTinderbox Userlibstmfproxy: libstmf libsocket libnsl libpthread
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userlibsldap: libldap5 libtsol libnsl libc libscf libresolv
8e16b3078757ba3010c24aef805e9e29ed19518bTinderbox Userlibzonecfg: libc libsocket libnsl libuuid libnvpair libsysevent libsec \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userlibproc: ../cmd/sgs/librtld_db ../cmd/sgs/libelf libctf
6825f304c5f0cc2d4ba22fa2b6f7a431f9c1de59Tinderbox Userlibwanboot: libnvpair libresolv libnsl libsocket libdevinfo libinetutil \
8e16b3078757ba3010c24aef805e9e29ed19518bTinderbox Userlibzfs: libdevid libgen libnvpair libuutil libiscsitgt \
8e16b3078757ba3010c24aef805e9e29ed19518bTinderbox Userlibshare: libscf libzfs libuuid libfsmgt libsecdb libumem libsmbfs
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userlibexacct/demo: libexacct libproject libsocket libnsl
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Usersmbsrv: libsocket libnsl libmd libxnet libpthread librt \
6bcac4b58d16ee91184a72bd4ff05c41538fd932Tinderbox Usermpapi: libpthread libdevinfo libsysevent libnvpair
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,
8e16b3078757ba3010c24aef805e9e29ed19518bTinderbox User# OpenSolaris).
8e16b3078757ba3010c24aef805e9e29ed19518bTinderbox User @if [ -f $@/Makefile ]; then \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User @if [ -f $(@:%-nodepend=%)/Makefile ]; then \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User cd $(@:%-nodepend=%); pwd; $(MAKE) $(TARGET); \