Makefile revision f85c7842adab30da40b7225f83b02f9df9fbb1f0
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sievers# CDDL HEADER START
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sievers# The contents of this file are subject to the terms of the
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sievers# Common Development and Distribution License (the "License").
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sievers# You may not use this file except in compliance with the License.
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sievers# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering# See the License for the specific language governing permissions
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering# and limitations under the License.
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sievers# When distributing Covered Code, include this CDDL HEADER in each
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sievers# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sievers# If applicable, add the following below this CDDL HEADER, with the
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sievers# fields enclosed by brackets "[]" replaced with your own identifying
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering# information: Portions Copyright [yyyy] [name of copyright owner]
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering# CDDL HEADER END
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sievers# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sievers# Use is subject to license terms.
3ffd4af22052963e7a29431721ee204e634bea75Lennart Poettering# Note that libcurses installs commands along with its library.
3ffd4af22052963e7a29431721ee204e634bea75Lennart Poettering# This is a minor bug which probably should be fixed.
8d451309667578d3a03cdfc91d6e339fb9fe64a7Kay Sievers# Note also that a few extra libraries are kept in cmd source.
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sievers# Certain libraries are linked with, hence depend on, other libraries.
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sievers# Although we have historically used .WAIT to express dependencies, it
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sievers# reduces the amount of parallelism and thus lengthens the time it
4d1a69043862ed979642f5688097160355d4cc81Lennart Poettering# takes to build the libraries. Thus, we now require that any new
a5c32cff1f56afe6f0c6c70d91a88a7a8238b2d7Harald Hoyer# libraries explicitly call out their dependencies. Eventually, all
a5c32cff1f56afe6f0c6c70d91a88a7a8238b2d7Harald Hoyer# the library dependencies will be called out explicitly. See
8d451309667578d3a03cdfc91d6e339fb9fe64a7Kay Sievers# "Library interdependencies" near the end of this file.
8d451309667578d3a03cdfc91d6e339fb9fe64a7Kay Sievers# Aside from explicit dependencies (and legacy .WAITs), all libraries
8d451309667578d3a03cdfc91d6e339fb9fe64a7Kay Sievers# are built in parallel.
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sievers# The $(CLOSED_BUILD) additions to SUBDIRS & MSGSUBDIRS are unfortunate,
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sievers# but required due to the "dependencies" of using .WAIT to barrier the
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sievers# parallel dmake builds. once 4631488 has been fixed, they can be
8d451309667578d3a03cdfc91d6e339fb9fe64a7Kay Sievers# consolidated into one $(CLOSED_BUILD)SUBDIRS += (all closed libs) as
8d451309667578d3a03cdfc91d6e339fb9fe64a7Kay Sievers# shown in HDRSUBDIRS
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sievers# Create a special version of $(SUBDIRS) with no .WAIT's, for use with the
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sievers# clean and clobber targets (for more information, see those targets, below).
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering# For the all and install targets, we clearly must respect library
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering# dependencies so that the libraries link correctly. However, for
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering# the remaining targets (check, clean, clobber, install_h, lint, _dc
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering# and _msg), libraries do not have any dependencies on one another
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sievers# and thus respecting dependencies just slows down the build.
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sievers# As such, for these rules, we use pattern replacement to explicitly
8d451309667578d3a03cdfc91d6e339fb9fe64a7Kay Sievers# avoid triggering the dependency information. Note that for clean,
8d451309667578d3a03cdfc91d6e339fb9fe64a7Kay Sievers# clobber and lint, we must use $(NOWAIT_SUBDIRS) rather than
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sievers# $(SUBDIRS), to prevent `.WAIT' from expanding to `.WAIT-nodepend'.
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sievers# extra libraries kept in other source areas
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sieversclean clobber lint: $(NOWAIT_SUBDIRS:%=%-nodepend)
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sievers# dependencies for pam_modules (see below)
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sievers$(CLOSED_BUILD)SMARTCARD= $(CLOSED)/lib/smartcard
4e829d218cb2ba7e50616945007081f4c7fe0e29Zbigniew Jędrzejewski-Szmek# Library interdependencies are called out explicitly here
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sieversgss_mechs/mech_krb5: libgss libnsl libsocket libresolv pkcs11
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sieverslibdhcpagent: libsocket libdhcputil libuuid libdlpi
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sieverslibdladm: libdevinfo libinetutil libsocket libnsl libexacct libscf
b2fadec6048adb3596f2633cb7fe7a49f5937a18Zbigniew Jędrzejewski-Szmeklibinetcfg: libnsl libsocket libdlpi
4e829d218cb2ba7e50616945007081f4c7fe0e29Zbigniew Jędrzejewski-Szmeklibkmf: libcryptoutil pkcs11 openssl
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sieverslibrdc: libsocket libnsl libnsctl libunistat libdscfg
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sieverslibshell: libast libcmd libdll libsocket libsecdb
8d451309667578d3a03cdfc91d6e339fb9fe64a7Kay Sieverslibsldap: libldap5 libtsol libnsl libc libscf libresolv
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sieverslibzonecfg: libc libsocket libnsl libuuid libnvpair libsysevent libsec \
8d451309667578d3a03cdfc91d6e339fb9fe64a7Kay Sieverslibproc: ../cmd/sgs/librtld_db ../cmd/sgs/libelf libctf
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sieverslibwanboot: libnvpair libresolv libnsl libsocket libdevinfo libinetutil \
98fce79dea6f653dead88638fc17a27280b1f250Zbigniew Jędrzejewski-Szmekpam_modules: libproject passwdutil $(SMARTCARD) smbsrv
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sieverslibzfs: libdevinfo libdevid libgen libnvpair libuutil libiscsitgt
4e829d218cb2ba7e50616945007081f4c7fe0e29Zbigniew Jędrzejewski-Szmeklibzpool: libavl libumem libnvpair
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sieverslibshare: libscf libzfs libuuid libfsmgt libsecdb libumem libsmbfs
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sieverslibexacct/demo: libexacct libproject libsocket libnsl
98fce79dea6f653dead88638fc17a27280b1f250Zbigniew Jędrzejewski-Szmeksmbsrv: libsocket libnsl libmd libxnet libpthread librt \
8d451309667578d3a03cdfc91d6e339fb9fe64a7Kay Sieversmpapi: libpthread libdevinfo libsysevent libnvpair
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sievers# The reason this rule checks for the existence of the
af76d302c1e26f916494202f1b3663f15710bdcdZbigniew Jędrzejewski-Szmek# Makefile is that some of the directories do not exist
af76d302c1e26f916494202f1b3663f15710bdcdZbigniew Jędrzejewski-Szmek# in certain situations (e.g., exportable source builds,
1822350db15b089f094a6dbd2469842ab42c1d87Kay Sievers @if [ -f $@/Makefile ]; then \