Move everything from /var/adm to /var/log
[unleashed/lotheac.git] / usr / src / lib / Makefile
blob480a7e05808d020182e3ec9796396a3f21e28d3a
2 # CDDL HEADER START
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.
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.
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]
19 # CDDL HEADER END
23 # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
24 # Copyright (c) 2012 by Delphix. All rights reserved.
25 # Copyright 2015, Joyent, Inc.
26 # Copyright (c) 2013 Gary Mills
27 # Copyright 2014 Garrett D'Amore <garrett@damore.org>
28 # Copyright (c) 2015 Gary Mills
29 # Copyright 2016 Toomas Soome <tsoome@me.com>
30 # Copyright 2018 Nexenta Systems, Inc.
31 # Copyright (c) 2016, Chris Fraire <cfraire@me.com>.
34 include ../Makefile.master
36 # Note that libcurses installs commands along with its library.
37 # This is a minor bug which probably should be fixed.
38 # Note also that a few extra libraries are kept in cmd source.
40 # Certain libraries are linked with, hence depend on, other libraries.
41 # Library dependencies are called out explicitly, see "Library
42 # interdependencies" below.
43 .PARALLEL:
45 # Build libc and its dependencies
46 SUBDIRS= \
47 crt \
48 ../cmd/sgs/libconv \
49 ../cmd/sgs/libdl \
50 libc \
51 .WAIT
53 # Build libraries with lots of dependents
54 SUBDIRS += \
55 libm \
56 libmd \
57 libmp \
58 libnsl \
59 libnvpair \
60 .WAIT
62 # Build everything else. Aside from explicit dependencies, all libraries
63 # are built in parallel.
64 SUBDIRS += \
65 ../cmd/sgs/libelf \
66 ../cmd/sgs/librtld_db \
67 abi \
68 brand \
69 cfgadm_plugins \
70 crypt_modules \
71 extendedFILE \
72 fm \
73 getloginx \
74 gss_mechs/mech_dh \
75 gss_mechs/mech_dummy \
76 gss_mechs/mech_krb5 \
77 gss_mechs/mech_spnego \
78 hal \
79 hbaapi \
80 krb5 \
81 libadm \
82 libads \
83 libadutils \
84 libaio \
85 libavl \
86 libbe \
87 libbrand \
88 libbsdmalloc \
89 libc_db \
90 libcfgadm \
91 libcmdutils \
92 libcommputil \
93 libcontract \
94 libcpc \
95 libcrypt \
96 libcryptoutil \
97 libctf \
98 libcustr \
99 libdevice \
100 libdevid \
101 libdevinfo \
102 libdhcpagent \
103 libdhcputil \
104 libdisasm \
105 libdiskmgt \
106 libdladm \
107 libdll \
108 libdlpi \
109 libdns_sd \
110 libdoor \
111 libdtrace \
112 libdwarf \
113 libefi \
114 libelfsign \
115 libeti \
116 libexacct \
117 libexacct/demo \
118 libfcoe \
119 libficl \
120 libfsmgt \
121 libfstyp \
122 libgen \
123 libgss \
124 libhotplug \
125 libidmap \
126 libilb \
127 libima \
128 libinetsvc \
129 libinetutil \
130 libintl \
131 libipadm \
132 libipd \
133 libipmi \
134 libipmp \
135 libipp \
136 libipsecutil \
137 libiscsit \
138 libkmf \
139 libkrb5 \
140 libkstat \
141 libkvm \
142 libldap5 \
143 liblgrp \
144 liblm \
145 libmail \
146 libmalloc \
147 libmapid \
148 libmapmalloc \
149 libmd5 \
150 libmlrpc \
151 libmtmalloc \
152 libmvec \
153 libndmp \
154 libnisdb \
155 libnls \
156 libnwam \
157 libofmt \
158 libpam \
159 libpcidb \
160 libpctx \
161 libpool \
162 libproc \
163 libproject \
164 libpthread \
165 libraidcfg \
166 librcm \
167 libreparse \
168 libresolv \
169 libresolv2 \
170 librestart \
171 librpcsvc \
172 librsm \
173 librstp \
174 librt \
175 libsasl \
176 libscf \
177 libsched \
178 libsctp \
179 libsec \
180 libsecdb \
181 libsendfile \
182 libsff \
183 libshare \
184 libshell \
185 libsip \
186 libsldap \
187 libsmbfs \
188 libsmbios \
189 libsmedia \
190 libsqlite \
191 libsrpt \
192 libstmf \
193 libsum \
194 libsun_ima \
195 libsys \
196 libsysevent \
197 libtecla \
198 libthread \
199 libumem \
200 libuuid \
201 libvolmgt \
202 libvrrpadm \
203 libvscan \
204 libw \
205 libwrap \
206 libzfs \
207 libzfs_core \
208 libzonecfg \
209 libzonestat \
210 libzpool \
211 madv \
212 mpapi \
213 mpss \
214 nametoaddr \
215 ncad_addr \
216 nsswitch \
217 pam_modules \
218 passwdutil \
219 pkcs11 \
220 policykit \
221 pylibbe \
222 rpcsec_gss \
223 sasl_plugins \
224 scsi \
225 smbsrv \
226 smhba \
227 sun_fc \
228 sun_sas \
229 udapl \
230 watchmalloc \
231 $($(MACH)_SUBDIRS)
233 i386_SUBDIRS= \
234 libfdisk \
235 libsaveargs
238 # Create a special version of $(SUBDIRS) with no .WAIT's, for use with the
239 # clean and clobber targets (for more information, see those targets, below).
241 NOWAIT_SUBDIRS= $(SUBDIRS:.WAIT=)
243 DCSUBDIRS=
245 MSGSUBDIRS= \
246 abi \
247 brand \
248 cfgadm_plugins \
249 gss_mechs/mech_dh \
250 gss_mechs/mech_krb5 \
251 krb5 \
252 libc \
253 libcfgadm \
254 libcontract \
255 libdhcputil \
256 libdiskmgt \
257 libdladm \
258 libgss \
259 libidmap \
260 libilb \
261 libipadm \
262 libipmp \
263 libipsecutil \
264 libldap5 \
265 libnwam \
266 libofmt \
267 libpam \
268 libpool \
269 libreparse \
270 libsasl \
271 libscf \
272 libsecdb \
273 libshare \
274 libsldap \
275 libsmbfs \
276 libsmedia \
277 libvrrpadm \
278 libvscan \
279 libzfs \
280 libzonecfg \
281 madv \
282 mpss \
283 pam_modules \
284 rpcsec_gss \
285 $($(MACH)_MSGSUBDIRS)
287 i386_MSGSUBDIRS= libfdisk
289 HDRSUBDIRS= \
290 fm \
291 hal \
292 hbaapi \
293 libads \
294 libbrand \
295 libc \
296 libcmdutils \
297 libcommputil \
298 libcontract \
299 libcpc \
300 libcryptoutil \
301 libctf \
302 libcustr \
303 libdevice \
304 libdevid \
305 libdevinfo \
306 libdhcpagent \
307 libdhcputil \
308 libdisasm \
309 libdiskmgt \
310 libdwarf \
311 libdladm \
312 libdll \
313 libdlpi \
314 libdns_sd \
315 libdtrace \
316 libelfsign \
317 libeti \
318 libfcoe \
319 libfstyp \
320 libgen \
321 libidmap \
322 libilb \
323 libima \
324 libinetsvc \
325 libinetutil \
326 libipadm \
327 libipd \
328 libipmi \
329 libipmp \
330 libipp \
331 libipsecutil \
332 libiscsit \
333 libkrb5 \
334 libkstat \
335 libkvm \
336 libmail \
337 libmapid \
338 libmd \
339 libmlrpc \
340 libmtmalloc \
341 libndmp \
342 libnvpair \
343 libnwam \
344 libofmt \
345 libpam \
346 libpcidb \
347 libpctx \
348 libpool \
349 libproc \
350 libraidcfg \
351 librcm \
352 libreparse \
353 librestart \
354 librpcsvc \
355 librsm \
356 librstp \
357 libsasl \
358 libscf \
359 libsec \
360 libsff \
361 libshare \
362 libshell \
363 libsip \
364 libsmbfs \
365 libsmbios \
366 libsmedia \
367 libsqlite \
368 libsrpt \
369 libstmf \
370 libsum \
371 libsun_ima \
372 libsysevent \
373 libtecla \
374 libumem \
375 libvolmgt \
376 libvrrpadm \
377 libvscan \
378 libwrap \
379 libzfs \
380 libzfs_core \
381 libzonestat \
382 mpapi \
383 passwdutil \
384 pkcs11 \
385 policykit \
386 scsi \
387 smbsrv \
388 smhba \
389 udapl \
390 $($(MACH)_HDRSUBDIRS)
392 i386_HDRSUBDIRS= \
393 libfdisk \
394 libsaveargs
396 all := TARGET= all
397 check := TARGET= check
398 clean := TARGET= clean
399 clobber := TARGET= clobber
400 install := TARGET= install
401 install_h := TARGET= install_h
402 _dc := TARGET= _dc
403 _msg := TARGET= _msg
405 .KEEP_STATE:
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, _dc, and
411 # _msg), libraries do not have any dependencies on one another and
412 # thus respecting dependencies just slows down the build. As such,
413 # for these rules, we use pattern replacement to explicitly avoid
414 # triggering the dependency information. Note that for clean and
415 # clobber, we must use $(NOWAIT_SUBDIRS) rather than $(SUBDIRS),
416 # to prevent `.WAIT' from expanding to `.WAIT-nodepend'.
419 all: $(SUBDIRS)
421 install: $(SUBDIRS) .WAIT install_extra
423 # extra libraries kept in other source areas
424 install_extra:
425 @cd ../cmd/sgs; pwd; $(MAKE) install_lib
426 @pwd
428 clean clobber: $(NOWAIT_SUBDIRS:%=%-nodepend)
430 install_h check: $(HDRSUBDIRS:%=%-nodepend)
432 _msg: $(MSGSUBDIRS:%=%-nodepend) .WAIT _dc
434 _dc: $(DCSUBDIRS:%=%-nodepend)
436 # Library interdependencies are called out explicitly here.
437 ../cmd/sgs/libconv: crt
438 ../cmd/sgs/libdl: crt
439 libc: ../cmd/sgs/libconv ../cmd/sgs/libdl
441 libm: libc
442 libmd: libc
443 libmp: libc
444 libnsl: libc libmd libmp
445 libnvpair: libc libnsl
447 basedeps: libc libm libmd libmp libnsl libnvpair
448 basedeps := TARGET=install
450 # The following dependencies are currently required by libdbus-1 and should
451 # be used for anything linking against it.
452 dbusdeps: libsecdb libinetutil libscf libgen libsmbios
454 # The following dependencies don't need to be listed below as they are built
455 # before everything else:
456 # libc libm libmd libmp libnsl libnvpair
457 abi: libctf libmapmalloc libproc
458 brand: libzonecfg libmapmalloc
459 cfgadm_plugins: libdevice libdevinfo libhotplug librcm hbaapi libkstat libscf
460 fm: libexacct libipmi libzfs scsi libdevinfo libdevid libcfgadm \
461 libcontract libsysevent ../cmd/sgs/libelf libdladm libsff \
462 libpcidb libdiskmgt
463 gss_mechs/mech_dh: libgss
464 gss_mechs/mech_dummy: libgss
465 gss_mechs/mech_krb5: libgss libresolv2 pkcs11 libkstat
466 gss_mechs/mech_spnego: gss_mechs/mech_krb5
467 hal: dbusdeps
468 krb5: gss_mechs/mech_krb5 libtecla libldap5
469 libadutils: libldap5 libresolv2
470 libbe: libzfs libzonecfg libuuid libgen libdevinfo libefi libficl
471 libcfgadm: libdevinfo
472 libcmdutils: libavl
473 libcpc: libpctx
474 libcrypt: libgen
475 libctf: libdwarf
476 libdevid: libdevinfo
477 libdevinfo: libsec libgen
478 libdhcpagent: libdhcputil libuuid libdlpi libcontract
479 libdhcputil: libgen libinetutil libdlpi
480 libdiskmgt: libdevid libdevinfo libadm libefi libkstat libsysevent
481 $(INTEL_BLD)libdiskmgt: libfdisk
482 libdladm: libdevinfo libinetutil libscf librcm libexacct libkstat \
483 libpool
484 libdlpi: libinetutil libdladm
485 libdtrace: libproc libgen libctf libmapmalloc
486 libefi: libuuid libsmbios
487 libelfsign: libcryptoutil libkmf ../cmd/sgs/libelf
488 libexacct/demo: libexacct libproject
489 libfcoe: libdladm
490 libficl: libuuid libumem
491 libfsmgt: libkstat
492 libidmap: libavl
493 libinetsvc: libscf
494 libipadm: libinetutil libdlpi libdhcpagent libdladm libsecdb libdhcputil
495 libipmp: libinetutil
496 libipsecutil: libtecla libkmf
497 libiscsit: libstmf libuuid
498 libkmf: libcryptoutil pkcs11 libcustr
499 libkvm: ../cmd/sgs/libelf
500 libldap5: libsasl
501 libmapid: libresolv2 libscf
502 libmlrpc: libsmbfs libuuid
503 libndmp: libscf
504 libnisdb: libldap5
505 libnwam: libscf libdladm libipadm
506 libpctx: libproc
507 libpool: libscf libexacct
508 libproc: ../cmd/sgs/librtld_db ../cmd/sgs/libelf libctf
509 $(INTEL_BLD)libproc: libsaveargs
510 libproject: libpool libproc libsecdb
511 libraidcfg: libdevinfo
512 librestart: libscf libpool libproject libsecdb libsysevent
513 libsasl: libgss pkcs11
514 libsaveargs: libdisasm
515 libscf: libgen libsmbios
516 libsec: libavl libidmap
517 libsff: libnvpair
518 libshare: libscf libzfs libuuid libfsmgt libsecdb libumem libsmbfs
519 libsip: libmd5
520 libsldap: libldap5 libscf
521 libsmbfs: libkrb5 libsec libidmap pkcs11
522 libsmbios: libdevinfo
523 libsrpt: libstmf
524 libstmf: libscf
525 libsun_ima: libdevinfo libsysevent
526 libsysevent: libsecdb
527 libuuid: libdlpi
528 libvolmgt: libadm
529 libvrrpadm: libdladm libscf
530 libvscan: libscf libsecdb
531 libzfs: libdevid libgen libadm libavl libefi libidmap \
532 libumem libzfs_core
533 libzonecfg: libuuid libsysevent libsec libbrand libpool libscf libproc \
534 libsecdb
535 libzonestat: libcmdutils libumem
536 libzpool: libavl libumem libcmdutils libsysevent
537 madv: libgen
538 mpapi: libpthread libdevinfo libsysevent
539 mpss: libgen
540 nsswitch: libadutils libidmap libdns_sd libscf libldap5 libsldap
541 pam_modules: libproject passwdutil smbsrv libpam libsecdb
542 passwdutil: libsldap
543 pkcs11: libcryptoutil libgen libuuid
544 policykit: dbusdeps
545 pylibbe: libbe libzfs
546 rpcsec_gss: libgss
547 sasl_plugins: pkcs11 libgss libsasl
548 scsi: libumem libdevid libdevinfo
549 smbsrv: libpthread librt libshare libidmap pkcs11 libsqlite \
550 libcryptoutil libreparse libcmdutils libresolv2 libsmbfs \
551 libuuid libads libgss libldap5 krb5 libmlrpc
552 sun_fc: libdevinfo libsysevent
553 sun_sas: libdevinfo libsysevent libkstat libdevid
554 udapl: libdevinfo libdladm
557 # The reason this rule checks for the existence of the
558 # Makefile is that some of the directories do not exist
559 # in certain situations (e.g., exportable source builds,
560 # OpenSolaris).
562 $(SUBDIRS): FRC
563 @if [ -f $@/Makefile ]; then \
564 cd $@; pwd; $(MAKE) $(TARGET); \
565 else \
566 true; \
569 $(SUBDIRS:%=%-nodepend):
570 @if [ -f $(@:%-nodepend=%)/Makefile ]; then \
571 cd $(@:%-nodepend=%); pwd; $(MAKE) $(TARGET); \
572 else \
573 true; \
576 FRC: