bsd.own.mk revision 218525
1# $FreeBSD: head/share/mk/bsd.own.mk 218525 2011-02-10 19:13:54Z keramida $ 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 BLUETOOTH \ 317 BOOT \ 318 BSD_CPIO \ 319 BSNMP \ 320 BZIP2 \ 321 CALENDAR \ 322 CDDL \ 323 ${_clang_yes} \ 324 CPP \ 325 CRYPT \ 326 CTM \ 327 CVS \ 328 CXX \ 329 DICT \ 330 DYNAMICROOT \ 331 EXAMPLES \ 332 FDT \ 333 FLOPPY \ 334 FORTH \ 335 FP_LIBC \ 336 FREEBSD_UPDATE \ 337 GAMES \ 338 GCOV \ 339 GDB \ 340 GNU \ 341 GPIB \ 342 GROFF \ 343 HTML \ 344 INET6 \ 345 INFO \ 346 INSTALLLIB \ 347 IPFILTER \ 348 IPFW \ 349 IPX \ 350 JAIL \ 351 KERBEROS \ 352 KVM \ 353 LEGACY_CONSOLE \ 354 LIB32 \ 355 LIBPTHREAD \ 356 LIBTHR \ 357 LOCALES \ 358 LOCATE \ 359 LPR \ 360 MAIL \ 361 MAILWRAPPER \ 362 MAKE \ 363 MAN \ 364 NCP \ 365 NDIS \ 366 NETCAT \ 367 NETGRAPH \ 368 NIS \ 369 NLS \ 370 NLS_CATALOGS \ 371 NS_CACHING \ 372 NTP \ 373 OBJC \ 374 OPENSSH \ 375 OPENSSL \ 376 PAM \ 377 PF \ 378 PKGTOOLS \ 379 PMC \ 380 PORTSNAP \ 381 PPP \ 382 PROFILE \ 383 QUOTAS \ 384 RCMDS \ 385 RCS \ 386 RESCUE \ 387 ROUTED \ 388 SENDMAIL \ 389 SETUID_LOGIN \ 390 SHAREDOCS \ 391 SSP \ 392 SYSINSTALL \ 393 SYMVER \ 394 SYSCONS \ 395 TCSH \ 396 TELNET \ 397 TEXTPROC \ 398 TOOLCHAIN \ 399 USB \ 400 WIRELESS \ 401 WPA_SUPPLICANT_EAPOL \ 402 ZFS \ 403 ZONEINFO 404.if defined(WITH_${var}) && defined(WITHOUT_${var}) 405.error WITH_${var} and WITHOUT_${var} can't both be set. 406.endif 407.if defined(MK_${var}) 408.error MK_${var} can't be set by a user. 409.endif 410.if defined(WITHOUT_${var}) 411MK_${var}:= no 412.else 413MK_${var}:= yes 414.endif 415.endfor 416 417# 418# MK_* options which default to "no". 419# 420.for var in \ 421 BIND_IDN \ 422 BIND_LARGE_FILE \ 423 BIND_LIBS \ 424 BIND_SIGCHASE \ 425 BIND_XML \ 426 BSD_GREP \ 427 ${_clang_no} \ 428 GPIO \ 429 HESIOD \ 430 IDEA 431.if defined(WITH_${var}) && defined(WITHOUT_${var}) 432.error WITH_${var} and WITHOUT_${var} can't both be set. 433.endif 434.if defined(MK_${var}) 435.error MK_${var} can't be set by a user. 436.endif 437.if defined(WITH_${var}) 438MK_${var}:= yes 439.else 440MK_${var}:= no 441.endif 442.endfor 443 444# 445# Force some options off if their dependencies are off. 446# Order is somewhat important. 447# 448.if ${MK_LIBPTHREAD} == "no" 449MK_LIBTHR:= no 450.endif 451 452.if ${MK_LIBTHR} == "no" 453MK_BIND:= no 454.endif 455 456.if ${MK_BIND} == "no" 457MK_BIND_DNSSEC:= no 458MK_BIND_ETC:= no 459MK_BIND_LIBS:= no 460MK_BIND_LIBS_LWRES:= no 461MK_BIND_MTREE:= no 462MK_BIND_NAMED:= no 463MK_BIND_UTILS:= no 464.endif 465 466.if ${MK_BIND_MTREE} == "no" 467MK_BIND_ETC:= no 468.endif 469 470.if ${MK_CDDL} == "no" 471MK_ZFS:= no 472.endif 473 474.if ${MK_CRYPT} == "no" 475MK_OPENSSL:= no 476MK_OPENSSH:= no 477MK_KERBEROS:= no 478.endif 479 480.if ${MK_IPX} == "no" 481MK_NCP:= no 482.endif 483 484.if ${MK_MAIL} == "no" 485MK_MAILWRAPPER:= no 486MK_SENDMAIL:= no 487.endif 488 489.if ${MK_NETGRAPH} == "no" 490MK_ATM:= no 491MK_BLUETOOTH:= no 492.endif 493 494.if ${MK_OPENSSL} == "no" 495MK_OPENSSH:= no 496MK_KERBEROS:= no 497.endif 498 499.if ${MK_PF} == "no" 500MK_AUTHPF:= no 501.endif 502 503.if ${MK_TEXTPROC} == "no" 504MK_GROFF:= no 505.endif 506 507.if ${MK_TOOLCHAIN} == "no" 508MK_CLANG:= no 509MK_GDB:= no 510.endif 511 512# 513# Set defaults for the MK_*_SUPPORT variables. 514# 515 516# 517# MK_*_SUPPORT options which default to "yes" unless their corresponding 518# MK_* variable is set to "no". 519# 520.for var in \ 521 BZIP2 \ 522 GNU \ 523 INET6 \ 524 IPX \ 525 KERBEROS \ 526 KVM \ 527 NETGRAPH \ 528 PAM \ 529 WIRELESS 530.if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT) 531.error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set. 532.endif 533.if defined(MK_${var}_SUPPORT) 534.error MK_${var}_SUPPORT can't be set by a user. 535.endif 536.if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no" 537MK_${var}_SUPPORT:= no 538.else 539MK_${var}_SUPPORT:= yes 540.endif 541.endfor 542 543# 544# MK_* options whose default value depends on another option. 545# 546.for vv in \ 547 GSSAPI/KERBEROS \ 548 MAN_UTILS/MAN 549.if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H}) 550.error WITH_${vv:H} and WITHOUT_${vv:H} can't both be set. 551.endif 552.if defined(MK_${vv:H}) 553.error MK_${vv:H} can't be set by a user. 554.endif 555.if defined(WITH_${vv:H}) 556MK_${vv:H}:= yes 557.elif defined(WITHOUT_${vv:H}) 558MK_${vv:H}:= no 559.else 560MK_${vv:H}:= ${MK_${vv:T}} 561.endif 562.endfor 563 564.endif # !_WITHOUT_SRCCONF 565 566.endif # !target(__<bsd.own.mk>__) 567