3 # The include file <bsd.own.mk> set common variables for owner,
4 # group, mode, and directories. Defaults are in brackets.
9 # DESTDIR Change the tree where the file gets installed. [not set]
11 # DISTDIR Change the tree where the file for a distribution
12 # gets installed (see /usr/src/release/Makefile). [not set]
14 # COMPRESS_CMD Program to compress documents.
15 # Output is to stdout. [gzip -cn]
17 # COMPRESS_EXT File name extension of ${COMPRESS_CMD} command. [.gz]
19 # BINOWN Binary owner. [root]
21 # BINGRP Binary group. [wheel]
23 # BINMODE Binary mode. [555]
25 # NOBINMODE Mode for non-executable files. [444]
27 # LIBDIR Base path for libraries. [/usr/lib]
29 # LIBCOMPATDIR Base path for compat libraries. [/usr/lib/compat]
31 # LIBDATADIR Base path for misc. utility data files. [/usr/libdata]
33 # LIBEXECDIR Base path for system daemons and utilities. [/usr/libexec]
35 # LINTLIBDIR Base path for lint libraries. [/usr/libdata/lint]
37 # SHLIBDIR Base path for shared libraries. [${LIBDIR}]
39 # LIBOWN Library owner. [${BINOWN}]
41 # LIBGRP Library group. [${BINGRP}]
43 # LIBMODE Library mode. [${NOBINMODE}]
46 # DEBUGDIR Base path for standalone debug files. [/usr/lib/debug]
48 # DEBUGMODE Mode for debug files. [${NOBINMODE}]
51 # KMODDIR Base path for loadable kernel modules
52 # (see kld(4)). [/boot/kernel]
54 # KMODOWN Kernel and KLD owner. [${BINOWN}]
56 # KMODGRP Kernel and KLD group. [${BINGRP}]
58 # KMODMODE KLD mode. [${BINMODE}]
61 # SHAREDIR Base path for architecture-independent ascii
62 # text files. [/usr/share]
64 # SHAREOWN ASCII text file owner. [root]
66 # SHAREGRP ASCII text file group. [wheel]
68 # SHAREMODE ASCII text file mode. [${NOBINMODE}]
71 # CONFDIR Base path for configuration files. [/etc]
73 # CONFOWN Configuration file owner. [root]
75 # CONFGRP Configuration file group. [wheel]
77 # CONFMODE Configuration file mode. [644]
80 # DOCDIR Base path for system documentation (e.g. PSD, USD,
81 # handbook, FAQ etc.). [${SHAREDIR}/doc]
83 # DOCOWN Documentation owner. [${SHAREOWN}]
85 # DOCGRP Documentation group. [${SHAREGRP}]
87 # DOCMODE Documentation mode. [${NOBINMODE}]
90 # INFODIR Base path for GNU's hypertext system
91 # called Info (see info(1)). [${SHAREDIR}/info]
93 # INFOOWN Info owner. [${SHAREOWN}]
95 # INFOGRP Info group. [${SHAREGRP}]
97 # INFOMODE Info mode. [${NOBINMODE}]
100 # MANDIR Base path for manual installation. [${SHAREDIR}/man/man]
102 # MANOWN Manual owner. [${SHAREOWN}]
104 # MANGRP Manual group. [${SHAREGRP}]
106 # MANMODE Manual mode. [${NOBINMODE}]
109 # NLSDIR Base path for National Language Support files
110 # installation. [${SHAREDIR}/nls]
112 # NLSOWN National Language Support files owner. [${SHAREOWN}]
114 # NLSGRP National Language Support files group. [${SHAREGRP}]
116 # NLSMODE National Language Support files mode. [${NOBINMODE}]
118 # INCLUDEDIR Base path for standard C include files [/usr/include]
120 .if !target(__<bsd.own.mk>__)
123 .if !defined(_WITHOUT_SRCCONF)
124 SRCCONF?= /etc/src.conf
125 .if exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf"
126 .include "${SRCCONF}"
136 .if defined(MODULES_WITH_WORLD)
137 KMODDIR?= /boot/modules
139 KMODDIR?= /boot/kernel
143 KMODMODE?= ${BINMODE}
146 LIBCOMPATDIR?= /usr/lib/compat
147 LIBDATADIR?= /usr/libdata
148 LIBEXECDIR?= /usr/libexec
149 LINTLIBDIR?= /usr/libdata/lint
153 LIBMODE?= ${NOBINMODE}
155 DEBUGDIR?= /usr/lib/debug
156 DEBUGMODE?= ${NOBINMODE}
160 SHAREDIR?= /usr/share
163 SHAREMODE?= ${NOBINMODE}
170 MANDIR?= ${SHAREDIR}/man/man
173 MANMODE?= ${NOBINMODE}
175 DOCDIR?= ${SHAREDIR}/doc
178 DOCMODE?= ${NOBINMODE}
180 INFODIR?= ${SHAREDIR}/info
181 INFOOWN?= ${SHAREOWN}
182 INFOGRP?= ${SHAREGRP}
183 INFOMODE?= ${NOBINMODE}
185 NLSDIR?= ${SHAREDIR}/nls
188 NLSMODE?= ${NOBINMODE}
190 INCLUDEDIR?= /usr/include
193 # install(1) parameters.
198 INSTALL_LINK?= ${INSTALL} ${HRDLINK}
199 INSTALL_SYMLINK?= ${INSTALL} ${SYMLINK}
202 .if !defined(DEBUG_FLAGS)
206 COMPRESS_CMD?= gzip -cn
209 .if !defined(_WITHOUT_SRCCONF)
211 # Define MK_* variables (which are either "yes" or "no") for users
212 # to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
213 # make(1) environment.
214 # These should be tested with `== "no"' or `!= "no"' in makefiles.
215 # The NO_* variables should only be set by makefiles.
219 # Supported NO_* options (if defined, MK_* will be forced to "no",
220 # regardless of user's setting).
228 .if defined(NO_${var})
229 .if defined(WITH_${var})
237 # Older-style variables that enabled behaviour when set.
239 .if defined(YES_HESIOD)
243 __DEFAULT_YES_OPTIONS = \
362 WPA_SUPPLICANT_EAPOL \
366 __DEFAULT_NO_OPTIONS = \
386 OPENSSH_NONE_CIPHER \
392 # Default behaviour of some options depends on the architecture. Unfortunately
393 # this means that we have to test TARGET_ARCH (the buildworld case) as well
394 # as MACHINE_ARCH (the non-buildworld case). Normally TARGET_ARCH is not
395 # used at all in bsd.*.mk, but we have to make an exception here if we want
396 # to allow defaults for some things like clang and fdt to vary by target
399 .if defined(TARGET_ARCH)
404 # Clang is only for x86, powerpc and little-endian arm right now, by default.
405 .if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*}
406 __DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL
407 .elif ${__T} == "arm" || ${__T} == "armv6"
408 __DEFAULT_YES_OPTIONS+=CLANG
409 # GCC is unable to build the full clang on arm, disable it by default.
410 __DEFAULT_NO_OPTIONS+=CLANG_FULL
412 __DEFAULT_NO_OPTIONS+=CLANG CLANG_FULL
414 # Clang the default system compiler only on little-endian arm and x86.
415 .if ${__T} == "amd64" || ${__T} == "arm" || ${__T} == "armv6" || \
417 __DEFAULT_YES_OPTIONS+=CLANG_IS_CC
419 __DEFAULT_NO_OPTIONS+=CLANG_IS_CC
421 # FDT is needed only for arm, mips and powerpc
422 .if ${__T:Marm*} || ${__T:Mpowerpc*} || ${__T:Mmips*}
423 __DEFAULT_YES_OPTIONS+=FDT
425 __DEFAULT_NO_OPTIONS+=FDT
430 # MK_* options which default to "yes".
432 .for var in ${__DEFAULT_YES_OPTIONS}
433 .if defined(WITH_${var}) && defined(WITHOUT_${var})
434 .error WITH_${var} and WITHOUT_${var} can't both be set.
436 .if defined(MK_${var})
437 .error MK_${var} can't be set by a user.
439 .if defined(WITHOUT_${var})
445 .undef __DEFAULT_YES_OPTIONS
448 # MK_* options which default to "no".
450 .for var in ${__DEFAULT_NO_OPTIONS}
451 .if defined(WITH_${var}) && defined(WITHOUT_${var})
452 .error WITH_${var} and WITHOUT_${var} can't both be set.
454 .if defined(MK_${var})
455 .error MK_${var} can't be set by a user.
457 .if defined(WITH_${var})
463 .undef __DEFAULT_NO_OPTIONS
466 # Force some options off if their dependencies are off.
467 # Order is somewhat important.
469 .if ${MK_LIBPTHREAD} == "no"
473 .if ${MK_LIBTHR} == "no"
477 .if ${MK_BIND} == "no"
481 MK_BIND_LIBS_LWRES:= no
487 .if ${MK_LDNS} == "no"
491 .if ${MK_LDNS_UTILS} != "no"
495 .if ${MK_BIND_MTREE} == "no"
499 .if ${MK_SOURCELESS} == "no"
500 MK_SOURCELESS_HOST:= no
501 MK_SOURCELESS_UCODE:= no
504 .if ${MK_CDDL} == "no"
509 .if ${MK_CRYPT} == "no"
515 .if ${MK_CXX} == "no"
520 .if ${MK_MAIL} == "no"
525 .if ${MK_NETGRAPH} == "no"
530 .if ${MK_OPENSSL} == "no"
539 .if ${MK_TEXTPROC} == "no"
543 .if ${MK_TOOLCHAIN} == "no"
550 .if ${MK_CLANG} == "no"
557 # Set defaults for the MK_*_SUPPORT variables.
561 # MK_*_SUPPORT options which default to "yes" unless their corresponding
562 # MK_* variable is set to "no".
575 .if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT)
576 .error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set.
578 .if defined(MK_${var}_SUPPORT)
579 .error MK_${var}_SUPPORT can't be set by a user.
581 .if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no"
582 MK_${var}_SUPPORT:= no
584 MK_${var}_SUPPORT:= yes
589 # MK_* options whose default value depends on another option.
594 .if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H})
595 .error WITH_${vv:H} and WITHOUT_${vv:H} can't both be set.
597 .if defined(MK_${vv:H})
598 .error MK_${vv:H} can't be set by a user.
600 .if defined(WITH_${vv:H})
602 .elif defined(WITHOUT_${vv:H})
605 MK_${vv:H}:= ${MK_${vv:T}}
610 # MK_* options that default to "yes" if the compiler is a C++11 compiler.
612 .include <bsd.compiler.mk>
615 .if defined(WITH_${var}) && defined(WITHOUT_${var})
616 .error WITH_${var} and WITHOUT_${var} can't both be set.
618 .if defined(MK_${var})
619 .error MK_${var} can't be set by a user.
621 .if ${COMPILER_FEATURES:Mc++11}
622 .if defined(WITHOUT_${var})
628 .if defined(WITH_${var})
636 .if ${MK_CTF} != "no"
637 CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
638 .elif defined(.PARSEDIR) || (defined(MAKE_VERSION) && ${MAKE_VERSION} >= 5201111300)
644 .if ${MK_INSTALL_AS_USER} != "no"
651 .for x in BIN CONF DOC INFO KMOD LIB MAN NLS SHARE
658 .endif # !_WITHOUT_SRCCONF
660 .endif # !target(__<bsd.own.mk>__)