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