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 # KMODDIR Base path for loadable kernel modules
47 # (see kld(4)). [/boot/kernel]
49 # KMODOWN Kernel and KLD owner. [${BINOWN}]
51 # KMODGRP Kernel and KLD group. [${BINGRP}]
53 # KMODMODE KLD mode. [${BINMODE}]
56 # SHAREDIR Base path for architecture-independent ascii
57 # text files. [/usr/share]
59 # SHAREOWN ASCII text file owner. [root]
61 # SHAREGRP ASCII text file group. [wheel]
63 # SHAREMODE ASCII text file mode. [${NOBINMODE}]
66 # CONFDIR Base path for configuration files. [/etc]
68 # CONFOWN Configuration file owner. [root]
70 # CONFGRP Configuration file group. [wheel]
72 # CONFMODE Configuration file mode. [644]
75 # DOCDIR Base path for system documentation (e.g. PSD, USD,
76 # handbook, FAQ etc.). [${SHAREDIR}/doc]
78 # DOCOWN Documentation owner. [${SHAREOWN}]
80 # DOCGRP Documentation group. [${SHAREGRP}]
82 # DOCMODE Documentation mode. [${NOBINMODE}]
85 # INFODIR Base path for GNU's hypertext system
86 # called Info (see info(1)). [${SHAREDIR}/info]
88 # INFOOWN Info owner. [${SHAREOWN}]
90 # INFOGRP Info group. [${SHAREGRP}]
92 # INFOMODE Info mode. [${NOBINMODE}]
95 # MANDIR Base path for manual installation. [${SHAREDIR}/man/man]
97 # MANOWN Manual owner. [${SHAREOWN}]
99 # MANGRP Manual group. [${SHAREGRP}]
101 # MANMODE Manual mode. [${NOBINMODE}]
104 # NLSDIR Base path for National Language Support files
105 # installation. [${SHAREDIR}/nls]
107 # NLSOWN National Language Support files owner. [${SHAREOWN}]
109 # NLSGRP National Language Support files group. [${SHAREGRP}]
111 # NLSMODE National Language Support files mode. [${NOBINMODE}]
113 # INCLUDEDIR Base path for standard C include files [/usr/include]
115 .if !target(__<bsd.own.mk>__)
118 .if !defined(_WITHOUT_SRCCONF)
119 SRCCONF?= /etc/src.conf
120 .if exists(${SRCCONF})
121 .include "${SRCCONF}"
131 .if defined(MODULES_WITH_WORLD)
132 KMODDIR?= /boot/modules
134 KMODDIR?= /boot/kernel
138 KMODMODE?= ${BINMODE}
141 LIBCOMPATDIR?= /usr/lib/compat
142 LIBDATADIR?= /usr/libdata
143 LIBEXECDIR?= /usr/libexec
144 LINTLIBDIR?= /usr/libdata/lint
148 LIBMODE?= ${NOBINMODE}
152 SHAREDIR?= /usr/share
155 SHAREMODE?= ${NOBINMODE}
162 MANDIR?= ${SHAREDIR}/man/man
165 MANMODE?= ${NOBINMODE}
167 DOCDIR?= ${SHAREDIR}/doc
170 DOCMODE?= ${NOBINMODE}
172 INFODIR?= ${SHAREDIR}/info
173 INFOOWN?= ${SHAREOWN}
174 INFOGRP?= ${SHAREGRP}
175 INFOMODE?= ${NOBINMODE}
177 NLSDIR?= ${SHAREDIR}/nls
180 NLSMODE?= ${NOBINMODE}
182 INCLUDEDIR?= /usr/include
185 # install(1) parameters.
190 INSTALL_LINK?= ${INSTALL} ${HRDLINK}
191 INSTALL_SYMLINK?= ${INSTALL} ${SYMLINK}
194 .if !defined(DEBUG_FLAGS)
198 COMPRESS_CMD?= gzip -cn
201 .if !defined(_WITHOUT_SRCCONF)
203 # Define MK_* variables (which are either "yes" or "no") for users
204 # to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
205 # make(1) environment.
206 # These should be tested with `== "no"' or `!= "no"' in makefiles.
207 # The NO_* variables should only be set by makefiles.
211 # Supported NO_* options (if defined, MK_* will be forced to "no",
212 # regardless of user's setting).
219 .if defined(NO_${var})
220 .if defined(WITH_${var})
228 # Older-style variables that enabled behaviour when set.
230 .if defined(YES_HESIOD)
233 .if defined(MAKE_IDEA)
237 __DEFAULT_YES_OPTIONS = \
352 WPA_SUPPLICANT_EAPOL \
356 __DEFAULT_NO_OPTIONS = \
378 OPENSSH_NONE_CIPHER \
382 # Default behaviour of some options depends on the architecture. Unfortunately
383 # this means that we have to test TARGET_ARCH (the buildworld case) as well
384 # as MACHINE_ARCH (the non-buildworld case). Normally TARGET_ARCH is not
385 # used at all in bsd.*.mk, but we have to make an exception here if we want
386 # to allow defaults for some things like clang and fdt to vary by target
389 .if defined(TARGET_ARCH)
394 # Clang is only for x86, powerpc and little-endian arm right now, by default.
395 .if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*}
396 __DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL
397 .elif ${__T} == "arm" || ${__T} == "armv6"
398 __DEFAULT_YES_OPTIONS+=CLANG
399 # GCC is unable to build the full clang on arm, disable it by default.
400 __DEFAULT_NO_OPTIONS+=CLANG_FULL
402 __DEFAULT_NO_OPTIONS+=CLANG CLANG_FULL
404 # Clang the default system compiler only on x86.
405 .if ${__T} == "amd64" || ${__T} == "i386"
406 __DEFAULT_YES_OPTIONS+=CLANG_IS_CC
408 __DEFAULT_NO_OPTIONS+=CLANG_IS_CC
410 # FDT is needed only for arm, mips and powerpc
411 .if ${__T:Marm*} || ${__T:Mpowerpc*} || ${__T:Mmips*}
412 __DEFAULT_YES_OPTIONS+=FDT
414 __DEFAULT_NO_OPTIONS+=FDT
419 # MK_* options which default to "yes".
421 .for var in ${__DEFAULT_YES_OPTIONS}
422 .if defined(WITH_${var}) && defined(WITHOUT_${var})
423 .error WITH_${var} and WITHOUT_${var} can't both be set.
425 .if defined(MK_${var})
426 .error MK_${var} can't be set by a user.
428 .if defined(WITHOUT_${var})
434 .undef __DEFAULT_YES_OPTIONS
437 # MK_* options which default to "no".
439 .for var in ${__DEFAULT_NO_OPTIONS}
440 .if defined(WITH_${var}) && defined(WITHOUT_${var})
441 .error WITH_${var} and WITHOUT_${var} can't both be set.
443 .if defined(MK_${var})
444 .error MK_${var} can't be set by a user.
446 .if defined(WITH_${var})
452 .undef __DEFAULT_NO_OPTIONS
455 # Force some options off if their dependencies are off.
456 # Order is somewhat important.
458 .if ${MK_LIBPTHREAD} == "no"
462 .if ${MK_LIBTHR} == "no"
466 .if ${MK_BIND} == "no"
470 MK_BIND_LIBS_LWRES:= no
476 .if ${MK_LDNS} == "no"
480 .if ${MK_LDNS_UTILS} == "no"
484 .if ${MK_BIND_MTREE} == "no"
488 .if ${MK_SOURCELESS} == "no"
489 MK_SOURCELESS_HOST:= no
490 MK_SOURCELESS_UCODE:= no
493 .if ${MK_CDDL} == "no"
498 .if ${MK_CRYPT} == "no"
504 .if ${MK_CXX} == "no"
509 .if ${MK_MAIL} == "no"
514 .if ${MK_NETGRAPH} == "no"
519 .if ${MK_OPENSSL} == "no"
528 .if ${MK_TEXTPROC} == "no"
532 .if ${MK_TOOLCHAIN} == "no"
539 .if ${MK_CLANG} == "no"
546 # Set defaults for the MK_*_SUPPORT variables.
550 # MK_*_SUPPORT options which default to "yes" unless their corresponding
551 # MK_* variable is set to "no".
564 .if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT)
565 .error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set.
567 .if defined(MK_${var}_SUPPORT)
568 .error MK_${var}_SUPPORT can't be set by a user.
570 .if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no"
571 MK_${var}_SUPPORT:= no
573 MK_${var}_SUPPORT:= yes
578 # MK_* options whose default value depends on another option.
583 .if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H})
584 .error WITH_${vv:H} and WITHOUT_${vv:H} can't both be set.
586 .if defined(MK_${vv:H})
587 .error MK_${vv:H} can't be set by a user.
589 .if defined(WITH_${vv:H})
591 .elif defined(WITHOUT_${vv:H})
594 MK_${vv:H}:= ${MK_${vv:T}}
599 # MK_* options that default to "yes" if the compiler is a C++11 compiler.
601 .include <bsd.compiler.mk>
604 .if defined(WITH_${var}) && defined(WITHOUT_${var})
605 .error WITH_${var} and WITHOUT_${var} can't both be set.
607 .if defined(MK_${var})
608 .error MK_${var} can't be set by a user.
610 .if ${COMPILER_FEATURES:Mc++11}
611 .if defined(WITHOUT_${var})
617 .if defined(WITH_${var})
625 .if ${MK_CTF} != "no"
626 CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
627 .elif defined(.PARSEDIR) || (defined(MAKE_VERSION) && ${MAKE_VERSION} >= 5201111300)
633 .if ${MK_INSTALL_AS_USER} != "no"
640 .for x in BIN CONF DOC INFO KMOD LIB MAN NLS SHARE
647 .endif # !_WITHOUT_SRCCONF
649 .endif # !target(__<bsd.own.mk>__)