# # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the "License"). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at usr/src/OPENSOLARIS.LICENSE. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets "[]" replaced with your own identifying # information: Portions Copyright [yyyy] [name of copyright owner] # # CDDL HEADER END # # # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2012 by Delphix. All rights reserved. # Copyright 2020 Joyent, Inc. # Copyright (c) 2013 Gary Mills # Copyright (c) 2015 Gary Mills # Copyright 2022 Garrett D'Amore # Copyright 2016 Toomas Soome # Copyright 2018 Nexenta Systems, Inc. # Copyright (c) 2016, Chris Fraire . # Copyright 2017 RackTop Systems. # Copyright 2018 Jason King # Copyright 2021 OmniOS Community Edition (OmniOSce) Association. # include ../Makefile.master # Note that libcurses installs commands along with its library. # This is a minor bug which probably should be fixed. # Note also that a few extra libraries are kept in cmd source. # # Certain libraries are linked with, hence depend on, other libraries. # Library dependencies are called out explicitly, see "Library # interdependencies" below. .PARALLEL: # Build libc and its dependencies SUBDIRS= \ ssp_ns \ crt \ ../cmd/sgs/libconv \ ../cmd/sgs/libdl \ libc \ .WAIT # Build core libraries with lots of dependents. # libnvpair and libsocket depend on libnsl but must not be in the same # .WAIT group — gmake -k may skip unstarted parallel targets when one # fails. Using explicit dependencies (below) ensures they still build. SUBDIRS += \ openssl \ libm \ libmd \ libmp \ libnsl \ libz \ .WAIT \ libnvpair \ libsocket \ libxml2 \ .WAIT # Build everything else. Aside from explicit dependencies, all libraries # are built in parallel. # Hammerhead: Phase A software audit removed (source trees deleted from # disk later — see corresponding 2026-06-01 cleanup commit): # libnisdb (NIS+ — d6193a2e39), libvolmgt (floppy/CD), # librsm (HPC), udapl (RDMA), libslp (SLP), # libnwam (auto-network), libgrubmgmt (legacy GRUB), # print (printing system), hal (HAL desktop devmgmt) # Hammerhead: sendmail/libmilter removed - MTA packaged separately # (cmd/sendmail/ source deleted 1d11fd5a26). # libvrrpadm (VRRP) remains in SUBDIRS — Phase-A removal comment was # aspirational; not actually removed. # Hammerhead: libreef moved from batch 2 to batch 3 — its build failure # was blocking the .WAIT barrier and preventing all of batch 3 from running. SUBDIRS += \ ../cmd/sgs/libelf \ ../cmd/sgs/librtld_db \ abi \ auditd_plugins \ brand \ c_synonyms \ cfgadm_plugins \ crypt_modules \ extendedFILE \ fm \ getloginx \ gss_mechs/mech_dh \ gss_mechs/mech_dummy \ gss_mechs/mech_krb5 \ gss_mechs/mech_spnego \ hbaapi \ iconv_modules \ krb5 \ libadm \ libads \ libadutils \ libaio \ libavl \ libbe \ libbrand \ libbsdmalloc \ libbsm \ libc_db \ libcfgadm \ libcmdutils \ libcommputil \ libcontract \ libcpc \ libcrypt \ libcryptoutil \ libctf \ libcurses \ libcustr \ libdemangle \ libdevice \ libdevid \ libdevinfo \ libdhcpagent \ libdhcputil \ libdisasm \ libdiskmgt \ libdladm \ libdlpi \ libdns_sd \ libdoor \ libdtrace \ libdwarf \ libefi \ libelfsign \ libeti \ libexacct \ libexacct/demo \ libfakekernel \ libfcoe \ libficl \ libfru \ libfruutils \ libfsmgt \ libfstyp \ libgen \ libgss \ libhotplug \ libi2c \ libidmap \ libidspace \ libilb \ libima \ libinetsvc \ libinetutil \ libinstzones \ libintl \ libipadm \ libipd \ libipmi \ libipmp \ libipp \ libipsecutil \ libiscsit \ libjedec \ libkmf \ libkrb5 \ libkstat \ libktest \ libkvm \ libldap5 \ liblgrp \ liblm \ libm1 \ libmail \ libmalloc \ libmapid \ libmapmalloc \ libmd5 \ libmlrpc \ libmtmalloc \ libmvec \ libndmp \ libnls \ libnvme \ libofmt \ libpam \ libpcidb \ libpcsc \ libpctx \ libpicl \ libpicltree \ libpkg \ libpool \ libproc \ libproject \ libpthread \ libraidcfg \ librcm \ libreef \ librename \ libreparse \ libresolv \ libresolv2 \ librestart \ librpcsvc \ librstp \ librt \ libsasl \ libscf \ libsched \ libsctp \ libsec \ libsecdb \ libsendfile \ libsff \ libshare \ libsip \ libsldap \ libsmbfs \ libsmbios \ libsmedia \ libsqlite \ libsrpt \ libstmf \ libstmfproxy \ libsun_ima \ libsysevent \ libtecla \ libtermcap \ libthread \ libtsnet \ libtsol \ libumem \ libutil \ libutempter \ libuuid \ libuutil \ libvscan \ libw \ libwrap \ libxcurses \ libxcurses2 \ libxnet \ libxpio \ libzfs \ libzfsbootenv \ libzfs_core \ libzonecfg \ libzoneinfo \ libzonestat \ libzpool \ libzutil \ madv \ mpapi \ mpss \ nametoaddr \ nsswitch \ pam_modules \ passwdutil \ pkcs11 \ raidcfg_plugins \ rpcsec_gss \ sasl_plugins \ scsi \ smbclnt \ smbsrv \ smhba \ sun_sas \ varpd \ watchmalloc \ $($(MACH)_SUBDIRS) i386_SUBDIRS= \ lib9p \ libfdisk \ libppt \ libsaveargs \ libvmm \ libvmmapi # Hammerhead: sparc_SUBDIRS removed - amd64 only build # # Create a special version of $(SUBDIRS) with no .WAIT's, for use with the # clean and clobber targets (for more information, see those targets, below). # NOWAIT_SUBDIRS= $(SUBDIRS:.WAIT=) DCSUBDIRS= MSGSUBDIRS= \ abi \ auditd_plugins \ brand \ cfgadm_plugins \ gss_mechs/mech_dh \ gss_mechs/mech_krb5 \ krb5 \ libbsm \ libc \ libcfgadm \ libcontract \ libcurses \ libdhcputil \ libdiskmgt \ libdladm \ libgss \ libidmap \ libilb \ libinstzones \ libipadm \ libipmp \ libipsecutil \ libldap5 \ libnsl \ libofmt \ libpam \ libpicl \ libpkg \ libpool \ libreparse \ libsasl \ libscf \ libsecdb \ libshare \ libsldap \ libsmbfs \ libsmedia \ libtsol \ libuutil \ libvscan \ libzfs \ libzonecfg \ madv \ mpss \ pam_modules \ rpcsec_gss \ $($(MACH)_MSGSUBDIRS) # Hammerhead: sparc_MSGSUBDIRS removed - amd64 only build i386_MSGSUBDIRS= libfdisk HDRSUBDIRS= \ auditd_plugins \ fm \ hbaapi \ libads \ libbrand \ libbsm \ libc \ libcmdutils \ libcommputil \ libcontract \ libcpc \ libcryptoutil \ libctf \ libcurses \ libcustr \ libdemangle \ libdevice \ libdevid \ libdevinfo \ libdhcpagent \ libdhcputil \ libdisasm \ libdiskmgt \ libdladm \ libdlpi \ libdns_sd \ libdtrace \ libelfsign \ libeti \ libfakekernel \ libfcoe \ libfru \ libfstyp \ libgen \ libi2c \ libidmap \ libidspace \ libilb \ libima \ libinetsvc \ libinetutil \ libinstzones \ libipadm \ libipd \ libipmi \ libipmp \ libipp \ libipsecutil \ libiscsit \ libkrb5 \ libkstat \ libktest \ libkvm \ libmail \ libmapid \ libmd \ libmlrpc \ libmtmalloc \ libndmp \ libnsl \ libnvme \ libnvpair \ libofmt \ libpam \ libpcidb \ libpcsc \ libpctx \ libpicl \ libpicltree \ libpool \ libproc \ libraidcfg \ librcm \ librename \ libreparse \ librestart \ librpcsvc \ librstp \ libsasl \ libscf \ libsec \ libsff \ libshare \ libsip \ libsmbfs \ libsmbios \ libsmedia \ libsocket \ libsqlite \ libsrpt \ libstmf \ libstmfproxy \ libsun_ima \ libsysevent \ libtecla \ libtermcap \ libtsnet \ libtsol \ libumem \ libutil \ libutempter \ libuutil \ libvscan \ libvrrpadm \ libwrap \ libxcurses2 \ libxpio \ libz \ libzfs \ libzfs_core \ libzoneinfo \ libzonestat \ mpapi \ passwdutil \ pkcs11 \ scsi \ smbsrv \ smhba \ varpd \ $($(MACH)_HDRSUBDIRS) i386_HDRSUBDIRS= \ lib9p \ libfdisk \ libppt \ libsaveargs \ libvmm \ libvmmapi # Hammerhead: sparc_HDRSUBDIRS removed - amd64 only build all : TARGET= all check : TARGET= check clean : TARGET= clean clobber : TARGET= clobber install : TARGET= install install_h : TARGET= install_h _dc : TARGET= _dc _msg : TARGET= _msg .KEEP_STATE: # # For the all and install targets, we clearly must respect library # dependencies so that the libraries link correctly. However, for # the remaining targets (check, clean, clobber, install_h, _dc # and _msg), libraries do not have any dependencies on one another # and thus respecting dependencies just slows down the build. # As such, for these rules, we use pattern replacement to explicitly # avoid triggering the dependency information. Note that for clean and # clobber, we must use $(NOWAIT_SUBDIRS) rather than # $(SUBDIRS), to prevent `.WAIT' from expanding to `.WAIT-nodepend'. # all: $(SUBDIRS) install: $(SUBDIRS) .WAIT install_extra # extra libraries kept in other source areas install_extra: @cd ../cmd/sgs; pwd; $(MAKE) install_lib @pwd clean clobber: $(NOWAIT_SUBDIRS:%=%-nodepend) install_h check: $(HDRSUBDIRS:%=%-nodepend) _msg: $(MSGSUBDIRS:%=%-nodepend) .WAIT _dc _dc: $(DCSUBDIRS:%=%-nodepend) # Library interdependencies are called out explicitly here. ../cmd/sgs/libconv: crt ../cmd/sgs/libdl: crt libc: ../cmd/sgs/libconv ../cmd/sgs/libdl openssl: libc libreef: libc libm: libc libmd: libc libmp: libc libnsl: libc libmd libmp # libnvpair and libsocket link against libnsl. The .WAIT barrier above # ensures libnsl is built first. Do NOT list libnsl as a prerequisite # here — if libnsl's _msg phase fails, gmake -k would refuse to start # any target that has libnsl as a dependency, even though the .so is fine. libnvpair: libc libsocket: libc libz: libc libxml2: libc libutil: libc basedeps: libc libm libmd libmp libnsl libnvpair libsocket basedeps : TARGET=install # The following dependencies are currently required by libdbus-1 and should # be used for anything linking against it. dbusdeps: libsecdb libtsol libinetutil libscf libuutil libgen libsmbios \ libbsm # The following dependencies don't need to be listed below as they are built # before everything else (guaranteed by .WAIT barriers). Do NOT list them # as prerequisites — gmake -k refuses to start targets whose prerequisites # have failed, and _msg phase failures in these libs would cascade to block # all dependents even though the .so files built successfully. # Excluded from prerequisite lists: libc libm libmd libmp libnsl libnvpair # libsocket libsec libgen libz libavl libuutil libumem abi: libctf libmapmalloc libproc auditd_plugins: libbsm libsecdb libgss libmtmalloc brand: libzonecfg libmapmalloc libxml2 cfgadm_plugins: libdevice libdevinfo libhotplug librcm hbaapi libkstat libscf # Hammerhead: scsi restored — topo ses module needs libses at link time. # scsi/libsmp build issues were fixed; if they recur, fix libsmp rather # than removing the prerequisite (which causes race conditions). fm: libexacct libipmi libzfs libdevinfo libdevid libcfgadm \ libcontract libsysevent ../cmd/sgs/libelf libdladm libsff \ libpcidb libdiskmgt libjedec libnvme libxml2 scsi # Hammerhead: SPARC fm:libpri dependency removed - amd64 only gss_mechs/mech_dh: libgss gss_mechs/mech_dummy: libgss gss_mechs/mech_krb5: libgss libresolv2 pkcs11 libkstat gss_mechs/mech_spnego: gss_mechs/mech_krb5 hal: dbusdeps krb5: gss_mechs/mech_krb5 libtecla libldap5 openssl lib9p: libsec libcustr libads: FRC # Hammerhead: libadt_jni removed (Java JNI library without proper build rules) libadutils: libldap5 libresolv2 libbe: libzfs libinstzones libuuid libgen libdevinfo libefi libficl \ libzfsbootenv libbsm: libinetutil libsecdb libtsol libcfgadm: libdevinfo libcontract: FRC libcmdutils: FRC libcpc: libpctx libcrypt: FRC libctf: libdwarf libdemangle: libcustr libdevice: FRC libdevid: libdevinfo libdevinfo: FRC libdhcpagent: libdhcputil libuuid libdlpi libcontract libdhcputil: libinetutil libdlpi libdiskmgt: libdevid libdevinfo libadm libefi libkstat libsysevent libfdisk libdladm: libinetutil librcm libexacct libkstat \ libpool varpd libdlpi: libinetutil # Hammerhead: libds removed (SPARC only) libdtrace: libproc libctf libmapmalloc # Hammerhead: libdtrace_jni removed (Java JNI - not needed for base OS) libdwarf: ../cmd/sgs/libelf libz libefi: libuuid libsmbios libelfsign: libcryptoutil libkmf ../cmd/sgs/libelf libeti: libcurses libexacct/demo: libexacct libproject libfakekernel: libcryptoutil libfcoe: libdladm libficl: libuuid libumem libz libfru: libfruutils libfsmgt: libkstat libi2c: libdevinfo libidmap: FRC libidspace: FRC libinetsvc: libscf libinetutil: FRC libinstzones: libzonecfg libcontract libipadm: libinetutil libdlpi libdhcpagent libdladm libsecdb libdhcputil \ libcmdutils libipmp libipmi: FRC libipmp: libinetutil libipsecutil: libtecla libtsol libkmf libiscsit: libstmf libuuid libhotplug: FRC libkmf: libcryptoutil pkcs11 libcustr openssl libxml2 libktest: FRC libkvm: ../cmd/sgs/libelf libldap5: libsasl libmapid: libresolv2 libscf libmlrpc: libsmbfs libuuid libndmp: libscf libnvme: libdevinfo # Hammerhead: libpcp removed (SPARC only) libpctx: libproc libpkg: libscf libadm libpool: libscf libexacct libxml2 libppt: libpcidb libdevinfo libcmdutils libproc: ../cmd/sgs/librtld_db ../cmd/sgs/libelf libctf libsaveargs libproject: libpool libproc libsecdb # Hammerhead: libprtdiag, libprtdiag_psr removed (SPARC only) libraidcfg: libdevinfo librcm: FRC librestart: libscf libpool libproject libsecdb libsysevent libsasl: libgss pkcs11 libsaveargs: libdisasm libscf: libsmbios libsec: libidmap libsecdb: FRC libsff: FRC libshare: libscf libzfs libuuid libfsmgt libsecdb libumem libsmbfs libxml2 libsip: libmd5 libsldap: libldap5 libscf # Hammerhead: libsmbfs links directly against mech_krb5.so (not filter libkrb5) libsmbfs: libkrb5 libsec libidmap pkcs11 gss_mechs/mech_krb5 libsmbios: FRC libsrpt: libstmf libstmf: libscf libstmfproxy: libstmf libpthread libsun_ima: libdevinfo libsysevent libsysevent: libsecdb libtecla: libcurses libtermcap: libcurses # Hammerhead: libtsalarm removed (SPARC only) libtsnet: libtsol libsecdb libtsol: libsecdb libuuid: libdlpi # Hammerhead: libv12n removed (SPARC only) libvmm: libvmmapi libvscan: libscf libsecdb libxpio: libdevinfo libnvpair libzfs: libdevid libefi libidmap \ libtsol libzfs_core libcryptoutil pkcs11 libzutil libzfsbootenv: libzfs libzfs_core: FRC # Hammerhead: libzfs_jni removed (Java JNI - not needed for base OS) libzonecfg: libuuid libsysevent libsec libbrand libpool libscf libproc \ libuutil libbsm libsecdb libxml2 libzonestat: libcmdutils libumem libzpool: libavl libumem libcmdutils libsysevent libfakekernel libzutil libz libzutil: libadm libavl libdevid libefi madv: libgen mpapi: libpthread libdevinfo libsysevent mpss: libgen nsswitch: libadutils libidmap libdns_sd libscf libldap5 libsldap # Hammerhead: pam_modules must NOT depend on smbsrv. Windows/SMB domain support # is not a prerequisite for logging in. The pam_smb/pam_smbfs modules (the only # consumers of smbsrv here) are dropped from SUBDIRS; nothing in /etc/pam.conf # references them. Previously a broken smbsrv (e.g. via krb5 <- openssl) silently # skipped ALL of pam_modules, leaving /usr/lib/security without pam_authtok_get.so.1 # and making console login fail exit=127. pam_modules: libproject passwdutil libtsnet libpam libbsm libsecdb passwdutil: libsldap pkcs11: libcryptoutil libuuid # Hammerhead: policykit removed (requires external glib/dbus dependencies) raidcfg_plugins: libraidcfg librcm libcfgadm libpicl libpicltree rpcsec_gss: libgss sasl_plugins: pkcs11 libgss libsasl scsi: libfru libumem libdevid libdevinfo smbclnt: libfakekernel pkcs11 smbsrv: libxnet libpthread librt libshare libidmap pkcs11 libsqlite \ libcryptoutil libreparse libcmdutils libresolv2 libsmbfs \ libuuid libfakekernel libads libgss libldap5 krb5 libmlrpc # Hammerhead: storage removed (SPARC only) # Hammerhead: sun_fc removed (requires fibre-channel driver) sun_sas: libdevinfo libsysevent libkstat libdevid varpd: libidspace libmd5 librename \ libcustr # # The reason this rule checks for the existence of the # Makefile is that some of the directories do not exist # in certain situations (e.g., exportable source builds, # OpenSolaris). # # Hammerhead: Use NOWAIT_SUBDIRS to avoid giving .WAIT prerequisites/commands # (GNU Make 4.4+ treats .WAIT as special and rejects this) $(NOWAIT_SUBDIRS): FRC cd $@; pwd; $(MAKE) $(TARGET) # Hammerhead: Use pattern rule so HDRSUBDIRS entries not in SUBDIRS still work %-nodepend: cd $(@:%-nodepend=%); pwd; $(MAKE) $(TARGET) FRC: