bsd.own.mk revision 219820
1# $FreeBSD: head/share/mk/bsd.own.mk 219820 2011-03-21 09:58:24Z jeff $ 2# 3# The include file <bsd.own.mk> set common variables for owner, 4# group, mode, and directories. Defaults are in brackets. 5# 6# 7# +++ variables +++ 8# 9# DESTDIR Change the tree where the file gets installed. [not set] 10# 11# DISTDIR Change the tree where the file for a distribution 12# gets installed (see /usr/src/release/Makefile). [not set] 13# 14# COMPRESS_CMD Program to compress documents. 15# Output is to stdout. [gzip -cn] 16# 17# COMPRESS_EXT File name extension of ${COMPRESS_CMD} command. [.gz] 18# 19# BINOWN Binary owner. [root] 20# 21# BINGRP Binary group. [wheel] 22# 23# BINMODE Binary mode. [555] 24# 25# NOBINMODE Mode for non-executable files. [444] 26# 27# LIBDIR Base path for libraries. [/usr/lib] 28# 29# LIBCOMPATDIR Base path for compat libraries. [/usr/lib/compat] 30# 31# LIBDATADIR Base path for misc. utility data files. [/usr/libdata] 32# 33# LIBEXECDIR Base path for system daemons and utilities. [/usr/libexec] 34# 35# LINTLIBDIR Base path for lint libraries. [/usr/libdata/lint] 36# 37# SHLIBDIR Base path for shared libraries. [${LIBDIR}] 38# 39# LIBOWN Library owner. [${BINOWN}] 40# 41# LIBGRP Library group. [${BINGRP}] 42# 43# LIBMODE Library mode. [${NOBINMODE}] 44# 45# 46# KMODDIR Base path for loadable kernel modules 47# (see kld(4)). [/boot/kernel] 48# 49# KMODOWN Kernel and KLD owner. [${BINOWN}] 50# 51# KMODGRP Kernel and KLD group. [${BINGRP}] 52# 53# KMODMODE KLD mode. [${BINMODE}] 54# 55# 56# SHAREDIR Base path for architecture-independent ascii 57# text files. [/usr/share] 58# 59# SHAREOWN ASCII text file owner. [root] 60# 61# SHAREGRP ASCII text file group. [wheel] 62# 63# SHAREMODE ASCII text file mode. [${NOBINMODE}] 64# 65# 66# DOCDIR Base path for system documentation (e.g. PSD, USD, 67# handbook, FAQ etc.). [${SHAREDIR}/doc] 68# 69# DOCOWN Documentation owner. [${SHAREOWN}] 70# 71# DOCGRP Documentation group. [${SHAREGRP}] 72# 73# DOCMODE Documentation mode. [${NOBINMODE}] 74# 75# 76# INFODIR Base path for GNU's hypertext system 77# called Info (see info(1)). [${SHAREDIR}/info] 78# 79# INFOOWN Info owner. [${SHAREOWN}] 80# 81# INFOGRP Info group. [${SHAREGRP}] 82# 83# INFOMODE Info mode. [${NOBINMODE}] 84# 85# 86# MANDIR Base path for manual installation. [${SHAREDIR}/man/man] 87# 88# MANOWN Manual owner. [${SHAREOWN}] 89# 90# MANGRP Manual group. [${SHAREGRP}] 91# 92# MANMODE Manual mode. [${NOBINMODE}] 93# 94# 95# NLSDIR Base path for National Language Support files 96# installation. [${SHAREDIR}/nls] 97# 98# NLSOWN National Language Support files owner. [${SHAREOWN}] 99# 100# NLSGRP National Language Support files group. [${SHAREGRP}] 101# 102# NLSMODE National Language Support files mode. [${NOBINMODE}] 103# 104# INCLUDEDIR Base path for standard C include files [/usr/include] 105 106.if !target(__<bsd.own.mk>__) 107__<bsd.own.mk>__: 108 109.if !defined(_WITHOUT_SRCCONF) 110SRCCONF?= /etc/src.conf 111.if exists(${SRCCONF}) 112.include "${SRCCONF}" 113.endif 114.endif 115 116# Binaries 117BINOWN?= root 118BINGRP?= wheel 119BINMODE?= 555 120NOBINMODE?= 444 121 122.if defined(MODULES_WITH_WORLD) 123KMODDIR?= /boot/modules 124.else 125KMODDIR?= /boot/kernel 126.endif 127KMODOWN?= ${BINOWN} 128KMODGRP?= ${BINGRP} 129KMODMODE?= ${BINMODE} 130 131LIBDIR?= /usr/lib 132LIBCOMPATDIR?= /usr/lib/compat 133LIBDATADIR?= /usr/libdata 134LIBEXECDIR?= /usr/libexec 135LINTLIBDIR?= /usr/libdata/lint 136SHLIBDIR?= ${LIBDIR} 137LIBOWN?= ${BINOWN} 138LIBGRP?= ${BINGRP} 139LIBMODE?= ${NOBINMODE} 140 141 142# Share files 143SHAREDIR?= /usr/share 144SHAREOWN?= root 145SHAREGRP?= wheel 146SHAREMODE?= ${NOBINMODE} 147 148MANDIR?= ${SHAREDIR}/man/man 149MANOWN?= ${SHAREOWN} 150MANGRP?= ${SHAREGRP} 151MANMODE?= ${NOBINMODE} 152 153DOCDIR?= ${SHAREDIR}/doc 154DOCOWN?= ${SHAREOWN} 155DOCGRP?= ${SHAREGRP} 156DOCMODE?= ${NOBINMODE} 157 158INFODIR?= ${SHAREDIR}/info 159INFOOWN?= ${SHAREOWN} 160INFOGRP?= ${SHAREGRP} 161INFOMODE?= ${NOBINMODE} 162 163NLSDIR?= ${SHAREDIR}/nls 164NLSOWN?= ${SHAREOWN} 165NLSGRP?= ${SHAREGRP} 166NLSMODE?= ${NOBINMODE} 167 168INCLUDEDIR?= /usr/include 169 170# Common variables 171.if !defined(DEBUG_FLAGS) 172STRIP?= -s 173.endif 174 175COMPRESS_CMD?= gzip -cn 176COMPRESS_EXT?= .gz 177 178.if !defined(_WITHOUT_SRCCONF) 179# 180# Define MK_* variables (which are either "yes" or "no") for users 181# to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the 182# make(1) environment. 183# These should be tested with `== "no"' or `!= "no"' in makefiles. 184# The NO_* variables should only be set by makefiles. 185# 186 187# 188# Supported NO_* options (if defined, MK_* will be forced to "no", 189# regardless of user's setting). 190# 191.for var in \ 192 INSTALLLIB \ 193 MAN \ 194 PROFILE 195.if defined(NO_${var}) 196WITHOUT_${var}= 197.endif 198.endfor 199 200# 201# Compat NO_* options (same as above, except their use is deprecated). 202# 203.if !defined(BURN_BRIDGES) 204.for var in \ 205 ACPI \ 206 ATM \ 207 AUDIT \ 208 AUTHPF \ 209 BIND \ 210 BIND_DNSSEC \ 211 BIND_ETC \ 212 BIND_LIBS_LWRES \ 213 BIND_MTREE \ 214 BIND_NAMED \ 215 BIND_UTILS \ 216 BLUETOOTH \ 217 BOOT \ 218 CALENDAR \ 219 CPP \ 220 CRYPT \ 221 CVS \ 222 CXX \ 223 DICT \ 224 DYNAMICROOT \ 225 EXAMPLES \ 226 FORTH \ 227 FP_LIBC \ 228 GAMES \ 229 GCOV \ 230 GDB \ 231 GNU \ 232 GPIB \ 233 GROFF \ 234 HTML \ 235 INET6 \ 236 INFO \ 237 IPFILTER \ 238 IPX \ 239 KERBEROS \ 240 LIB32 \ 241 LIBPTHREAD \ 242 LIBTHR \ 243 LOCALES \ 244 LPR \ 245 MAILWRAPPER \ 246 NETCAT \ 247 NIS \ 248 NLS \ 249 NLS_CATALOGS \ 250 NS_CACHING \ 251 OBJC \ 252 OPENSSH \ 253 OPENSSL \ 254 PAM \ 255 PF \ 256 RCMDS \ 257 RCS \ 258 RESCUE \ 259 SENDMAIL \ 260 SETUID_LOGIN \ 261 SHAREDOCS \ 262 SYSCONS \ 263 TCSH \ 264 TOOLCHAIN \ 265 USB \ 266 WPA_SUPPLICANT_EAPOL 267.if defined(NO_${var}) 268#.warning NO_${var} is deprecated in favour of WITHOUT_${var}= 269WITHOUT_${var}= 270.endif 271.endfor 272.endif # !defined(BURN_BRIDGES) 273 274# 275# Older-style variables that enabled behaviour when set. 276# 277.if defined(YES_HESIOD) 278WITH_HESIOD= 279.endif 280.if defined(MAKE_IDEA) 281WITH_IDEA= 282.endif 283 284# 285# Default behaviour of MK_CLANG depends on the architecture. 286# 287.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || \ 288 ${MACHINE_ARCH} == "powerpc" 289_clang_yes=CLANG 290_clang_no= 291.else 292_clang_yes= 293_clang_no=CLANG 294.endif 295 296# 297# MK_* options which default to "yes". 298# 299.for var in \ 300 ACCT \ 301 ACPI \ 302 AMD \ 303 APM \ 304 ASSERT_DEBUG \ 305 AT \ 306 ATM \ 307 AUDIT \ 308 AUTHPF \ 309 BIND \ 310 BIND_DNSSEC \ 311 BIND_ETC \ 312 BIND_LIBS_LWRES \ 313 BIND_MTREE \ 314 BIND_NAMED \ 315 BIND_UTILS \ 316 BINUTILS \ 317 BLUETOOTH \ 318 BOOT \ 319 BSD_CPIO \ 320 BSNMP \ 321 BZIP2 \ 322 CALENDAR \ 323 CDDL \ 324 ${_clang_yes} \ 325 CPP \ 326 CRYPT \ 327 CTM \ 328 CVS \ 329 CXX \ 330 DICT \ 331 DYNAMICROOT \ 332 EXAMPLES \ 333 FDT \ 334 FLOPPY \ 335 FORTH \ 336 FP_LIBC \ 337 FREEBSD_UPDATE \ 338 GAMES \ 339 GCC \ 340 GCOV \ 341 GDB \ 342 GNU \ 343 GPIB \ 344 GROFF \ 345 HTML \ 346 INET6 \ 347 INFO \ 348 INSTALLLIB \ 349 IPFILTER \ 350 IPFW \ 351 IPX \ 352 JAIL \ 353 KERBEROS \ 354 KVM \ 355 LEGACY_CONSOLE \ 356 LIB32 \ 357 LIBPTHREAD \ 358 LIBTHR \ 359 LOCALES \ 360 LOCATE \ 361 LPR \ 362 MAIL \ 363 MAILWRAPPER \ 364 MAKE \ 365 MAN \ 366 NCP \ 367 NDIS \ 368 NETCAT \ 369 NETGRAPH \ 370 NIS \ 371 NLS \ 372 NLS_CATALOGS \ 373 NS_CACHING \ 374 NTP \ 375 OBJC \ 376 OPENSSH \ 377 OPENSSL \ 378 PAM \ 379 PF \ 380 PKGTOOLS \ 381 PMC \ 382 PORTSNAP \ 383 PPP \ 384 PROFILE \ 385 QUOTAS \ 386 RCMDS \ 387 RCS \ 388 RESCUE \ 389 ROUTED \ 390 SENDMAIL \ 391 SETUID_LOGIN \ 392 SHAREDOCS \ 393 SSP \ 394 SYSINSTALL \ 395 SYMVER \ 396 SYSCONS \ 397 TCSH \ 398 TELNET \ 399 TEXTPROC \ 400 TOOLCHAIN \ 401 USB \ 402 WIRELESS \ 403 WPA_SUPPLICANT_EAPOL \ 404 ZFS \ 405 ZONEINFO 406.if defined(WITH_${var}) && defined(WITHOUT_${var}) 407.error WITH_${var} and WITHOUT_${var} can't both be set. 408.endif 409.if defined(MK_${var}) 410.error MK_${var} can't be set by a user. 411.endif 412.if defined(WITHOUT_${var}) 413MK_${var}:= no 414.else 415MK_${var}:= yes 416.endif 417.endfor 418 419# 420# MK_* options which default to "no". 421# 422.for var in \ 423 BIND_IDN \ 424 BIND_LARGE_FILE \ 425 BIND_LIBS \ 426 BIND_SIGCHASE \ 427 BIND_XML \ 428 BSD_GREP \ 429 ${_clang_no} \ 430 GPIO \ 431 HESIOD \ 432 ICONV \ 433 IDEA \ 434 OFED 435.if defined(WITH_${var}) && defined(WITHOUT_${var}) 436.error WITH_${var} and WITHOUT_${var} can't both be set. 437.endif 438.if defined(MK_${var}) 439.error MK_${var} can't be set by a user. 440.endif 441.if defined(WITH_${var}) 442MK_${var}:= yes 443.else 444MK_${var}:= no 445.endif 446.endfor 447 448# 449# Force some options off if their dependencies are off. 450# Order is somewhat important. 451# 452.if ${MK_LIBPTHREAD} == "no" 453MK_LIBTHR:= no 454.endif 455 456.if ${MK_LIBTHR} == "no" 457MK_BIND:= no 458.endif 459 460.if ${MK_BIND} == "no" 461MK_BIND_DNSSEC:= no 462MK_BIND_ETC:= no 463MK_BIND_LIBS:= no 464MK_BIND_LIBS_LWRES:= no 465MK_BIND_MTREE:= no 466MK_BIND_NAMED:= no 467MK_BIND_UTILS:= no 468.endif 469 470.if ${MK_BIND_MTREE} == "no" 471MK_BIND_ETC:= no 472.endif 473 474.if ${MK_CDDL} == "no" 475MK_ZFS:= no 476.endif 477 478.if ${MK_CRYPT} == "no" 479MK_OPENSSL:= no 480MK_OPENSSH:= no 481MK_KERBEROS:= no 482.endif 483 484.if ${MK_IPX} == "no" 485MK_NCP:= no 486.endif 487 488.if ${MK_MAIL} == "no" 489MK_MAILWRAPPER:= no 490MK_SENDMAIL:= no 491.endif 492 493.if ${MK_NETGRAPH} == "no" 494MK_ATM:= no 495MK_BLUETOOTH:= no 496.endif 497 498.if ${MK_OPENSSL} == "no" 499MK_OPENSSH:= no 500MK_KERBEROS:= no 501.endif 502 503.if ${MK_PF} == "no" 504MK_AUTHPF:= no 505.endif 506 507.if ${MK_TEXTPROC} == "no" 508MK_GROFF:= no 509.endif 510 511.if ${MK_TOOLCHAIN} == "no" 512MK_CLANG:= no 513MK_GDB:= no 514.endif 515 516# 517# Set defaults for the MK_*_SUPPORT variables. 518# 519 520# 521# MK_*_SUPPORT options which default to "yes" unless their corresponding 522# MK_* variable is set to "no". 523# 524.for var in \ 525 BZIP2 \ 526 GNU \ 527 INET6 \ 528 IPX \ 529 KERBEROS \ 530 KVM \ 531 NETGRAPH \ 532 PAM \ 533 WIRELESS 534.if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT) 535.error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set. 536.endif 537.if defined(MK_${var}_SUPPORT) 538.error MK_${var}_SUPPORT can't be set by a user. 539.endif 540.if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no" 541MK_${var}_SUPPORT:= no 542.else 543MK_${var}_SUPPORT:= yes 544.endif 545.endfor 546 547# 548# MK_* options whose default value depends on another option. 549# 550.for vv in \ 551 GSSAPI/KERBEROS \ 552 MAN_UTILS/MAN 553.if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H}) 554.error WITH_${vv:H} and WITHOUT_${vv:H} can't both be set. 555.endif 556.if defined(MK_${vv:H}) 557.error MK_${vv:H} can't be set by a user. 558.endif 559.if defined(WITH_${vv:H}) 560MK_${vv:H}:= yes 561.elif defined(WITHOUT_${vv:H}) 562MK_${vv:H}:= no 563.else 564MK_${vv:H}:= ${MK_${vv:T}} 565.endif 566.endfor 567 568.endif # !_WITHOUT_SRCCONF 569 570.endif # !target(__<bsd.own.mk>__) 571