dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / lib / Makefile
blobe9754a438654124ca1065a559ffac322fcc70e55
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.
33 include ../Makefile.master
35 # Note that libcurses installs commands along with its library.
36 # This is a minor bug which probably should be fixed.
37 # Note also that a few extra libraries are kept in cmd source.
39 # Certain libraries are linked with, hence depend on, other libraries.
40 # Library dependencies are called out explicitly, see "Library
41 # interdependencies" below.
42 .PARALLEL:
44 # Build libc and its dependencies
45 SUBDIRS= \
46 crt \
47 ../cmd/sgs/libconv \
48 ../cmd/sgs/libdl \
49 libc \
50 .WAIT
52 # Build libraries with lots of dependents
53 SUBDIRS += \
54 libm \
55 libmd \
56 libmp \
57 libnsl \
58 libnvpair \
59 libsocket \
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 c_synonyms \
71 cfgadm_plugins \
72 crypt_modules \
73 extendedFILE \
74 fm \
75 getloginx \
76 gss_mechs/mech_dh \
77 gss_mechs/mech_dummy \
78 gss_mechs/mech_krb5 \
79 gss_mechs/mech_spnego \
80 hal \
81 hbaapi \
82 krb5 \
83 libadm \
84 libads \
85 libadutils \
86 libaio \
87 libast \
88 libavl \
89 libbe \
90 libbrand \
91 libbsdmalloc \
92 libbsm \
93 libc_db \
94 libcfgadm \
95 libcmd \
96 libcmdutils \
97 libcommputil \
98 libcontract \
99 libcpc \
100 libcrypt \
101 libcryptoutil \
102 libctf \
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 libm1 \
152 libmail \
153 libmalloc \
154 libmapid \
155 libmapmalloc \
156 libmd5 \
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 librdc \
177 libreparse \
178 libresolv \
179 libresolv2 \
180 librestart \
181 librpcsvc \
182 librsm \
183 librstp \
184 librt \
185 libsasl \
186 libscf \
187 libsched \
188 libsctp \
189 libsec \
190 libsecdb \
191 libsendfile \
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 libuutil \
211 libvolmgt \
212 libvrrpadm \
213 libvscan \
214 libw \
215 libwrap \
216 libxnet \
217 libzfs \
218 libzfs_core \
219 libzonecfg \
220 libzonestat \
221 libzpool \
222 madv \
223 mpapi \
224 mpss \
225 nametoaddr \
226 ncad_addr \
227 nsswitch \
228 pam_modules \
229 passwdutil \
230 pkcs11 \
231 policykit \
232 pylibbe \
233 pysolaris \
234 pyzfs \
235 raidcfg_plugins \
236 rpcsec_gss \
237 sasl_plugins \
238 scsi \
239 smbsrv \
240 smhba \
241 sun_fc \
242 sun_sas \
243 udapl \
244 watchmalloc \
245 $($(MACH)_SUBDIRS)
247 i386_SUBDIRS= \
248 libfdisk \
249 libsaveargs
251 sparc_SUBDIRS= \
252 efcode \
253 libds \
254 libdscp \
255 libprtdiag \
256 libprtdiag_psr \
257 libpri \
258 librsc \
259 storage \
260 libpcp \
261 libtsalarm \
262 libv12n
265 # Create a special version of $(SUBDIRS) with no .WAIT's, for use with the
266 # clean and clobber targets (for more information, see those targets, below).
268 NOWAIT_SUBDIRS= $(SUBDIRS:.WAIT=)
270 DCSUBDIRS=
272 MSGSUBDIRS= \
273 abi \
274 auditd_plugins \
275 brand \
276 cfgadm_plugins \
277 gss_mechs/mech_dh \
278 gss_mechs/mech_krb5 \
279 krb5 \
280 libast \
281 libbsm \
282 libc \
283 libcfgadm \
284 libcmd \
285 libcontract \
286 libdhcputil \
287 libdiskmgt \
288 libdladm \
289 libdll \
290 libgss \
291 libidmap \
292 libilb \
293 libipadm \
294 libipmp \
295 libipsecutil \
296 libldap5 \
297 libnwam \
298 libofmt \
299 libpam \
300 libpicl \
301 libpool \
302 libpp \
303 libreparse \
304 libsasl \
305 libscf \
306 libsecdb \
307 libshare \
308 libshell \
309 libsldap \
310 libsmbfs \
311 libsmedia \
312 libsum \
313 libuutil \
314 libvrrpadm \
315 libvscan \
316 libzfs \
317 libzonecfg \
318 madv \
319 mpss \
320 pam_modules \
321 rpcsec_gss \
322 $($(MACH)_MSGSUBDIRS)
324 sparc_MSGSUBDIRS= \
325 libprtdiag \
326 libprtdiag_psr
328 i386_MSGSUBDIRS= libfdisk
330 HDRSUBDIRS= \
331 auditd_plugins \
332 fm \
333 hal \
334 hbaapi \
335 libads \
336 libast \
337 libbrand \
338 libbsm \
339 libc \
340 libcmd \
341 libcmdutils \
342 libcommputil \
343 libcontract \
344 libcpc \
345 libcryptoutil \
346 libctf \
347 libdevice \
348 libdevid \
349 libdevinfo \
350 libdhcpagent \
351 libdhcputil \
352 libdisasm \
353 libdiskmgt \
354 libdwarf \
355 libdladm \
356 libdll \
357 libdlpi \
358 libdns_sd \
359 libdtrace \
360 libelfsign \
361 libeti \
362 libfcoe \
363 libfru \
364 libfstyp \
365 libgen \
366 libidmap \
367 libilb \
368 libima \
369 libinetsvc \
370 libinetutil \
371 libipadm \
372 libipd \
373 libipmi \
374 libipmp \
375 libipp \
376 libipsecutil \
377 libiscsit \
378 libkrb5 \
379 libkstat \
380 libkvm \
381 libmail \
382 libmapid \
383 libmd \
384 libmtmalloc \
385 libndmp \
386 libnvpair \
387 libnwam \
388 libofmt \
389 libpam \
390 libpcidb \
391 libpctx \
392 libpicl \
393 libpicltree \
394 libpool \
395 libpp \
396 libproc \
397 libraidcfg \
398 librcm \
399 librdc \
400 libreparse \
401 librestart \
402 librpcsvc \
403 librsm \
404 librstp \
405 libsasl \
406 libscf \
407 libsec \
408 libshare \
409 libshell \
410 libsip \
411 libsmbfs \
412 libsmbios \
413 libsmedia \
414 libsqlite \
415 libsrpt \
416 libstmf \
417 libsum \
418 libsun_ima \
419 libsysevent \
420 libtecla \
421 libumem \
422 libuutil \
423 libvolmgt \
424 libvrrpadm \
425 libvscan \
426 libwrap \
427 libzfs \
428 libzfs_core \
429 libzonestat \
430 mpapi \
431 passwdutil \
432 pkcs11 \
433 policykit \
434 scsi \
435 smbsrv \
436 smhba \
437 udapl \
438 $($(MACH)_HDRSUBDIRS)
440 i386_HDRSUBDIRS= \
441 libfdisk \
442 libsaveargs
444 sparc_HDRSUBDIRS= \
445 libds \
446 libdscp \
447 libpri \
448 libv12n \
449 storage
451 all := TARGET= all
452 check := TARGET= check
453 clean := TARGET= clean
454 clobber := TARGET= clobber
455 install := TARGET= install
456 install_h := TARGET= install_h
457 _dc := TARGET= _dc
458 _msg := TARGET= _msg
460 .KEEP_STATE:
463 # For the all and install targets, we clearly must respect library
464 # dependencies so that the libraries link correctly. However, for
465 # the remaining targets (check, clean, clobber, install_h, _dc, and
466 # _msg), libraries do not have any dependencies on one another and
467 # thus respecting dependencies just slows down the build. As such,
468 # for these rules, we use pattern replacement to explicitly avoid
469 # triggering the dependency information. Note that for clean and
470 # clobber, we must use $(NOWAIT_SUBDIRS) rather than $(SUBDIRS),
471 # to prevent `.WAIT' from expanding to `.WAIT-nodepend'.
474 all: $(SUBDIRS)
476 install: $(SUBDIRS) .WAIT install_extra
478 # extra libraries kept in other source areas
479 install_extra:
480 @cd ../cmd/sgs; pwd; $(MAKE) install_lib
481 @pwd
483 clean clobber: $(NOWAIT_SUBDIRS:%=%-nodepend)
485 install_h check: $(HDRSUBDIRS:%=%-nodepend)
487 _msg: $(MSGSUBDIRS:%=%-nodepend) .WAIT _dc
489 _dc: $(DCSUBDIRS:%=%-nodepend)
491 # Library interdependencies are called out explicitly here.
492 ../cmd/sgs/libconv: crt
493 ../cmd/sgs/libdl: crt
494 libc: ../cmd/sgs/libconv ../cmd/sgs/libdl
496 libm: libc
497 libmd: libc
498 libmp: libc
499 libnsl: libc libmd libmp
500 libnvpair: libc libnsl
501 libsocket: libc libnsl
503 basedeps: libc libm libmd libmp libnsl libnvpair libsocket
504 basedeps := TARGET=install
506 # The following dependencies are currently required by libdbus-1 and should
507 # be used for anything linking against it.
508 dbusdeps: libsecdb libinetutil libscf libuutil libgen libsmbios
510 # The following dependencies don't need to be listed below as they are built
511 # before everything else:
512 # libc libm libmd libmp libnsl libnvpair libsocket
513 abi: libctf libmapmalloc libproc
514 auditd_plugins: libbsm libsecdb libgss libmtmalloc
515 brand: libzonecfg libmapmalloc
516 cfgadm_plugins: libdevice libdevinfo libhotplug librcm hbaapi libkstat libscf
517 fm: libexacct libipmi libzfs scsi libdevinfo libdevid libcfgadm \
518 libcontract libsysevent ../cmd/sgs/libelf
519 hal: libbsm
520 $(SPARC_BLD)fm: libpri
521 gss_mechs/mech_dh: libgss
522 gss_mechs/mech_dummy: libgss
523 gss_mechs/mech_krb5: libgss libresolv2 pkcs11 libkstat
524 gss_mechs/mech_spnego: gss_mechs/mech_krb5
525 hal: dbusdeps
526 krb5: gss_mechs/mech_krb5 libtecla libldap5
527 libadutils: libldap5 libresolv2
528 libbe: libzfs libzonecfg libuuid libgen libdevinfo libefi libficl
529 libbsm: libinetutil libscf libsecdb
530 libcfgadm: libdevinfo
531 libcmd: libsum libast
532 libcmdutils: libavl
533 libcpc: libpctx
534 libcrypt: libgen
535 libctf: libdwarf
536 libdevid: libdevinfo
537 libdevinfo: libsec libgen
538 libdhcpagent: libdhcputil libuuid libdlpi libcontract
539 libdhcputil: libgen libinetutil libdlpi
540 libdiskmgt: libdevid libdevinfo libadm libefi libkstat libsysevent
541 $(INTEL_BLD)libdiskmgt: libfdisk
542 libdladm: libdevinfo libinetutil libscf librcm libexacct libkstat \
543 libpool
544 libdll: libast
545 libdlpi: libinetutil libdladm
546 libds: libsysevent
547 libdtrace: libproc libgen libctf libmapmalloc
548 libefi: libuuid
549 libelfsign: libcryptoutil libkmf ../cmd/sgs/libelf
550 libexacct/demo: libexacct libproject
551 libfcoe: libdladm
552 libficl: libuuid libumem
553 libfru: libfruutils
554 libfsmgt: libkstat
555 libidmap: libavl libuutil
556 libinetsvc: libscf
557 libipadm: libinetutil libdlpi libdhcpagent libdladm libsecdb
558 libipmp: libinetutil
559 libipsecutil: libtecla
560 libiscsit: libstmf libuuid
561 libkmf: libcryptoutil pkcs11
562 libkvm: ../cmd/sgs/libelf
563 libldap5: libsasl
564 libmapid: libresolv2 libscf
565 libndmp: libscf
566 libnisdb: libldap5
567 libnwam: libscf libbsm libdladm
568 libpcp: libumem libdevinfo
569 libpctx: libproc
570 libpool: libscf libexacct
571 libpp: libast
572 libproc: ../cmd/sgs/librtld_db ../cmd/sgs/libelf libctf
573 $(INTEL_BLD)libproc: libsaveargs
574 libproject: libpool libproc libsecdb
575 libprtdiag: libkstat
576 libprtdiag_psr: libprtdiag
577 libraidcfg: libdevinfo
578 librestart: libuutil libscf libpool libproject libsecdb libsysevent
579 libsasl: libgss pkcs11
580 libsaveargs: libdisasm
581 libscf: libuutil libgen libsmbios
582 libsec: libavl libidmap
583 libshare: libscf libzfs libuuid libfsmgt libsecdb libumem libsmbfs
584 libshell: libast libcmd libdll libsecdb
585 libsip: libmd5
586 libsldap: libldap5 libscf
587 libsmbfs: libkrb5 libsec libidmap pkcs11
588 libsmbios: libdevinfo
589 libsrpt: libstmf
590 libstmf: libscf
591 libsum: libast
592 libsun_ima: libdevinfo libsysevent
593 libsysevent: libsecdb
594 libtsalarm: libpcp
595 libuuid: libdlpi
596 libv12n: libds libuuid
597 libvolmgt: libadm
598 libvrrpadm: libdladm libscf
599 libvscan: libscf libsecdb
600 libzfs: libdevid libgen libuutil libadm libavl libefi libidmap \
601 libumem libzfs_core
602 libzonecfg: libuuid libsysevent libsec libbrand libpool libscf libproc \
603 libuutil libbsm libsecdb
604 libzonestat: libcmdutils libumem
605 libzpool: libavl libumem libcmdutils libsysevent
606 madv: libgen
607 mpapi: libpthread libdevinfo libsysevent
608 mpss: libgen
609 nsswitch: libadutils libidmap libdns_sd libscf libldap5 libsldap
610 pam_modules: libproject passwdutil smbsrv libpam libbsm libsecdb
611 passwdutil: libsldap
612 pkcs11: libcryptoutil libgen libuuid
613 policykit: dbusdeps
614 pylibbe: libbe libzfs
615 pysolaris: libsec libidmap
616 pyzfs: libzfs
617 raidcfg_plugins: libraidcfg librcm libcfgadm libpicl libpicltree
618 rpcsec_gss: libgss
619 sasl_plugins: pkcs11 libgss libsasl
620 scsi: libfru libumem libdevid libdevinfo
621 smbsrv: libxnet libpthread librt libshare libidmap pkcs11 libsqlite \
622 libcryptoutil libreparse libcmdutils libresolv2 libsmbfs \
623 libuuid libads libgss libldap5 krb5
624 storage: libdevice libdevinfo libdevid
625 sun_fc: libdevinfo libsysevent
626 sun_sas: libdevinfo libsysevent libkstat libdevid
627 udapl: libdevinfo libdladm
630 # The reason this rule checks for the existence of the
631 # Makefile is that some of the directories do not exist
632 # in certain situations (e.g., exportable source builds,
633 # OpenSolaris).
635 $(SUBDIRS): FRC
636 @if [ -f $@/Makefile ]; then \
637 cd $@; pwd; $(MAKE) $(TARGET); \
638 else \
639 true; \
642 $(SUBDIRS:%=%-nodepend):
643 @if [ -f $(@:%-nodepend=%)/Makefile ]; then \
644 cd $(@:%-nodepend=%); pwd; $(MAKE) $(TARGET); \
645 else \
646 true; \
649 FRC: