remove libsocket
[unleashed.git] / usr / src / lib / Makefile
blob51fb96d05a0ce324b4068b4d5dee4b29ccebae4f
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 2017 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 auditd_plugins \
69 brand \
70 cfgadm_plugins \
71 crypt_modules \
72 extendedFILE \
73 fm \
74 getloginx \
75 gss_mechs/mech_dh \
76 gss_mechs/mech_dummy \
77 gss_mechs/mech_krb5 \
78 gss_mechs/mech_spnego \
79 hal \
80 hbaapi \
81 krb5 \
82 libadm \
83 libads \
84 libadutils \
85 libaio \
86 libast \
87 libavl \
88 libbe \
89 libbrand \
90 libbsdmalloc \
91 libbsm \
92 libc_db \
93 libcfgadm \
94 libcmd \
95 libcmdutils \
96 libcommputil \
97 libcontract \
98 libcpc \
99 libcrypt \
100 libcryptoutil \
101 libctf \
102 libdevice \
103 libdevid \
104 libdevinfo \
105 libdhcpagent \
106 libdhcputil \
107 libdisasm \
108 libdiskmgt \
109 libdladm \
110 libdll \
111 libdlpi \
112 libdns_sd \
113 libdoor \
114 libdtrace \
115 libdwarf \
116 libefi \
117 libelfsign \
118 libeti \
119 libexacct \
120 libexacct/demo \
121 libfcoe \
122 libficl \
123 libfru \
124 libfruutils \
125 libfsmgt \
126 libfstyp \
127 libgen \
128 libgss \
129 libhotplug \
130 libidmap \
131 libilb \
132 libima \
133 libinetsvc \
134 libinetutil \
135 libintl \
136 libipadm \
137 libipd \
138 libipmi \
139 libipmp \
140 libipp \
141 libipsecutil \
142 libiscsit \
143 libkmf \
144 libkrb5 \
145 libkstat \
146 libkvm \
147 libldap5 \
148 liblgrp \
149 liblm \
150 libm1 \
151 libmail \
152 libmalloc \
153 libmapid \
154 libmapmalloc \
155 libmd5 \
156 libmtmalloc \
157 libmvec \
158 libndmp \
159 libnisdb \
160 libnls \
161 libnwam \
162 libofmt \
163 libpam \
164 libpcidb \
165 libpctx \
166 libpicl \
167 libpicltree \
168 libpool \
169 libpp \
170 libproc \
171 libproject \
172 libpthread \
173 libraidcfg \
174 librcm \
175 librdc \
176 libreparse \
177 libresolv \
178 libresolv2 \
179 librestart \
180 librpcsvc \
181 librsm \
182 librstp \
183 librt \
184 libsasl \
185 libscf \
186 libsched \
187 libsctp \
188 libsec \
189 libsecdb \
190 libsendfile \
191 libshare \
192 libshell \
193 libsip \
194 libsldap \
195 libsmbfs \
196 libsmbios \
197 libsmedia \
198 libsqlite \
199 libsrpt \
200 libstmf \
201 libsum \
202 libsun_ima \
203 libsys \
204 libsysevent \
205 libtecla \
206 libthread \
207 libumem \
208 libuuid \
209 libuutil \
210 libvolmgt \
211 libvrrpadm \
212 libvscan \
213 libw \
214 libwrap \
215 libzfs \
216 libzfs_core \
217 libzonecfg \
218 libzonestat \
219 libzpool \
220 madv \
221 mpapi \
222 mpss \
223 nametoaddr \
224 ncad_addr \
225 nsswitch \
226 pam_modules \
227 passwdutil \
228 pkcs11 \
229 policykit \
230 pylibbe \
231 pysolaris \
232 pyzfs \
233 raidcfg_plugins \
234 rpcsec_gss \
235 sasl_plugins \
236 scsi \
237 smbsrv \
238 smhba \
239 sun_fc \
240 sun_sas \
241 udapl \
242 watchmalloc \
243 $($(MACH)_SUBDIRS)
245 i386_SUBDIRS= \
246 libfdisk \
247 libsaveargs
249 sparc_SUBDIRS= \
250 efcode \
251 libds \
252 libdscp \
253 libprtdiag \
254 libprtdiag_psr \
255 libpri \
256 librsc \
257 storage \
258 libpcp \
259 libtsalarm \
260 libv12n
263 # Create a special version of $(SUBDIRS) with no .WAIT's, for use with the
264 # clean and clobber targets (for more information, see those targets, below).
266 NOWAIT_SUBDIRS= $(SUBDIRS:.WAIT=)
268 DCSUBDIRS=
270 MSGSUBDIRS= \
271 abi \
272 auditd_plugins \
273 brand \
274 cfgadm_plugins \
275 gss_mechs/mech_dh \
276 gss_mechs/mech_krb5 \
277 krb5 \
278 libast \
279 libbsm \
280 libc \
281 libcfgadm \
282 libcmd \
283 libcontract \
284 libdhcputil \
285 libdiskmgt \
286 libdladm \
287 libdll \
288 libgss \
289 libidmap \
290 libilb \
291 libipadm \
292 libipmp \
293 libipsecutil \
294 libldap5 \
295 libnwam \
296 libofmt \
297 libpam \
298 libpicl \
299 libpool \
300 libpp \
301 libreparse \
302 libsasl \
303 libscf \
304 libsecdb \
305 libshare \
306 libshell \
307 libsldap \
308 libsmbfs \
309 libsmedia \
310 libsum \
311 libuutil \
312 libvrrpadm \
313 libvscan \
314 libzfs \
315 libzonecfg \
316 madv \
317 mpss \
318 pam_modules \
319 rpcsec_gss \
320 $($(MACH)_MSGSUBDIRS)
322 sparc_MSGSUBDIRS= \
323 libprtdiag \
324 libprtdiag_psr
326 i386_MSGSUBDIRS= libfdisk
328 HDRSUBDIRS= \
329 auditd_plugins \
330 fm \
331 hal \
332 hbaapi \
333 libads \
334 libast \
335 libbrand \
336 libbsm \
337 libc \
338 libcmd \
339 libcmdutils \
340 libcommputil \
341 libcontract \
342 libcpc \
343 libcryptoutil \
344 libctf \
345 libdevice \
346 libdevid \
347 libdevinfo \
348 libdhcpagent \
349 libdhcputil \
350 libdisasm \
351 libdiskmgt \
352 libdwarf \
353 libdladm \
354 libdll \
355 libdlpi \
356 libdns_sd \
357 libdtrace \
358 libelfsign \
359 libeti \
360 libfcoe \
361 libfru \
362 libfstyp \
363 libgen \
364 libidmap \
365 libilb \
366 libima \
367 libinetsvc \
368 libinetutil \
369 libipadm \
370 libipd \
371 libipmi \
372 libipmp \
373 libipp \
374 libipsecutil \
375 libiscsit \
376 libkrb5 \
377 libkstat \
378 libkvm \
379 libmail \
380 libmapid \
381 libmd \
382 libmtmalloc \
383 libndmp \
384 libnvpair \
385 libnwam \
386 libofmt \
387 libpam \
388 libpcidb \
389 libpctx \
390 libpicl \
391 libpicltree \
392 libpool \
393 libpp \
394 libproc \
395 libraidcfg \
396 librcm \
397 librdc \
398 libreparse \
399 librestart \
400 librpcsvc \
401 librsm \
402 librstp \
403 libsasl \
404 libscf \
405 libsec \
406 libshare \
407 libshell \
408 libsip \
409 libsmbfs \
410 libsmbios \
411 libsmedia \
412 libsqlite \
413 libsrpt \
414 libstmf \
415 libsum \
416 libsun_ima \
417 libsysevent \
418 libtecla \
419 libumem \
420 libuutil \
421 libvolmgt \
422 libvrrpadm \
423 libvscan \
424 libwrap \
425 libzfs \
426 libzfs_core \
427 libzonestat \
428 mpapi \
429 passwdutil \
430 pkcs11 \
431 policykit \
432 scsi \
433 smbsrv \
434 smhba \
435 udapl \
436 $($(MACH)_HDRSUBDIRS)
438 i386_HDRSUBDIRS= \
439 libfdisk \
440 libsaveargs
442 sparc_HDRSUBDIRS= \
443 libds \
444 libdscp \
445 libpri \
446 libv12n \
447 storage
449 all := TARGET= all
450 check := TARGET= check
451 clean := TARGET= clean
452 clobber := TARGET= clobber
453 install := TARGET= install
454 install_h := TARGET= install_h
455 _dc := TARGET= _dc
456 _msg := TARGET= _msg
458 .KEEP_STATE:
461 # For the all and install targets, we clearly must respect library
462 # dependencies so that the libraries link correctly. However, for
463 # the remaining targets (check, clean, clobber, install_h, _dc, and
464 # _msg), libraries do not have any dependencies on one another and
465 # thus respecting dependencies just slows down the build. As such,
466 # for these rules, we use pattern replacement to explicitly avoid
467 # triggering the dependency information. Note that for clean and
468 # clobber, we must use $(NOWAIT_SUBDIRS) rather than $(SUBDIRS),
469 # to prevent `.WAIT' from expanding to `.WAIT-nodepend'.
472 all: $(SUBDIRS)
474 install: $(SUBDIRS) .WAIT install_extra
476 # extra libraries kept in other source areas
477 install_extra:
478 @cd ../cmd/sgs; pwd; $(MAKE) install_lib
479 @pwd
481 clean clobber: $(NOWAIT_SUBDIRS:%=%-nodepend)
483 install_h check: $(HDRSUBDIRS:%=%-nodepend)
485 _msg: $(MSGSUBDIRS:%=%-nodepend) .WAIT _dc
487 _dc: $(DCSUBDIRS:%=%-nodepend)
489 # Library interdependencies are called out explicitly here.
490 ../cmd/sgs/libconv: crt
491 ../cmd/sgs/libdl: crt
492 libc: ../cmd/sgs/libconv ../cmd/sgs/libdl
494 libm: libc
495 libmd: libc
496 libmp: libc
497 libnsl: libc libmd libmp
498 libnvpair: libc libnsl
500 basedeps: libc libm libmd libmp libnsl libnvpair
501 basedeps := TARGET=install
503 # The following dependencies are currently required by libdbus-1 and should
504 # be used for anything linking against it.
505 dbusdeps: libsecdb libinetutil libscf libuutil libgen libsmbios
507 # The following dependencies don't need to be listed below as they are built
508 # before everything else:
509 # libc libm libmd libmp libnsl libnvpair
510 abi: libctf libmapmalloc libproc
511 auditd_plugins: libbsm libsecdb libgss libmtmalloc
512 brand: libzonecfg libmapmalloc
513 cfgadm_plugins: libdevice libdevinfo libhotplug librcm hbaapi libkstat libscf
514 fm: libexacct libipmi libzfs scsi libdevinfo libdevid libcfgadm \
515 libcontract libsysevent ../cmd/sgs/libelf
516 hal: libbsm
517 $(SPARC_BLD)fm: libpri
518 gss_mechs/mech_dh: libgss
519 gss_mechs/mech_dummy: libgss
520 gss_mechs/mech_krb5: libgss libresolv2 pkcs11 libkstat
521 gss_mechs/mech_spnego: gss_mechs/mech_krb5
522 hal: dbusdeps
523 krb5: gss_mechs/mech_krb5 libtecla libldap5
524 libadutils: libldap5 libresolv2
525 libbe: libzfs libzonecfg libuuid libgen libdevinfo libefi libficl
526 libbsm: libinetutil libscf libsecdb
527 libcfgadm: libdevinfo
528 libcmd: libsum libast
529 libcmdutils: libavl
530 libcpc: libpctx
531 libcrypt: libgen
532 libctf: libdwarf
533 libdevid: libdevinfo
534 libdevinfo: libsec libgen
535 libdhcpagent: libdhcputil libuuid libdlpi libcontract
536 libdhcputil: libgen libinetutil libdlpi
537 libdiskmgt: libdevid libdevinfo libadm libefi libkstat libsysevent
538 $(INTEL_BLD)libdiskmgt: libfdisk
539 libdladm: libdevinfo libinetutil libscf librcm libexacct libkstat \
540 libpool
541 libdll: libast
542 libdlpi: libinetutil libdladm
543 libds: libsysevent
544 libdtrace: libproc libgen libctf libmapmalloc
545 libefi: libuuid
546 libelfsign: libcryptoutil libkmf ../cmd/sgs/libelf
547 libexacct/demo: libexacct libproject
548 libfcoe: libdladm
549 libficl: libuuid libumem
550 libfru: libfruutils
551 libfsmgt: libkstat
552 libidmap: libavl libuutil
553 libinetsvc: libscf
554 libipadm: libinetutil libdlpi libdhcpagent libdladm libsecdb libdhcputil
555 libipmp: libinetutil
556 libipsecutil: libtecla
557 libiscsit: libstmf libuuid
558 libkmf: libcryptoutil pkcs11
559 libkvm: ../cmd/sgs/libelf
560 libldap5: libsasl
561 libmapid: libresolv2 libscf
562 libndmp: libscf
563 libnisdb: libldap5
564 libnwam: libscf libbsm libdladm libipadm
565 libpcp: libumem libdevinfo
566 libpctx: libproc
567 libpool: libscf libexacct
568 libpp: libast
569 libproc: ../cmd/sgs/librtld_db ../cmd/sgs/libelf libctf
570 $(INTEL_BLD)libproc: libsaveargs
571 libproject: libpool libproc libsecdb
572 libprtdiag: libkstat
573 libprtdiag_psr: libprtdiag
574 libraidcfg: libdevinfo
575 librestart: libuutil libscf libpool libproject libsecdb libsysevent
576 libsasl: libgss pkcs11
577 libsaveargs: libdisasm
578 libscf: libuutil libgen libsmbios
579 libsec: libavl libidmap
580 libshare: libscf libzfs libuuid libfsmgt libsecdb libumem libsmbfs
581 libshell: libast libcmd libdll libsecdb
582 libsip: libmd5
583 libsldap: libldap5 libscf
584 libsmbfs: libkrb5 libsec libidmap pkcs11
585 libsmbios: libdevinfo
586 libsrpt: libstmf
587 libstmf: libscf
588 libsum: libast
589 libsun_ima: libdevinfo libsysevent
590 libsysevent: libsecdb
591 libtsalarm: libpcp
592 libuuid: libdlpi
593 libv12n: libds libuuid
594 libvolmgt: libadm
595 libvrrpadm: libdladm libscf
596 libvscan: libscf libsecdb
597 libzfs: libdevid libgen libuutil libadm libavl libefi libidmap \
598 libumem libzfs_core
599 libzonecfg: libuuid libsysevent libsec libbrand libpool libscf libproc \
600 libuutil libbsm libsecdb
601 libzonestat: libcmdutils libumem
602 libzpool: libavl libumem libcmdutils libsysevent
603 madv: libgen
604 mpapi: libpthread libdevinfo libsysevent
605 mpss: libgen
606 nsswitch: libadutils libidmap libdns_sd libscf libldap5 libsldap
607 pam_modules: libproject passwdutil smbsrv libpam libbsm libsecdb
608 passwdutil: libsldap
609 pkcs11: libcryptoutil libgen libuuid
610 policykit: dbusdeps
611 pylibbe: libbe libzfs
612 pysolaris: libsec libidmap
613 pyzfs: libzfs
614 raidcfg_plugins: libraidcfg librcm libcfgadm libpicl libpicltree
615 rpcsec_gss: libgss
616 sasl_plugins: pkcs11 libgss libsasl
617 scsi: libfru libumem libdevid libdevinfo
618 smbsrv: libpthread librt libshare libidmap pkcs11 libsqlite \
619 libcryptoutil libreparse libcmdutils libresolv2 libsmbfs \
620 libuuid libads libgss libldap5 krb5
621 storage: libdevice libdevinfo libdevid
622 sun_fc: libdevinfo libsysevent
623 sun_sas: libdevinfo libsysevent libkstat libdevid
624 udapl: libdevinfo libdladm
627 # The reason this rule checks for the existence of the
628 # Makefile is that some of the directories do not exist
629 # in certain situations (e.g., exportable source builds,
630 # OpenSolaris).
632 $(SUBDIRS): FRC
633 @if [ -f $@/Makefile ]; then \
634 cd $@; pwd; $(MAKE) $(TARGET); \
635 else \
636 true; \
639 $(SUBDIRS:%=%-nodepend):
640 @if [ -f $(@:%-nodepend=%)/Makefile ]; then \
641 cd $(@:%-nodepend=%); pwd; $(MAKE) $(TARGET); \
642 else \
643 true; \
646 FRC: