Makefile revision 4b22b9337f359bfd063322244f5336cc7c6ffcfa
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# CDDL HEADER START
e999539fb3e45b2617571e0e3ecd651992291701Mark Andrews# The contents of this file are subject to the terms of the
e999539fb3e45b2617571e0e3ecd651992291701Mark Andrews# Common Development and Distribution License (the "License").
2a40fdc2d34adb8a5c72a748449699666032d461Mark Andrews# You may not use this file except in compliance with the License.
a3b428812703d22a605a9f882e71ed65f0ffdc65Mark Andrews# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# See the License for the specific language governing permissions
ac4e70ff8955669341f435bc0a734a17c01af124Mark Andrews# and limitations under the License.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# When distributing Covered Code, include this CDDL HEADER in each
d56e188030368b835122d759ebbf8d9613c166f4Mark Andrews# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
c718d15a9a95054ee3c71540c02335426071fc6dMark Andrews# If applicable, add the following below this CDDL HEADER, with the
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# fields enclosed by brackets "[]" replaced with your own identifying
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# information: Portions Copyright [yyyy] [name of copyright owner]
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews# CDDL HEADER END
04eba969cb9a54bbda2896db2067c07b2ac5ba16Automatic Updater# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews# Use is subject to license terms.
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews# ident "%Z%%M% %I% %E% SMI"
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# Note that libcurses installs commands along with its library.
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# This is a minor bug which probably should be fixed.
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# Note also that a few extra libraries are kept in cmd source.
a3b428812703d22a605a9f882e71ed65f0ffdc65Mark Andrews# Certain libraries are linked with, hence depend on, other libraries.
bac1bc98410bd876b8d38a6de6126709a7f8cc5aAutomatic Updater# Although we have historically used .WAIT to express dependencies, it
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews# reduces the amount of parallelism and thus lengthens the time it
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# takes to build the libraries. Thus, we now require that any new
f8448666aa53603696bea83de971a05007735d8fMark Andrews# libraries explicitly call out their dependencies. Eventually, all
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# the library dependencies will be called out explicitly. See
3098364bcdd7a719fbafa5fc8d2cc9e90e5a5989Automatic Updater# "Library interdependencies" near the end of this file.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Aside from explicit dependencies (and legacy .WAITs), all libraries
3098364bcdd7a719fbafa5fc8d2cc9e90e5a5989Automatic Updater# are built in parallel.
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# The $(CLOSED_BUILD) additions to SUBDIRS & MSGSUBDIRS are unfortunate,
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# but required due to the "dependencies" of using .WAIT to barrier the
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# parallel dmake builds. once 4631488 has been fixed, they can be
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews# consolidated into one $(CLOSED_BUILD)SUBDIRS += (all closed libs) as
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews# shown in HDRSUBDIRS
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Create a special version of $(SUBDIRS) with no .WAIT's, for use with the
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# clean and clobber targets (for more information, see those targets, below).
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# For the all and install targets, we clearly must respect library
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# dependencies so that the libraries link correctly. However, for
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# the remaining targets (check, clean, clobber, install_h, lint, _dc
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# and _msg), libraries do not have any dependencies on one another
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# and thus respecting dependencies just slows down the build.
7e1a8f402e3881388db37152f71c698cb1f1c426Mark Andrews# As such, for these rules, we use pattern replacement to explicitly
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# avoid triggering the dependency information. Note that for clean,
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# clobber and lint, we must use $(NOWAIT_SUBDIRS) rather than
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# $(SUBDIRS), to prevent `.WAIT' from expanding to `.WAIT-nodepend'.
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# extra libraries kept in other source areas
6fac7ff1f9ec9c3873d3b55c5079fa79aba1f146Mark Andrewsclean clobber lint: $(NOWAIT_SUBDIRS:%=%-nodepend)
6fac7ff1f9ec9c3873d3b55c5079fa79aba1f146Mark Andrews# dependencies for pam_modules (see below)
6fac7ff1f9ec9c3873d3b55c5079fa79aba1f146Mark Andrews$(CLOSED_BUILD)SMARTCARD= $(CLOSED)/lib/smartcard
6fac7ff1f9ec9c3873d3b55c5079fa79aba1f146Mark Andrews# Library interdependencies are called out explicitly here
3a9a66b32adf379e680d18e92428058910880119Mark Andrewsgss_mechs/mech_krb5: libgss libnsl libsocket libresolv pkcs11
7e5b2100ea65658a7ec3795919b4ecd29a6f118aMark Andrewslibdhcpagent: libsocket libdhcputil libuuid libdlpi
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrewslibdladm: libdlpi libdevinfo libinetutil libsocket
3a9a66b32adf379e680d18e92428058910880119Mark Andrewslibshell: libast libcmd libdll libsocket libsecdb
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrewslibzonecfg: 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)
068a66979695c77359e7a9181bb3f831c965b21cMark Andrewslibzfs: libdevinfo libdevid libgen libnvpair libuutil libiscsitgt
068a66979695c77359e7a9181bb3f831c965b21cMark Andrewslibshare: libscf libzfs libuuid libfsmgt libsecdb
068a66979695c77359e7a9181bb3f831c965b21cMark Andrewslibexacct/demo: libexacct libproject libsocket libnsl
7adcb4de92bf4383a4c5624c4ed256736d02bc6dMark Andrews# The reason this rule checks for the existence of the
75216e007570b8ea36b3ac9cca096bf70c0ca6f6Mark Andrews# Makefile is that some of the directories do not exist
7a6ad11e0185a73984410f3252f3c49c3a301dbdBrian Wellington# in certain situations (e.g., exportable source builds,
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews# OpenSolaris).
068a66979695c77359e7a9181bb3f831c965b21cMark Andrews @if [ -f $@/Makefile ]; then \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington @if [ -f $(@:%-nodepend=%)/Makefile ]; then \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington cd $(@:%-nodepend=%); pwd; $(MAKE) $(TARGET); \