Makefile revision 74b5a35d491a5d9569dd85fa6d4037ba66246430
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater# CDDL HEADER START
229ea4644b3a7d9c7fdaa43888e7f55ba01e2ee3Automatic Updater# The contents of this file are subject to the terms of the
1167fc7904c5f0a472f8df207ac46dd52c7f1ec8Automatic Updater# Common Development and Distribution License (the "License").
0c39b3ed9409ecb277d5e32fa763a4e4d6598df8Automatic Updater# You may not use this file except in compliance with the License.
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
cd0aa2d941d1438fabb5337f1f38c49478edf71dAutomatic Updater# or http://www.opensolaris.org/os/licensing.
90ff38a0d8deaf5f9c2aa5916d99b2e572d28738Automatic Updater# See the License for the specific language governing permissions
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# and limitations under the License.
6c6a121295b30772cbf3dd75a51fb9d883051a0eAutomatic Updater# When distributing Covered Code, include this CDDL HEADER in each
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9cd5eb6fe0f26d65724b99216cb31dcdd12e4afdAutomatic Updater# If applicable, add the following below this CDDL HEADER, with the
e171a4137c6ba348957e61b7c4c3541493c0da02Automatic Updater# fields enclosed by brackets "[]" replaced with your own identifying
e171a4137c6ba348957e61b7c4c3541493c0da02Automatic Updater# information: Portions Copyright [yyyy] [name of copyright owner]
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater# CDDL HEADER END
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
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
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic 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
665ba746c0585088d0c314dcfc4671aa2c7b2dc1Automatic Updater# 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).
665ba746c0585088d0c314dcfc4671aa2c7b2dc1Automatic Updater# For the all and install targets, we clearly must respect library
665ba746c0585088d0c314dcfc4671aa2c7b2dc1Automatic Updater# dependencies so that the libraries link correctly. However, for
e8c17c74535be290abaaa160a434ed80bf0ad2feMark Andrews# the remaining targets (check, clean, clobber, install_h, lint, _dc
665ba746c0585088d0c314dcfc4671aa2c7b2dc1Automatic Updater# and _msg), libraries do not have any dependencies on one another
665ba746c0585088d0c314dcfc4671aa2c7b2dc1Automatic Updater# and thus respecting dependencies just slows down the build.
665ba746c0585088d0c314dcfc4671aa2c7b2dc1Automatic Updater# As such, for these rules, we use pattern replacement to explicitly
665ba746c0585088d0c314dcfc4671aa2c7b2dc1Automatic Updater# avoid triggering the dependency information. Note that for clean,
665ba746c0585088d0c314dcfc4671aa2c7b2dc1Automatic Updater# clobber and lint, we must use $(NOWAIT_SUBDIRS) rather than
665ba746c0585088d0c314dcfc4671aa2c7b2dc1Automatic Updater# $(SUBDIRS), to prevent `.WAIT' from expanding to `.WAIT-nodepend'.
44e3b272904bfd85556771d30cf1bc6fa539dd03Automatic Updater# extra libraries kept in other source areas
44e3b272904bfd85556771d30cf1bc6fa539dd03Automatic Updaterclean clobber lint: $(NOWAIT_SUBDIRS:%=%-nodepend)
44e3b272904bfd85556771d30cf1bc6fa539dd03Automatic Updaterinstall_h check: $(HDRSUBDIRS:%=%-nodepend)
44e3b272904bfd85556771d30cf1bc6fa539dd03Automatic Updater# Library interdependencies are called out explicitly here
44e3b272904bfd85556771d30cf1bc6fa539dd03Automatic Updatergss_mechs/mech_krb5: libgss libnsl libsocket libresolv pkcs11
44e3b272904bfd85556771d30cf1bc6fa539dd03Automatic Updater$(CLOSED_BUILD)libc: $(CLOSED)/lib/libc_i18n
44e3b272904bfd85556771d30cf1bc6fa539dd03Automatic Updaterlibadutils: libldap5 libresolv libsocket libnsl
44e3b272904bfd85556771d30cf1bc6fa539dd03Automatic Updaterlibdhcpagent: libsocket libdhcputil libuuid libdlpi libcontract
44e3b272904bfd85556771d30cf1bc6fa539dd03Automatic Updaterlibdhcputil: libnsl libgen libinetutil libdlpi
44e3b272904bfd85556771d30cf1bc6fa539dd03Automatic Updaterlibdladm: libdevinfo libinetutil libsocket libscf librcm libnvpair \
44e3b272904bfd85556771d30cf1bc6fa539dd03Automatic Updaterlibdscfg: libnsctl libunistat libsocket libnsl
31a540386a9abaf681d8952f1b2cdf5c75a0ba6cAutomatic Updaterlibidmap: libadutils libldap5 libavl libsldap
ff8ec39ce4afc2d774ce99f2386474d2c8539cd4Automatic Updaterlibinetcfg: libnsl libsocket libdlpi libinetutil
31a540386a9abaf681d8952f1b2cdf5c75a0ba6cAutomatic Updaterlibipadm: libnsl libinetutil libsocket libdlpi libnvpair libdhcpagent \
31a540386a9abaf681d8952f1b2cdf5c75a0ba6cAutomatic Updaterlibiscsit: libc libnvpair libstmf libuuid libnsl
bf8c3776f1bf1a1270e5e0443ae5a8df022632a8Mark Andrewslibrdc: libsocket libnsl libnsctl libunistat libdscfg
31a540386a9abaf681d8952f1b2cdf5c75a0ba6cAutomatic Updater$(CLOSED_BUILD)libike: libipsecutil libxnet libcryptoutil
31a540386a9abaf681d8952f1b2cdf5c75a0ba6cAutomatic Updatersasl_plugins: pkcs11 libgss libsocket libsasl
31a540386a9abaf681d8952f1b2cdf5c75a0ba6cAutomatic Updaterlibshell: libast libcmd libdll libsocket libsecdb
ff8ec39ce4afc2d774ce99f2386474d2c8539cd4Automatic Updaterlibstmfproxy: libstmf libsocket libnsl libpthread
ff8ec39ce4afc2d774ce99f2386474d2c8539cd4Automatic Updaterlibsldap: libldap5 libtsol libnsl libc libscf libresolv
31a540386a9abaf681d8952f1b2cdf5c75a0ba6cAutomatic Updaterlibzonecfg: libc libsocket libnsl libuuid libnvpair libsysevent libsec \
31a540386a9abaf681d8952f1b2cdf5c75a0ba6cAutomatic Updaterlibproc: ../cmd/sgs/librtld_db ../cmd/sgs/libelf libctf
31a540386a9abaf681d8952f1b2cdf5c75a0ba6cAutomatic Updaterlibwanboot: libnvpair libresolv libnsl libsocket libdevinfo libinetutil \
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updaterlibzfs: libdevid libgen libnvpair libuutil \
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updaterlibshare: libscf libzfs libuuid libfsmgt libsecdb libumem libsmbfs
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellingtonlibexacct/demo: libexacct libproject libsocket libnsl
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updatersmbsrv: libsocket libnsl libmd libxnet libpthread librt \
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater libshare libidmap pkcs11 libsqlite libcryptoutil libreparse
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic 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
ff62ab3c2e6274f19190ded15548c723d38bbbe3Automatic Updater# Makefile is that some of the directories do not exist
ff62ab3c2e6274f19190ded15548c723d38bbbe3Automatic Updater# in certain situations (e.g., exportable source builds,
ff62ab3c2e6274f19190ded15548c723d38bbbe3Automatic Updater# OpenSolaris).
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater @if [ -f $@/Makefile ]; then \
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater @if [ -f $(@:%-nodepend=%)/Makefile ]; then \
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater cd $(@:%-nodepend=%); pwd; $(MAKE) $(TARGET); \