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 2007 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 libnsl \ 71 libsecdb .WAIT \ 72 librpcsvc \ 73 libsocket .WAIT \ 74 libsctp \ 75 libsip \ 76 libresolv \ 77 libresolv2 .WAIT \ 78 libw .WAIT \ 79 libintl .WAIT \ 80 ../cmd/sgs/librtld_db \ 81 libaio \ 82 libast \ 83 libdll \ 84 libcmd \ 85 libshell \ 86 librt \ 87 libadm \ 88 libctf \ 89 libdtrace \ 90 libdtrace_jni \ 91 libcurses \ 92 libgen \ 93 libgss \ 94 libpam \ 95 libuuid \ 96 libthread \ 97 libpthread .WAIT \ 98 libslp \ 99 libbsdmalloc \ 100 libdoor \ 101 libdevinfo \ 102 libdladm \ 103 libdlpi \ 104 libeti \ 105 libcrypt \ 106 libefi \ 107 libfstyp \ 108 libwanboot \ 109 libwanbootutil \ 110 libcryptoutil \ 111 libinetcfg \ 112 libinetutil \ 113 libipmp \ 114 libiscsitgt \ 115 libkmf \ 116 libkstat \ 117 libkvm \ 118 liblm \ 119 libmalloc \ 120 libmapmalloc \ 121 libmtmalloc \ 122 libnls \ 123 libsmbios \ 124 libtecla \ 125 libumem \ 126 libnvpair .WAIT \ 127 libexacct \ 128 libplot \ 129 libldap4 \ 130 libsasl \ 131 libldap5 \ 132 libsldap .WAIT \ 133 libbsm \ 134 libsys \ 135 libsysevent \ 136 libnisdb \ 137 libpool \ 138 libpp \ 139 libproc \ 140 libproject \ 141 libsendfile \ 142 nametoaddr \ 143 ncad_addr \ 144 gss_mechs/mech_krb5 .WAIT \ 145 libkrb5 .WAIT \ 146 krb5 .WAIT 147$(CLOSED_BUILD)SUBDIRS += \ 148 $(CLOSED)/lib/smartcard 149SUBDIRS += \ 150 passwdutil \ 151 pam_modules \ 152 crypt_modules \ 153 libadt_jni \ 154 abi \ 155 auditd_plugins \ 156 libvolmgt \ 157 libdevice \ 158 libdevid \ 159 libdhcpsvc \ 160 libc_db \ 161 libsec \ 162 libtnfprobe \ 163 libtnf \ 164 libtnfctl \ 165 libdhcpagent \ 166 libdhcpdu \ 167 libdhcputil \ 168 libipsecutil 169$(CLOSED_BUILD)SUBDIRS += \ 170 $(CLOSED)/lib/libike 171SUBDIRS += \ 172 nsswitch \ 173 print \ 174 libuutil \ 175 libscf \ 176 libinetsvc \ 177 librestart \ 178 libsched 179$(CLOSED_BUILD)SUBDIRS += \ 180 $(CLOSED)/lib/libelfsign 181SUBDIRS += \ 182 pkcs11 .WAIT \ 183 libpctx .WAIT \ 184 libcpc \ 185 watchmalloc \ 186 extendedFILE \ 187 madv \ 188 mpss \ 189 libdisasm \ 190 libwrap \ 191 libxcurses \ 192 libxcurses2 \ 193 libxnet \ 194 libbrand .WAIT \ 195 libzonecfg \ 196 libzoneinfo \ 197 libtsnet \ 198 libtsol \ 199 gss_mechs/mech_spnego \ 200 gss_mechs/mech_dummy \ 201 gss_mechs/mech_dh \ 202 rpcsec_gss \ 203 libraidcfg .WAIT \ 204 librcm .WAIT \ 205 libcfgadm .WAIT \ 206 libpicl .WAIT \ 207 libpicltree .WAIT \ 208 raidcfg_plugins \ 209 cfgadm_plugins \ 210 libmail \ 211 lvm \ 212 libsmedia \ 213 libipp \ 214 openssl \ 215 libdiskmgt \ 216 liblgrp \ 217 libfsmgt \ 218 fm \ 219 libavl \ 220 libcmdutils \ 221 libcontract \ 222 ../cmd/sendmail/libmilter \ 223 sasl_plugins \ 224 udapl \ 225 libzpool \ 226 libzfs \ 227 libzfs_jni \ 228 libmapid \ 229 brand \ 230 policykit \ 231 hal \ 232 libshare \ 233 libsqlite \ 234 libidmap \ 235 libipmi \ 236 libexacct/demo \ 237 $($(MACH)_SUBDIRS) 238 239sparc_SUBDIRS= .WAIT \ 240 efcode \ 241 libc_psr .WAIT \ 242 libdscp \ 243 libprtdiag .WAIT \ 244 libprtdiag_psr \ 245 libpri \ 246 librsc \ 247 libfruutils .WAIT \ 248 libfru \ 249 storage \ 250 libpcp 251 252FM_sparc_DEPLIBS= libpri 253 254fm: libexacct $(FM_$(MACH)_DEPLIBS) 255 256# 257# Create a special version of $(SUBDIRS) with no .WAIT's, for use with the 258# clean and clobber targets (for more information, see those targets, below). 259# 260NOWAIT_SUBDIRS= $(SUBDIRS:.WAIT=) 261 262DCSUBDIRS = \ 263 lvm 264 265MSGSUBDIRS= \ 266 abi \ 267 auditd_plugins \ 268 brand \ 269 cfgadm_plugins \ 270 gss_mechs/mech_dh \ 271 gss_mechs/mech_krb5 \ 272 krb5 \ 273 libast \ 274 libbsm \ 275 libc \ 276 libcfgadm \ 277 libcmd \ 278 libcontract \ 279 libcurses \ 280 libdhcpsvc \ 281 libdhcputil \ 282 libipsecutil \ 283 libdiskmgt \ 284 libdladm \ 285 libdll \ 286 libgss \ 287 libidmap \ 288 libinetcfg \ 289 libipmp \ 290 libnsl \ 291 libpam \ 292 libpicl \ 293 libpool \ 294 libpp \ 295 libscf \ 296 libsasl \ 297 libldap5 \ 298 libsecdb \ 299 libshare \ 300 libshell \ 301 libsldap \ 302 libslp \ 303 libsmedia \ 304 libtsol \ 305 libuutil \ 306 libwanboot \ 307 libwanbootutil \ 308 libzfs \ 309 libzonecfg \ 310 lvm \ 311 madv \ 312 mpss \ 313 pam_modules \ 314 rpcsec_gss 315$(CLOSED_BUILD)MSGSUBDIRS += \ 316 $(CLOSED)/lib/smartcard 317MSGSUBDIRS += \ 318 $($(MACH)_MSGSUBDIRS) 319 320sparc_MSGSUBDIRS= \ 321 libprtdiag \ 322 libprtdiag_psr 323 324HDRSUBDIRS= \ 325 auditd_plugins \ 326 libast \ 327 libbrand \ 328 libbsm \ 329 libc \ 330 libcmd \ 331 libcmdutils \ 332 libcontract \ 333 libcpc \ 334 libctf \ 335 libcurses \ 336 libcryptoutil \ 337 libdevice \ 338 libdevid \ 339 libdevinfo \ 340 libdiskmgt \ 341 libdladm \ 342 libdll \ 343 libdlpi \ 344 libdhcpagent \ 345 libdhcpsvc \ 346 libdhcputil \ 347 libdisasm \ 348 libdtrace \ 349 libdtrace_jni \ 350 libeti \ 351 libfstyp \ 352 libgen \ 353 libwanboot \ 354 libwanbootutil \ 355 libipsecutil \ 356 libinetcfg \ 357 libinetsvc \ 358 libinetutil \ 359 libipmi \ 360 libipmp \ 361 libipp \ 362 libiscsitgt \ 363 libkstat \ 364 libkvm \ 365 libmail \ 366 libmd \ 367 libmtmalloc \ 368 libnvpair \ 369 libnsl \ 370 libpam \ 371 libpctx \ 372 libpicl \ 373 libpicltree \ 374 libplot \ 375 libpool \ 376 libpp \ 377 libproc \ 378 libraidcfg \ 379 librcm \ 380 libscf \ 381 libsip \ 382 libsmbios \ 383 librestart \ 384 librpcsvc \ 385 librsm \ 386 libsasl \ 387 libsec \ 388 libshell \ 389 libslp \ 390 libsmedia \ 391 libsqlite \ 392 libsysevent \ 393 libtecla \ 394 libtnf \ 395 libtnfctl \ 396 libtnfprobe \ 397 libtsnet \ 398 libtsol \ 399 libvolmgt \ 400 libumem \ 401 libuutil \ 402 libwrap \ 403 libxcurses2 \ 404 libzfs \ 405 libzfs_jni \ 406 libzoneinfo \ 407 hal \ 408 policykit \ 409 lvm \ 410 openssl \ 411 pkcs11 \ 412 passwdutil \ 413 ../cmd/sendmail/libmilter \ 414 fm \ 415 udapl \ 416 libmapid \ 417 libkrb5 \ 418 libshare \ 419 libidmap \ 420 $($(MACH)_HDRSUBDIRS) 421 422$(CLOSED_BUILD)HDRSUBDIRS += \ 423 $(CLOSED)/lib/libc_i18n \ 424 $(CLOSED)/lib/libike \ 425 $(CLOSED)/lib/smartcard 426 427sparc_HDRSUBDIRS= \ 428 libdscp \ 429 libpri 430 431all := TARGET= all 432check := TARGET= check 433clean := TARGET= clean 434clobber := TARGET= clobber 435install := TARGET= install 436install_h := TARGET= install_h 437lint := TARGET= lint 438_dc := TARGET= _dc 439_msg := TARGET= _msg 440 441.KEEP_STATE: 442 443# 444# For the all and install targets, we clearly must respect library 445# dependencies so that the libraries link correctly. However, for 446# the remaining targets (check, clean, clobber, install_h, lint, _dc 447# and _msg), libraries do not have any dependencies on one another 448# and thus respecting dependencies just slows down the build. 449# As such, for these rules, we use pattern replacement to explicitly 450# avoid triggering the dependency information. Note that for clean, 451# clobber and lint, we must use $(NOWAIT_SUBDIRS) rather than 452# $(SUBDIRS), to prevent `.WAIT' from expanding to `.WAIT-nodepend'. 453# 454 455all: $(SUBDIRS) 456 457install: $(SUBDIRS) .WAIT install_extra 458 459# extra libraries kept in other source areas 460install_extra: 461 @cd ../cmd/sgs; pwd; $(MAKE) install_lib 462 @pwd 463 464clean clobber lint: $(NOWAIT_SUBDIRS:%=%-nodepend) 465 466install_h check: $(HDRSUBDIRS:%=%-nodepend) 467 468_msg: $(MSGSUBDIRS:%=%-nodepend) .WAIT _dc 469 470_dc: $(DCSUBDIRS:%=%-nodepend) 471 472# dependencies for pam_modules (see below) 473$(CLOSED_BUILD)SMARTCARD= $(CLOSED)/lib/smartcard 474 475# 476# Library interdependencies are called out explicitly here 477# 478auditd_plugins: libbsm libnsl libsecdb 479gss_mechs/mech_krb5: libgss libnsl libsocket libresolv pkcs11 480libadt_jni: libbsm 481$(CLOSED_BUILD)libc: $(CLOSED)/lib/libc_i18n 482libast: libsocket 483libbsm: libtsol 484libcmd: libast libsocket libnsl 485libcmdutils: libavl 486libcontract: libnvpair 487libdevid: libdevinfo 488libdevinfo: libnvpair libsec 489libdhcpagent: libsocket libdhcputil libuuid libdlpi 490libdhcpsvc: libinetutil 491libdhcputil: libnsl libgen libinetutil libdlpi 492libdladm: libdlpi libdevinfo libinetutil libsocket 493libdll: libast 494libdlpi: libinetutil 495libdtrace: libproc libgen libctf 496libdtrace_jni: libuutil libdtrace 497libefi: libuuid 498libfstyp: libnvpair 499$(CLOSED_BUILD)$(CLOSED)/lib/libelfsign: \ 500 $(CLOSED)/lib/libike libcryptoutil pkcs11 501libidmap: libnsl 502libinetcfg: libnsl libsocket libdevinfo 503libkmf: libcryptoutil pkcs11 openssl 504libnsl: libmd5 libscf 505libmapid: libresolv 506libuuid: libdlpi libdladm 507libinetutil: libsocket 508libsecdb: libnsl 509libsasl: libgss libsocket pkcs11 libmd 510sasl_plugins: pkcs11 libgss libsocket libsasl 511libsctp: libsocket 512libshell: libast libcmd libdll libsocket libsecdb 513libsip: libmd5 514libsocket: libnsl 515libldap5: libsasl libsocket libnsl libmd 516libsldap: libldap5 libtsol 517libpool: libnvpair libexacct 518libpp: libast 519libzonecfg: libc libsocket libnsl libuuid libnvpair libsysevent libsec \ 520 libbrand libpool libscf 521libproc: ../cmd/sgs/librtld_db ../cmd/sgs/libelf libctf 522libproject: libpool libproc libsecdb 523libtsnet: libnsl libtsol libsecdb 524libwrap: libnsl libsocket 525libwanboot: libnvpair libresolv libnsl libsocket libdevinfo libinetutil \ 526 libdhcputil openssl 527libwanbootutil: libnsl 528pam_modules: libproject passwdutil $(SMARTCARD) 529libscf: libuutil libmd libgen 530libinetsvc: libscf 531librestart: libuutil libscf 532../cmd/sgs/libdl: ../cmd/sgs/libconv 533../cmd/sgs/libelf: ../cmd/sgs/libconv 534pkcs11: libcryptoutil 535print: libldap5 536udapl/udapl_tavor: udapl/libdat 537libzfs: libdevinfo libdevid libgen libnvpair libuutil libiscsitgt 538libzfs_jni: libdiskmgt libnvpair libzfs 539libzpool: libavl libumem libnvpair 540libsec: libavl 541brand: libc libsocket 542libshare: libscf libzfs libuuid libfsmgt libsecdb 543libexacct/demo: libexacct libproject libsocket libnsl 544 545# 546# The reason this rule checks for the existence of the 547# Makefile is that some of the directories do not exist 548# in certain situations (e.g., exportable source builds, 549# OpenSolaris). 550# 551$(SUBDIRS): FRC 552 @if [ -f $@/Makefile ]; then \ 553 cd $@; pwd; $(MAKE) $(TARGET); \ 554 else \ 555 true; \ 556 fi 557 558$(SUBDIRS:%=%-nodepend): 559 @if [ -f $(@:%-nodepend=%)/Makefile ]; then \ 560 cd $(@:%-nodepend=%); pwd; $(MAKE) $(TARGET); \ 561 else \ 562 true; \ 563 fi 564 565FRC: 566