Makefile revision 82629e3015252bf18319ba3815c773df23e21436
885f47576842cf3c569315b9a48bd9f0ca03f203Automatic Updater# CDDL HEADER START
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater# The contents of this file are subject to the terms of the
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater# Common Development and Distribution License (the "License").
2bb3422dc683c013db7042f5736240de6b86f182Automatic Updater# You may not use this file except in compliance with the License.
75b70a68aefaa17ac4e768d5ed85d2f50d471490Automatic Updater# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater# or http://www.opensolaris.org/os/licensing.
bb93c8542756719b53096b9939e4041d0966026fAutomatic Updater# See the License for the specific language governing permissions
c89d02f2fb4c06168236d600e86831cff324f763Mark Andrews# and limitations under the License.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# When distributing Covered Code, include this CDDL HEADER in each
ac4e70ff8955669341f435bc0a734a17c01af124Mark Andrews# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
6c6a121295b30772cbf3dd75a51fb9d883051a0eAutomatic Updater# If applicable, add the following below this CDDL HEADER, with the
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# fields enclosed by brackets "[]" replaced with your own identifying
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# information: Portions Copyright [yyyy] [name of copyright owner]
56874aef380a64a2c183b7c282c3e7a361d67fa1Automatic Updater# CDDL HEADER END
3cc98b8ecedcbc8465f1cf2740b966b315662430Automatic Updater# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Use is subject to license terms.
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# Note that libcurses installs commands along with its library.
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews# This is a minor bug which probably should be fixed.
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# Note also that a few extra libraries are kept in cmd source.
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# Certain libraries are linked with, hence depend on, other libraries.
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# Although we have historically used .WAIT to express dependencies, it
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# reduces the amount of parallelism and thus lengthens the time it
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater# takes to build the libraries. Thus, we now require that any new
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater# libraries explicitly call out their dependencies. Eventually, all
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt# the library dependencies will be called out explicitly. See
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater# "Library interdependencies" near the end of this file.
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt# Aside from explicit dependencies (and legacy .WAITs), all libraries
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater# are built in parallel.
2d2dc37599979c83495510f8af8d1756753aa2c5Automatic Updater# The $(CLOSED_BUILD) additions to SUBDIRS & MSGSUBDIRS are unfortunate,
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt# but required due to the "dependencies" of using .WAIT to barrier the
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater# parallel dmake builds. once 4631488 has been fixed, they can be
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater# consolidated into one $(CLOSED_BUILD)SUBDIRS += (all closed libs) as
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater# 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).
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# For the all and install targets, we clearly must respect library
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# dependencies so that the libraries link correctly. However, for
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# the remaining targets (check, clean, clobber, install_h, lint, _dc
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# and _msg), libraries do not have any dependencies on one another
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# and thus respecting dependencies just slows down the build.
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# As such, for these rules, we use pattern replacement to explicitly
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# avoid triggering the dependency information. Note that for clean,
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# clobber and lint, we must use $(NOWAIT_SUBDIRS) rather than
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# $(SUBDIRS), to prevent `.WAIT' from expanding to `.WAIT-nodepend'.
fd7c65dce9c2b1a3d12ca4df9074cd38019fdb5fAutomatic Updater# extra libraries kept in other source areas
7af91d15b2ce1ce32f7320f6d5cc3b83621c241aAutomatic Updaterclean clobber lint: $(NOWAIT_SUBDIRS:%=%-nodepend)
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# Library interdependencies are called out explicitly here
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updatergss_mechs/mech_krb5: libgss libnsl libsocket libresolv pkcs11
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater$(CLOSED_BUILD)libc: $(CLOSED)/lib/libc_i18n
ae7e54b14c946e0984c191554db9abb4893f9349Automatic Updaterlibadutils: libldap5 libresolv libsocket libnsl
7af91d15b2ce1ce32f7320f6d5cc3b83621c241aAutomatic Updaterlibdhcpagent: libsocket libdhcputil libuuid libdlpi libcontract
7af91d15b2ce1ce32f7320f6d5cc3b83621c241aAutomatic Updaterlibdhcputil: libnsl libgen libinetutil libdlpi
7af91d15b2ce1ce32f7320f6d5cc3b83621c241aAutomatic Updaterlibdladm: libdevinfo libinetutil libsocket libscf librcm libnvpair \
7af91d15b2ce1ce32f7320f6d5cc3b83621c241aAutomatic Updaterlibdscfg: libnsctl libunistat libsocket libnsl
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonlibidmap: libadutils libldap5 libavl libsldap
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonlibiscsit: libc libnvpair libstmf libuuid libnsl
7af91d15b2ce1ce32f7320f6d5cc3b83621c241aAutomatic Updaterlibrdc: libsocket libnsl libnsctl libunistat libdscfg
6c6a121295b30772cbf3dd75a51fb9d883051a0eAutomatic Updater$(CLOSED_BUILD)libike: libipsecutil libxnet libcryptoutil
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonsasl_plugins: pkcs11 libgss libsocket libsasl
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updaterlibshell: libast libcmd libdll libsocket libsecdb
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonlibstmfproxy: libstmf libsocket libnsl libpthread
601c1908d06375f5dea00ab98671a6c934d8a840Automatic Updaterlibsldap: libldap5 libtsol libnsl libc libscf libresolv
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonlibzonecfg: libc libsocket libnsl libuuid libnvpair libsysevent libsec \
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updaterlibproc: ../cmd/sgs/librtld_db ../cmd/sgs/libelf libctf
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updaterlibwanboot: libnvpair libresolv libnsl libsocket libdevinfo libinetutil \
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updaterlibzfs: libdevid libgen libnvpair libuutil libiscsitgt \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonlibshare: libscf libzfs libuuid libfsmgt libsecdb libumem libsmbfs
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonlibexacct/demo: libexacct libproject libsocket libnsl
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updatersmbsrv: libsocket libnsl libmd libxnet libpthread librt \
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater libshare libidmap pkcs11 libsqlite libcryptoutil
f65d2e1c04c806a185bf9f3120e80692f5ccd5e6Automatic Updatermpapi: libpthread libdevinfo libsysevent libnvpair
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updatersun_sas: libdevinfo libsysevent libnvpair libkstat libdevid
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# The reason this rule checks for the existence of the
3e79333aa37d3b88959372431a02af8a3eb7cfd9Automatic Updater# Makefile is that some of the directories do not exist
e076d0c88be69de7c190ab924d095e69d2e11f7aAndreas Gustafsson# in certain situations (e.g., exportable source builds,
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# OpenSolaris).
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater @if [ -f $@/Makefile ]; then \
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater @if [ -f $(@:%-nodepend=%)/Makefile ]; then \
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater cd $(@:%-nodepend=%); pwd; $(MAKE) $(TARGET); \