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