lib: remove sparc-only libs
[unleashed.git] / usr / src / lib / Makefile
blob7588e7e1b7ba12f546a5aab63a93ecc620299c67
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 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 libcustr \
103 libdevice \
104 libdevid \
105 libdevinfo \
106 libdhcpagent \
107 libdhcputil \
108 libdisasm \
109 libdiskmgt \
110 libdladm \
111 libdll \
112 libdlpi \
113 libdns_sd \
114 libdoor \
115 libdtrace \
116 libdwarf \
117 libefi \
118 libelfsign \
119 libeti \
120 libexacct \
121 libexacct/demo \
122 libfcoe \
123 libficl \
124 libfru \
125 libfruutils \
126 libfsmgt \
127 libfstyp \
128 libgen \
129 libgss \
130 libhotplug \
131 libidmap \
132 libilb \
133 libima \
134 libinetsvc \
135 libinetutil \
136 libintl \
137 libipadm \
138 libipd \
139 libipmi \
140 libipmp \
141 libipp \
142 libipsecutil \
143 libiscsit \
144 libkmf \
145 libkrb5 \
146 libkstat \
147 libkvm \
148 libldap5 \
149 liblgrp \
150 liblm \
151 libmail \
152 libmalloc \
153 libmapid \
154 libmapmalloc \
155 libmd5 \
156 libmlrpc \
157 libmtmalloc \
158 libmvec \
159 libndmp \
160 libnisdb \
161 libnls \
162 libnwam \
163 libofmt \
164 libpam \
165 libpcidb \
166 libpctx \
167 libpicl \
168 libpicltree \
169 libpool \
170 libpp \
171 libproc \
172 libproject \
173 libpthread \
174 libraidcfg \
175 librcm \
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 libsff \
192 libshare \
193 libshell \
194 libsip \
195 libsldap \
196 libsmbfs \
197 libsmbios \
198 libsmedia \
199 libsqlite \
200 libsrpt \
201 libstmf \
202 libsum \
203 libsun_ima \
204 libsys \
205 libsysevent \
206 libtecla \
207 libthread \
208 libumem \
209 libuuid \
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 raidcfg_plugins \
232 rpcsec_gss \
233 sasl_plugins \
234 scsi \
235 smbsrv \
236 smhba \
237 sun_fc \
238 sun_sas \
239 udapl \
240 watchmalloc \
241 $($(MACH)_SUBDIRS)
243 i386_SUBDIRS= \
244 libfdisk \
245 libsaveargs
248 # Create a special version of $(SUBDIRS) with no .WAIT's, for use with the
249 # clean and clobber targets (for more information, see those targets, below).
251 NOWAIT_SUBDIRS= $(SUBDIRS:.WAIT=)
253 DCSUBDIRS=
255 MSGSUBDIRS= \
256 abi \
257 auditd_plugins \
258 brand \
259 cfgadm_plugins \
260 gss_mechs/mech_dh \
261 gss_mechs/mech_krb5 \
262 krb5 \
263 libast \
264 libbsm \
265 libc \
266 libcfgadm \
267 libcmd \
268 libcontract \
269 libdhcputil \
270 libdiskmgt \
271 libdladm \
272 libdll \
273 libgss \
274 libidmap \
275 libilb \
276 libipadm \
277 libipmp \
278 libipsecutil \
279 libldap5 \
280 libnwam \
281 libofmt \
282 libpam \
283 libpicl \
284 libpool \
285 libpp \
286 libreparse \
287 libsasl \
288 libscf \
289 libsecdb \
290 libshare \
291 libshell \
292 libsldap \
293 libsmbfs \
294 libsmedia \
295 libsum \
296 libvrrpadm \
297 libvscan \
298 libzfs \
299 libzonecfg \
300 madv \
301 mpss \
302 pam_modules \
303 rpcsec_gss \
304 $($(MACH)_MSGSUBDIRS)
306 i386_MSGSUBDIRS= libfdisk
308 HDRSUBDIRS= \
309 auditd_plugins \
310 fm \
311 hal \
312 hbaapi \
313 libads \
314 libast \
315 libbrand \
316 libbsm \
317 libc \
318 libcmd \
319 libcmdutils \
320 libcommputil \
321 libcontract \
322 libcpc \
323 libcryptoutil \
324 libctf \
325 libcustr \
326 libdevice \
327 libdevid \
328 libdevinfo \
329 libdhcpagent \
330 libdhcputil \
331 libdisasm \
332 libdiskmgt \
333 libdwarf \
334 libdladm \
335 libdll \
336 libdlpi \
337 libdns_sd \
338 libdtrace \
339 libelfsign \
340 libeti \
341 libfcoe \
342 libfru \
343 libfstyp \
344 libgen \
345 libidmap \
346 libilb \
347 libima \
348 libinetsvc \
349 libinetutil \
350 libipadm \
351 libipd \
352 libipmi \
353 libipmp \
354 libipp \
355 libipsecutil \
356 libiscsit \
357 libkrb5 \
358 libkstat \
359 libkvm \
360 libmail \
361 libmapid \
362 libmd \
363 libmlrpc \
364 libmtmalloc \
365 libndmp \
366 libnvpair \
367 libnwam \
368 libofmt \
369 libpam \
370 libpcidb \
371 libpctx \
372 libpicl \
373 libpicltree \
374 libpool \
375 libpp \
376 libproc \
377 libraidcfg \
378 librcm \
379 libreparse \
380 librestart \
381 librpcsvc \
382 librsm \
383 librstp \
384 libsasl \
385 libscf \
386 libsec \
387 libsff \
388 libshare \
389 libshell \
390 libsip \
391 libsmbfs \
392 libsmbios \
393 libsmedia \
394 libsqlite \
395 libsrpt \
396 libstmf \
397 libsum \
398 libsun_ima \
399 libsysevent \
400 libtecla \
401 libumem \
402 libvolmgt \
403 libvrrpadm \
404 libvscan \
405 libwrap \
406 libzfs \
407 libzfs_core \
408 libzonestat \
409 mpapi \
410 passwdutil \
411 pkcs11 \
412 policykit \
413 scsi \
414 smbsrv \
415 smhba \
416 udapl \
417 $($(MACH)_HDRSUBDIRS)
419 i386_HDRSUBDIRS= \
420 libfdisk \
421 libsaveargs
423 all := TARGET= all
424 check := TARGET= check
425 clean := TARGET= clean
426 clobber := TARGET= clobber
427 install := TARGET= install
428 install_h := TARGET= install_h
429 _dc := TARGET= _dc
430 _msg := TARGET= _msg
432 .KEEP_STATE:
435 # For the all and install targets, we clearly must respect library
436 # dependencies so that the libraries link correctly. However, for
437 # the remaining targets (check, clean, clobber, install_h, _dc, and
438 # _msg), libraries do not have any dependencies on one another and
439 # thus respecting dependencies just slows down the build. As such,
440 # for these rules, we use pattern replacement to explicitly avoid
441 # triggering the dependency information. Note that for clean and
442 # clobber, we must use $(NOWAIT_SUBDIRS) rather than $(SUBDIRS),
443 # to prevent `.WAIT' from expanding to `.WAIT-nodepend'.
446 all: $(SUBDIRS)
448 install: $(SUBDIRS) .WAIT install_extra
450 # extra libraries kept in other source areas
451 install_extra:
452 @cd ../cmd/sgs; pwd; $(MAKE) install_lib
453 @pwd
455 clean clobber: $(NOWAIT_SUBDIRS:%=%-nodepend)
457 install_h check: $(HDRSUBDIRS:%=%-nodepend)
459 _msg: $(MSGSUBDIRS:%=%-nodepend) .WAIT _dc
461 _dc: $(DCSUBDIRS:%=%-nodepend)
463 # Library interdependencies are called out explicitly here.
464 ../cmd/sgs/libconv: crt
465 ../cmd/sgs/libdl: crt
466 libc: ../cmd/sgs/libconv ../cmd/sgs/libdl
468 libm: libc
469 libmd: libc
470 libmp: libc
471 libnsl: libc libmd libmp
472 libnvpair: libc libnsl
474 basedeps: libc libm libmd libmp libnsl libnvpair
475 basedeps := TARGET=install
477 # The following dependencies are currently required by libdbus-1 and should
478 # be used for anything linking against it.
479 dbusdeps: libsecdb libinetutil libscf libgen libsmbios
481 # The following dependencies don't need to be listed below as they are built
482 # before everything else:
483 # libc libm libmd libmp libnsl libnvpair
484 abi: libctf libmapmalloc libproc
485 auditd_plugins: libbsm libsecdb libgss libmtmalloc
486 brand: libzonecfg libmapmalloc
487 cfgadm_plugins: libdevice libdevinfo libhotplug librcm hbaapi libkstat libscf
488 fm: libexacct libipmi libzfs scsi libdevinfo libdevid libcfgadm \
489 libcontract libsysevent ../cmd/sgs/libelf libdladm libsff \
490 libpcidb
491 hal: libbsm
492 gss_mechs/mech_dh: libgss
493 gss_mechs/mech_dummy: libgss
494 gss_mechs/mech_krb5: libgss libresolv2 pkcs11 libkstat
495 gss_mechs/mech_spnego: gss_mechs/mech_krb5
496 hal: dbusdeps
497 krb5: gss_mechs/mech_krb5 libtecla libldap5
498 libadutils: libldap5 libresolv2
499 libbe: libzfs libzonecfg libuuid libgen libdevinfo libefi libficl
500 libbsm: libinetutil libscf libsecdb
501 libcfgadm: libdevinfo
502 libcmd: libsum libast
503 libcmdutils: libavl
504 libcpc: libpctx
505 libcrypt: libgen
506 libctf: libdwarf
507 libdevid: libdevinfo
508 libdevinfo: libsec libgen
509 libdhcpagent: libdhcputil libuuid libdlpi libcontract
510 libdhcputil: libgen libinetutil libdlpi
511 libdiskmgt: libdevid libdevinfo libadm libefi libkstat libsysevent
512 $(INTEL_BLD)libdiskmgt: libfdisk
513 libdladm: libdevinfo libinetutil libscf librcm libexacct libkstat \
514 libpool
515 libdll: libast
516 libdlpi: libinetutil libdladm
517 libdtrace: libproc libgen libctf libmapmalloc
518 libefi: libuuid libsmbios
519 libelfsign: libcryptoutil libkmf ../cmd/sgs/libelf
520 libexacct/demo: libexacct libproject
521 libfcoe: libdladm
522 libficl: libuuid libumem
523 libfru: libfruutils
524 libfsmgt: libkstat
525 libidmap: libavl
526 libinetsvc: libscf
527 libipadm: libinetutil libdlpi libdhcpagent libdladm libsecdb libdhcputil
528 libipmp: libinetutil
529 libipsecutil: libtecla
530 libiscsit: libstmf libuuid
531 libkmf: libcryptoutil pkcs11
532 libkvm: ../cmd/sgs/libelf
533 libldap5: libsasl
534 libmapid: libresolv2 libscf
535 libmlrpc: libsmbfs libuuid
536 libndmp: libscf
537 libnisdb: libldap5
538 libnwam: libscf libbsm libdladm libipadm
539 libpctx: libproc
540 libpool: libscf libexacct
541 libpp: libast
542 libproc: ../cmd/sgs/librtld_db ../cmd/sgs/libelf libctf
543 $(INTEL_BLD)libproc: libsaveargs
544 libproject: libpool libproc libsecdb
545 libraidcfg: libdevinfo
546 librestart: libscf libpool libproject libsecdb libsysevent
547 libsasl: libgss pkcs11
548 libsaveargs: libdisasm
549 libscf: libgen libsmbios
550 libsec: libavl libidmap
551 libsff: libnvpair
552 libshare: libscf libzfs libuuid libfsmgt libsecdb libumem libsmbfs
553 libshell: libast libcmd libdll libsecdb
554 libsip: libmd5
555 libsldap: libldap5 libscf
556 libsmbfs: libkrb5 libsec libidmap pkcs11
557 libsmbios: libdevinfo
558 libsrpt: libstmf
559 libstmf: libscf
560 libsum: libast
561 libsun_ima: libdevinfo libsysevent
562 libsysevent: libsecdb
563 libuuid: libdlpi
564 libvolmgt: libadm
565 libvrrpadm: libdladm libscf
566 libvscan: libscf libsecdb
567 libzfs: libdevid libgen libadm libavl libefi libidmap \
568 libumem libzfs_core
569 libzonecfg: libuuid libsysevent libsec libbrand libpool libscf libproc \
570 libbsm libsecdb
571 libzonestat: libcmdutils libumem
572 libzpool: libavl libumem libcmdutils libsysevent
573 madv: libgen
574 mpapi: libpthread libdevinfo libsysevent
575 mpss: libgen
576 nsswitch: libadutils libidmap libdns_sd libscf libldap5 libsldap
577 pam_modules: libproject passwdutil smbsrv libpam libbsm libsecdb
578 passwdutil: libsldap
579 pkcs11: libcryptoutil libgen libuuid
580 policykit: dbusdeps
581 pylibbe: libbe libzfs
582 raidcfg_plugins: libraidcfg librcm libcfgadm libpicl libpicltree
583 rpcsec_gss: libgss
584 sasl_plugins: pkcs11 libgss libsasl
585 scsi: libfru libumem libdevid libdevinfo
586 smbsrv: libpthread librt libshare libidmap pkcs11 libsqlite \
587 libcryptoutil libreparse libcmdutils libresolv2 libsmbfs \
588 libuuid libads libgss libldap5 krb5 libmlrpc
589 sun_fc: libdevinfo libsysevent
590 sun_sas: libdevinfo libsysevent libkstat libdevid
591 udapl: libdevinfo libdladm
594 # The reason this rule checks for the existence of the
595 # Makefile is that some of the directories do not exist
596 # in certain situations (e.g., exportable source builds,
597 # OpenSolaris).
599 $(SUBDIRS): FRC
600 @if [ -f $@/Makefile ]; then \
601 cd $@; pwd; $(MAKE) $(TARGET); \
602 else \
603 true; \
606 $(SUBDIRS:%=%-nodepend):
607 @if [ -f $(@:%-nodepend=%)/Makefile ]; then \
608 cd $(@:%-nodepend=%); pwd; $(MAKE) $(TARGET); \
609 else \
610 true; \
613 FRC: