1# 2# CDDL HEADER START 3# 4# The contents of this file are subject to the terms of the 5# Common Development and Distribution License (the "License"). 6# You may not use this file except in compliance with the License. 7# 8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9# or http://www.opensolaris.org/os/licensing. 10# See the License for the specific language governing permissions 11# and limitations under the License. 12# 13# When distributing Covered Code, include this CDDL HEADER in each 14# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15# If applicable, add the following below this CDDL HEADER, with the 16# fields enclosed by brackets "[]" replaced with your own identifying 17# information: Portions Copyright [yyyy] [name of copyright owner] 18# 19# CDDL HEADER END 20# 21# 22# Copyright 2006 Sun Microsystems, Inc. All rights reserved. 23# Use is subject to license terms. 24# 25# ident "%Z%%M% %I% %E% SMI" 26# 27 28include ../Makefile.master 29 30# Note that libcurses installs commands along with its library. 31# This is a minor bug which probably should be fixed. 32# Note also that a few extra libraries are kept in cmd source. 33# 34# Certain libraries are linked with, hence depend on, other libraries. 35# 36# Although we have historically used .WAIT to express dependencies, it 37# reduces the amount of parallelism and thus lengthens the time it 38# takes to build the libraries. Thus, we now require that any new 39# libraries explicitly call out their dependencies. Eventually, all 40# the library dependencies will be called out explicitly. See 41# "Library interdependencies" near the end of this file. 42# 43# Aside from explicit dependencies (and legacy .WAITs), all libraries 44# are built in parallel. 45# 46.PARALLEL: 47 48# 49# The $(CLOSED_BUILD) additions to SUBDIRS & MSGSUBDIRS are unfortunate, 50# but required due to the "dependencies" of using .WAIT to barrier the 51# parallel dmake builds. once 4631488 has been fixed, they can be 52# consolidated into one $(CLOSED_BUILD)SUBDIRS += (all closed libs) as 53# shown in HDRSUBDIRS 54# 55SUBDIRS= \ 56 common .WAIT \ 57 ../cmd/sgs/libconv \ 58 ../cmd/sgs/libdl .WAIT 59 60$(CLOSED_BUILD)SUBDIRS += \ 61 $(CLOSED)/lib/libc_i18n 62 63SUBDIRS += \ 64 libc .WAIT \ 65 ../cmd/sgs/libelf .WAIT \ 66 libmd \ 67 libmd5 \ 68 librsm \ 69 libmp .WAIT \ 70 libcmd \ 71 libnsl \ 72 libsecdb .WAIT \ 73 librpcsvc \ 74 libsocket .WAIT \ 75 libsctp \ 76 libsip \ 77 libresolv \ 78 libresolv2 .WAIT \ 79 libw .WAIT \ 80 libintl .WAIT \ 81 ../cmd/sgs/librtld_db \ 82 libaio \ 83 librt \ 84 libadm \ 85 libctf \ 86 libdtrace \ 87 libdtrace_jni \ 88 libcurses \ 89 libgen \ 90 libgss \ 91 libpam \ 92 libuuid \ 93 libthread \ 94 libpthread .WAIT \ 95 libslp \ 96 libbsdmalloc \ 97 libdoor \ 98 libdevinfo \ 99 libdladm \ 100 libdlpi \ 101 libeti \ 102 libcrypt \ 103 libefi \ 104 libfstyp \ 105 libwanboot \ 106 libwanbootutil \ 107 libcryptoutil \ 108 libinetcfg \ 109 libinetutil \ 110 libipmp \ 111 libkstat \ 112 libkvm \ 113 liblaadm \ 114 liblm \ 115 libmacadm \ 116 libmalloc \ 117 libmapmalloc \ 118 libmtmalloc \ 119 libnls \ 120 libsmbios \ 121 libtecla \ 122 libumem \ 123 libnvpair .WAIT \ 124 libexacct \ 125 libplot \ 126 libldap4 \ 127 libsasl \ 128 libldap5 \ 129 libsldap .WAIT \ 130 libbsm \ 131 libsys \ 132 libsysevent \ 133 libnisdb \ 134 libpool \ 135 libproc \ 136 libproject \ 137 libsendfile \ 138 nametoaddr \ 139 ncad_addr \ 140 gss_mechs/mech_krb5 .WAIT \ 141 libkrb5 .WAIT \ 142 krb5 .WAIT 143$(CLOSED_BUILD)SUBDIRS += \ 144 $(CLOSED)/lib/smartcard 145SUBDIRS += \ 146 passwdutil \ 147 pam_modules \ 148 crypt_modules \ 149 libadt_jni \ 150 abi \ 151 auditd_plugins \ 152 libvolmgt \ 153 libdevice \ 154 libdevid \ 155 libdhcpsvc \ 156 libc_db \ 157 libsec \ 158 libtnfprobe \ 159 libtnf \ 160 libtnfctl \ 161 libdhcpagent \ 162 libdhcpdu \ 163 libdhcputil \ 164 libipsecutil 165$(CLOSED_BUILD)SUBDIRS += \ 166 $(CLOSED)/lib/libike 167SUBDIRS += \ 168 nsswitch \ 169 print \ 170 libuutil \ 171 libscf \ 172 libinetsvc \ 173 librestart \ 174 libsched 175$(CLOSED_BUILD)SUBDIRS += \ 176 $(CLOSED)/lib/libelfsign 177SUBDIRS += \ 178 pkcs11 .WAIT \ 179 libpctx .WAIT \ 180 libcpc \ 181 watchmalloc \ 182 extendedFILE \ 183 madv \ 184 mpss \ 185 libdisasm \ 186 libwrap \ 187 libxcurses \ 188 libxcurses2 \ 189 libxnet \ 190 libbrand .WAIT \ 191 libzonecfg \ 192 libzoneinfo \ 193 libtsnet \ 194 libtsol \ 195 gss_mechs/mech_spnego \ 196 gss_mechs/mech_dummy \ 197 gss_mechs/mech_dh \ 198 rpcsec_gss \ 199 librcm .WAIT \ 200 libcfgadm .WAIT \ 201 libpicl .WAIT \ 202 libpicltree .WAIT \ 203 cfgadm_plugins \ 204 libmail \ 205 lvm \ 206 libsmedia \ 207 libipp \ 208 openssl \ 209 libdiskmgt \ 210 liblgrp \ 211 libfsmgt \ 212 fm \ 213 libavl \ 214 libcmdutils \ 215 libcontract \ 216 ../cmd/sendmail/libmilter \ 217 sasl_plugins \ 218 udapl \ 219 libzpool \ 220 libzfs \ 221 libzfs_jni \ 222 libmapid \ 223 brand \ 224 $($(MACH)_SUBDIRS) 225 226sparc_SUBDIRS= .WAIT \ 227 efcode \ 228 libc_psr .WAIT \ 229 libdscp \ 230 libprtdiag .WAIT \ 231 libprtdiag_psr \ 232 librsc \ 233 libfruutils .WAIT \ 234 libfru \ 235 libwrsmconf \ 236 storage \ 237 wrsm \ 238 libpcp 239 240fm: libexacct 241 242# 243# Create a special version of $(SUBDIRS) with no .WAIT's, for use with the 244# clean and clobber targets (for more information, see those targets, below). 245# 246NOWAIT_SUBDIRS= $(SUBDIRS:.WAIT=) 247 248DCSUBDIRS = \ 249 lvm 250 251MSGSUBDIRS= \ 252 abi \ 253 auditd_plugins \ 254 brand \ 255 cfgadm_plugins \ 256 gss_mechs/mech_dh \ 257 gss_mechs/mech_krb5 \ 258 krb5 \ 259 libbsm \ 260 libc \ 261 libcfgadm \ 262 libcontract \ 263 libcurses \ 264 libdhcpsvc \ 265 libdhcputil \ 266 libgss \ 267 libinetcfg \ 268 libipmp \ 269 libnsl \ 270 libpam \ 271 libpicl \ 272 libpool \ 273 libscf \ 274 libsasl \ 275 libldap5 \ 276 libsecdb \ 277 libsldap \ 278 libslp \ 279 libsmedia \ 280 libtsol \ 281 libuutil \ 282 libwanboot \ 283 libwanbootutil \ 284 libzonecfg \ 285 lvm \ 286 madv \ 287 mpss \ 288 pam_modules \ 289 rpcsec_gss 290$(CLOSED_BUILD)MSGSUBDIRS += \ 291 $(CLOSED)/lib/smartcard 292MSGSUBDIRS += \ 293 $($(MACH)_MSGSUBDIRS) 294 295sparc_MSGSUBDIRS= \ 296 libprtdiag \ 297 libprtdiag_psr 298 299HDRSUBDIRS= \ 300 auditd_plugins \ 301 libbrand \ 302 libbsm \ 303 libc \ 304 libcmdutils \ 305 libcontract \ 306 libcpc \ 307 libctf \ 308 libcurses \ 309 libcryptoutil \ 310 libdevice \ 311 libdevid \ 312 libdevinfo \ 313 libdiskmgt \ 314 libdladm \ 315 libdlpi \ 316 libdhcpagent \ 317 libdhcpsvc \ 318 libdhcputil \ 319 libdisasm \ 320 libdtrace \ 321 libdtrace_jni \ 322 libeti \ 323 libfstyp \ 324 libgen \ 325 libwanboot \ 326 libwanbootutil \ 327 libipsecutil \ 328 libinetcfg \ 329 libinetsvc \ 330 libinetutil \ 331 libipmp \ 332 libipp \ 333 libkstat \ 334 libkvm \ 335 liblaadm \ 336 libmacadm \ 337 libmail \ 338 libmd \ 339 libmtmalloc \ 340 libnvpair \ 341 libnsl \ 342 libpam \ 343 libpctx \ 344 libpicl \ 345 libpicltree \ 346 libplot \ 347 libpool \ 348 libproc \ 349 librcm \ 350 libscf \ 351 libsip \ 352 libsmbios \ 353 librestart \ 354 librpcsvc \ 355 librsm \ 356 libsasl \ 357 libsec \ 358 libslp \ 359 libsmedia \ 360 libsysevent \ 361 libtecla \ 362 libtnf \ 363 libtnfctl \ 364 libtnfprobe \ 365 libtsnet \ 366 libtsol \ 367 libvolmgt \ 368 libumem \ 369 libuutil \ 370 libwrap \ 371 libxcurses2 \ 372 libzfs \ 373 libzfs_jni \ 374 libzoneinfo \ 375 lvm \ 376 openssl \ 377 pkcs11 \ 378 passwdutil \ 379 ../cmd/sendmail/libmilter \ 380 fm \ 381 udapl \ 382 libmapid \ 383 libkrb5 \ 384 $($(MACH)_HDRSUBDIRS) 385 386$(CLOSED_BUILD)HDRSUBDIRS += \ 387 $(CLOSED)/lib/libc_i18n \ 388 $(CLOSED)/lib/libike \ 389 $(CLOSED)/lib/smartcard 390 391sparc_HDRSUBDIRS= \ 392 libdscp \ 393 libwrsmconf 394 395all := TARGET= all 396check := TARGET= check 397clean := TARGET= clean 398clobber := TARGET= clobber 399install := TARGET= install 400install_h := TARGET= install_h 401lint := TARGET= lint 402_dc := TARGET= _dc 403_msg := TARGET= _msg 404 405.KEEP_STATE: 406 407# 408# For the all and install targets, we clearly must respect library 409# dependencies so that the libraries link correctly. However, for 410# the remaining targets (check, clean, clobber, install_h, lint, _dc 411# and _msg), libraries do not have any dependencies on one another 412# and thus respecting dependencies just slows down the build. 413# As such, for these rules, we use pattern replacement to explicitly 414# avoid triggering the dependency information. Note that for clean, 415# clobber and lint, we must use $(NOWAIT_SUBDIRS) rather than 416# $(SUBDIRS), to prevent `.WAIT' from expanding to `.WAIT-nodepend'. 417# 418 419all: $(SUBDIRS) 420 421install: $(SUBDIRS) .WAIT install_extra 422 423# extra libraries kept in other source areas 424install_extra: 425 @cd ../cmd/sgs; pwd; $(MAKE) install_lib 426 @pwd 427 428clean clobber lint: $(NOWAIT_SUBDIRS:%=%-nodepend) 429 430install_h check: $(HDRSUBDIRS:%=%-nodepend) 431 432_msg: $(MSGSUBDIRS:%=%-nodepend) .WAIT _dc 433 434_dc: $(DCSUBDIRS:%=%-nodepend) 435 436# dependencies for pam_modules (see below) 437$(CLOSED_BUILD)SMARTCARD= $(CLOSED)/lib/smartcard 438 439# 440# Library interdependencies are called out explicitly here 441# 442auditd_plugins: libbsm libnsl libsecdb 443gss_mechs/mech_krb5: libgss libnsl libsocket libresolv pkcs11 444libadt_jni: libbsm 445$(CLOSED_BUILD)libc: $(CLOSED)/lib/libc_i18n 446libbsm: libtsol 447libcmdutils: libavl 448libcontract: libnvpair 449libdevid: libdevinfo 450libdevinfo: libnvpair libsec 451libdhcpagent: libdhcputil libnsl libsocket 452libdhcpsvc: libinetutil 453libdhcputil: libinetutil 454libdladm: libdlpi libdevinfo 455libdtrace: libproc libgen libctf 456libdtrace_jni: libuutil libdtrace 457libefi: libuuid 458libfstyp: libnvpair 459$(CLOSED_BUILD)$(CLOSED)/lib/libelfsign: \ 460 $(CLOSED)/lib/libike libcryptoutil pkcs11 461libinetcfg: libnsl libsocket libdevinfo 462libnsl: libmd5 libscf 463libmapid: libresolv libcmd 464libmacadm: libdevinfo 465libuuid: libsocket 466libinetutil: libsocket 467libsecdb: libcmd libnsl 468libsasl: libgss libsocket pkcs11 libmd 469sasl_plugins: pkcs11 libgss libsocket libsasl 470libsctp: libsocket 471libsip: libmd5 472libsocket: libnsl 473libldap5: libsasl libsocket libnsl libmd 474libsldap: libldap5 libtsol 475libpool: libnvpair libexacct 476libzonecfg: libc libsocket libnsl libuuid libnvpair libsysevent libsec \ 477 libbrand 478libproc: ../cmd/sgs/librtld_db ../cmd/sgs/libelf libctf 479libproject: libpool libproc libsecdb 480libtsnet: libnsl libtsol libsecdb 481libwrap: libnsl libsocket 482libwanboot: libnvpair libresolv libnsl libsocket libdevinfo libinetutil \ 483 libdhcputil openssl 484libwanbootutil: libnsl 485pam_modules: libproject passwdutil $(SMARTCARD) 486libscf: libuutil libmd 487libinetsvc: libscf 488librestart: libuutil libscf 489../cmd/sgs/libdl: ../cmd/sgs/libconv 490../cmd/sgs/libelf: ../cmd/sgs/libconv 491pkcs11: libcryptoutil 492print: libldap5 493udapl/udapl_tavor: udapl/libdat 494libzfs: libdevinfo libdevid libgen libnvpair libuutil 495libzfs_jni: libdiskmgt libnvpair libzfs 496libzpool: libavl libumem libnvpair 497libsec: libavl 498brand: libc libsocket 499 500# 501# The reason this rule checks for the existence of the 502# Makefile is that some of the directories do not exist 503# in certain situations (e.g., exportable source builds, 504# OpenSolaris). 505# 506$(SUBDIRS): FRC 507 @if [ -f $@/Makefile ]; then \ 508 cd $@; pwd; $(MAKE) $(TARGET); \ 509 else \ 510 true; \ 511 fi 512 513$(SUBDIRS:%=%-nodepend): 514 @if [ -f $(@:%-nodepend=%)/Makefile ]; then \ 515 cd $(@:%-nodepend=%); pwd; $(MAKE) $(TARGET); \ 516 else \ 517 true; \ 518 fi 519 520FRC: 521