Makefile revision d3c6c3bbc49912cd6f331bd19a29afe6bcddc8a0
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User# CDDL HEADER START
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# The contents of this file are subject to the terms of the
4a14ce5ba00ab7bc55c99ffdcf59c7a4ab902721Automatic Updater# Common Development and Distribution License (the "License").
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# You may not use this file except in compliance with the License.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# See the License for the specific language governing permissions
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# and limitations under the License.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# When distributing Covered Code, include this CDDL HEADER in each
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# If applicable, add the following below this CDDL HEADER, with the
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# fields enclosed by brackets "[]" replaced with your own identifying
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# information: Portions Copyright [yyyy] [name of copyright owner]
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# CDDL HEADER END
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Note that libcurses installs commands along with its library.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# This is a minor bug which probably should be fixed.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Note also that a few extra libraries are kept in cmd source.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Certain libraries are linked with, hence depend on, other libraries.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Although we have historically used .WAIT to express dependencies, it
0c6ada0a814f3c5417daa1654129bc2af56ed504Automatic Updater# reduces the amount of parallelism and thus lengthens the time it
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# takes to build the libraries. Thus, we now require that any new
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# libraries explicitly call out their dependencies. Eventually, all
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# the library dependencies will be called out explicitly. See
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# "Library interdependencies" near the end of this file.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Aside from explicit dependencies (and legacy .WAITs), all libraries
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# are built in parallel.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# The $(CLOSED_BUILD) additions to SUBDIRS & MSGSUBDIRS are unfortunate,
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# but required due to the "dependencies" of using .WAIT to barrier the
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# parallel dmake builds. once 4631488 has been fixed, they can be
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# consolidated into one $(CLOSED_BUILD)SUBDIRS += (all closed libs) as
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# shown in HDRSUBDIRS
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Create a special version of $(SUBDIRS) with no .WAIT's, for use with the
395c95214142142854509945adf3293c0270e1c5Tinderbox User# clean and clobber targets (for more information, see those targets, below).
395c95214142142854509945adf3293c0270e1c5Tinderbox User# For the all and install targets, we clearly must respect library
395c95214142142854509945adf3293c0270e1c5Tinderbox User# dependencies so that the libraries link correctly. However, for
395c95214142142854509945adf3293c0270e1c5Tinderbox User# the remaining targets (check, clean, clobber, install_h, lint, _dc
395c95214142142854509945adf3293c0270e1c5Tinderbox User# and _msg), libraries do not have any dependencies on one another
395c95214142142854509945adf3293c0270e1c5Tinderbox User# and thus respecting dependencies just slows down the build.
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User# As such, for these rules, we use pattern replacement to explicitly
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# avoid triggering the dependency information. Note that for clean,
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# clobber and lint, we must use $(NOWAIT_SUBDIRS) rather than
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User# $(SUBDIRS), to prevent `.WAIT' from expanding to `.WAIT-nodepend'.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# extra libraries kept in other source areas
0ccb0e98c77a9b9636a036f8f64f5679a430aaf4Tinderbox Userclean clobber lint: $(NOWAIT_SUBDIRS:%=%-nodepend)
395c95214142142854509945adf3293c0270e1c5Tinderbox User# Library interdependencies are called out explicitly here
395c95214142142854509945adf3293c0270e1c5Tinderbox Usergss_mechs/mech_krb5: libgss libnsl libsocket libresolv pkcs11
395c95214142142854509945adf3293c0270e1c5Tinderbox Userlibadutils: libldap5 libresolv libsocket libnsl
eaaf00efc02fdd4965f747afb51f881ac5a389d2Tinderbox Userlibdhcpagent: libsocket libdhcputil libuuid libdlpi libcontract
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userlibdhcputil: libnsl libgen libinetutil libdlpi
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox Userlibdladm: libdevinfo libinetutil libsocket libscf librcm libnvpair \
9d557856c2a19ec95ee73245f60a92f8675cf5baTinderbox Userlibdscfg: libnsctl libunistat libsocket libnsl
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox Userlibidmap: libadutils libldap5 libavl libsldap libuutil
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userlibipadm: libnsl libinetutil libsocket libdlpi libnvpair libdhcpagent \
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox Userlibiscsit: libc libnvpair libstmf libuuid libnsl
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox Userlibrdc: libsocket libnsl libnsctl libunistat libdscfg
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User$(CLOSED_BUILD)libike: libipsecutil libxnet libcryptoutil
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userlibshell: libast libcmd libdll libsocket libsecdb
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox Userlibsmbfs: libcmdutils libsocket libnsl libkrb5
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox Userlibstmfproxy: libstmf libsocket libnsl libpthread
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox Userlibsldap: libldap5 libtsol libnsl libc libscf libresolv
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox Userlibzonecfg: libc libsocket libnsl libuuid libnvpair libsysevent libsec \
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox Userlibproc: ../cmd/sgs/librtld_db ../cmd/sgs/libelf libctf
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox Userlibwanboot: libnvpair libresolv libnsl libsocket libdevinfo libinetutil \
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox Userlibscf: libuutil libmd libgen libsmbios libnsl
eaaf00efc02fdd4965f747afb51f881ac5a389d2Tinderbox Userlibzpool: libavl libumem libnvpair libcmdutils
eaaf00efc02fdd4965f747afb51f881ac5a389d2Tinderbox Userlibshare: libscf libzfs libuuid libfsmgt libsecdb libumem libsmbfs
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userlibexacct/demo: libexacct libproject libsocket libnsl
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Usersmbsrv: libsocket libnsl libmd libxnet libpthread librt \
395c95214142142854509945adf3293c0270e1c5Tinderbox User libshare libidmap pkcs11 libsqlite libcryptoutil \
395c95214142142854509945adf3293c0270e1c5Tinderbox Usersun_sas: libdevinfo libsysevent libnvpair libkstat libdevid
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# The reason this rule checks for the existence of the
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Makefile is that some of the directories do not exist
395c95214142142854509945adf3293c0270e1c5Tinderbox User# in certain situations (e.g., exportable source builds,
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# OpenSolaris).
395c95214142142854509945adf3293c0270e1c5Tinderbox User @if [ -f $@/Makefile ]; then \
395c95214142142854509945adf3293c0270e1c5Tinderbox User @if [ -f $(@:%-nodepend=%)/Makefile ]; then \
395c95214142142854509945adf3293c0270e1c5Tinderbox User cd $(@:%-nodepend=%); pwd; $(MAKE) $(TARGET); \