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