Makefile revision 4bff34e37def8a90f9194d81bc345c52ba20086a
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox 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").
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# 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
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# See the License for the specific language governing permissions
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# and limitations under the License.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# When distributing Covered Code, include this CDDL HEADER in each
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# 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
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Use is subject to license terms.
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User# ident "%Z%%M% %I% %E% SMI"
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User# Note that libcurses installs commands along with its library.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# This is a minor bug which probably should be fixed.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Note also that a few extra libraries are kept in cmd source.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Certain libraries are linked with, hence depend on, other libraries.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Although we have historically used .WAIT to express dependencies, it
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# 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
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# "Library interdependencies" near the end of this file.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Aside from explicit dependencies (and legacy .WAITs), all libraries
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# are built in parallel.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# The $(CLOSED_BUILD) additions to SUBDIRS & MSGSUBDIRS are unfortunate,
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# but required due to the "dependencies" of using .WAIT to barrier the
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# parallel dmake builds. once 4631488 has been fixed, they can be
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# consolidated into one $(CLOSED_BUILD)SUBDIRS += (all closed libs) as
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# shown in HDRSUBDIRS
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Create a special version of $(SUBDIRS) with no .WAIT's, for use with the
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# clean and clobber targets (for more information, see those targets, below).
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# For the all and install targets, we clearly must respect library
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# dependencies so that the libraries link correctly. However, for
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# the remaining targets (check, clean, clobber, install_h, lint, _dc
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# and _msg), libraries do not have any dependencies on one another
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# and thus respecting dependencies just slows down the build.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# As such, for these rules, we use pattern replacement to explicitly
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# avoid triggering the dependency information. Note that for clean,
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# clobber and lint, we must use $(NOWAIT_SUBDIRS) rather than
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# $(SUBDIRS), to prevent `.WAIT' from expanding to `.WAIT-nodepend'.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# extra libraries kept in other source areas
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userclean clobber lint: $(NOWAIT_SUBDIRS:%=%-nodepend)
e62b9c9ce6413fb183c8116381e75dcd07ca5517Tinderbox User# dependencies for pam_modules (see below)
e62b9c9ce6413fb183c8116381e75dcd07ca5517Tinderbox User$(CLOSED_BUILD)SMARTCARD= $(CLOSED)/lib/smartcard
d7a61cfbe56ebfa1682e949e48b4d08840234d8fTinderbox User# Library interdependencies are called out explicitly here
d7a61cfbe56ebfa1682e949e48b4d08840234d8fTinderbox Usergss_mechs/mech_krb5: libgss libnsl libsocket libresolv pkcs11
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntlibdhcpagent: libsocket libdhcputil libuuid libdlpi
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userlibshell: libast libcmd libdll libsocket libsecdb
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntlibzonecfg: libc libsocket libnsl libuuid libnvpair libsysevent libsec \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userlibproc: ../cmd/sgs/librtld_db ../cmd/sgs/libelf libctf
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntlibwanboot: libnvpair libresolv libnsl libsocket libdevinfo libinetutil \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntpam_modules: libproject passwdutil $(SMARTCARD) smbsrv
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userlibzfs: libdevinfo libdevid libgen libnvpair libuutil libiscsitgt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntlibshare: libscf libzfs libuuid libfsmgt libsecdb libumem libsmbfs
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userlibexacct/demo: libexacct libproject libsocket libnsl
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntsmbsrv: libsocket libnsl libmd libxnet libpthread librt \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# The reason this rule checks for the existence of the
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Makefile is that some of the directories do not exist
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# in certain situations (e.g., exportable source builds,
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# OpenSolaris).
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User @if [ -f $@/Makefile ]; then \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User @if [ -f $(@:%-nodepend=%)/Makefile ]; then \