]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - share/mk/bsd.own.mk
Update the make version required to use an empty command for CTFCONVERT_CMD
[FreeBSD/stable/9.git] / share / mk / bsd.own.mk
1 # $FreeBSD$
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 # CONFDIR       Base path for configuration files. [/etc]
67 #
68 # CONFOWN       Configuration file owner. [root]
69 #
70 # CONFGRP       Configuration file group. [wheel]
71 #
72 # CONFMODE      Configuration file mode. [644]
73 #
74 #
75 # DOCDIR        Base path for system documentation (e.g. PSD, USD,
76 #               handbook, FAQ etc.). [${SHAREDIR}/doc]
77 #
78 # DOCOWN        Documentation owner. [${SHAREOWN}]
79 #
80 # DOCGRP        Documentation group. [${SHAREGRP}]
81 #
82 # DOCMODE       Documentation mode. [${NOBINMODE}]
83 #
84 #
85 # INFODIR       Base path for GNU's hypertext system
86 #               called Info (see info(1)). [${SHAREDIR}/info]
87 #
88 # INFOOWN       Info owner. [${SHAREOWN}]
89 #
90 # INFOGRP       Info group. [${SHAREGRP}]
91 #
92 # INFOMODE      Info mode. [${NOBINMODE}]
93 #
94 #
95 # MANDIR        Base path for manual installation. [${SHAREDIR}/man/man]
96 #
97 # MANOWN        Manual owner. [${SHAREOWN}]
98 #
99 # MANGRP        Manual group. [${SHAREGRP}]
100 #
101 # MANMODE       Manual mode. [${NOBINMODE}]
102 #
103 #
104 # NLSDIR        Base path for National Language Support files
105 #               installation. [${SHAREDIR}/nls]
106 #
107 # NLSOWN        National Language Support files owner. [${SHAREOWN}]
108 #
109 # NLSGRP        National Language Support files group. [${SHAREGRP}]
110 #
111 # NLSMODE       National Language Support files mode. [${NOBINMODE}]
112 #
113 # INCLUDEDIR    Base path for standard C include files [/usr/include]
114
115 .if !target(__<bsd.own.mk>__)
116 __<bsd.own.mk>__:
117
118 .if !defined(_WITHOUT_SRCCONF)
119 SRCCONF?=       /etc/src.conf
120 .if exists(${SRCCONF})
121 .include "${SRCCONF}"
122 .endif
123 .endif
124
125 # Binaries
126 BINOWN?=        root
127 BINGRP?=        wheel
128 BINMODE?=       555
129 NOBINMODE?=     444
130
131 .if defined(MODULES_WITH_WORLD)
132 KMODDIR?=       /boot/modules
133 .else
134 KMODDIR?=       /boot/kernel
135 .endif
136 KMODOWN?=       ${BINOWN}
137 KMODGRP?=       ${BINGRP}
138 KMODMODE?=      ${BINMODE}
139
140 LIBDIR?=        /usr/lib
141 LIBCOMPATDIR?=  /usr/lib/compat
142 LIBDATADIR?=    /usr/libdata
143 LIBEXECDIR?=    /usr/libexec
144 LINTLIBDIR?=    /usr/libdata/lint
145 SHLIBDIR?=      ${LIBDIR}
146 LIBOWN?=        ${BINOWN}
147 LIBGRP?=        ${BINGRP}
148 LIBMODE?=       ${NOBINMODE}
149
150
151 # Share files
152 SHAREDIR?=      /usr/share
153 SHAREOWN?=      root
154 SHAREGRP?=      wheel
155 SHAREMODE?=     ${NOBINMODE}
156
157 CONFDIR?=       /etc
158 CONFOWN?=       root
159 CONFGRP?=       wheel
160 CONFMODE?=      644
161
162 MANDIR?=        ${SHAREDIR}/man/man
163 MANOWN?=        ${SHAREOWN}
164 MANGRP?=        ${SHAREGRP}
165 MANMODE?=       ${NOBINMODE}
166
167 DOCDIR?=        ${SHAREDIR}/doc
168 DOCOWN?=        ${SHAREOWN}
169 DOCGRP?=        ${SHAREGRP}
170 DOCMODE?=       ${NOBINMODE}
171
172 INFODIR?=       ${SHAREDIR}/info
173 INFOOWN?=       ${SHAREOWN}
174 INFOGRP?=       ${SHAREGRP}
175 INFOMODE?=      ${NOBINMODE}
176
177 NLSDIR?=        ${SHAREDIR}/nls
178 NLSOWN?=        ${SHAREOWN}
179 NLSGRP?=        ${SHAREGRP}
180 NLSMODE?=       ${NOBINMODE}
181
182 INCLUDEDIR?=    /usr/include
183
184 # Common variables
185 .if !defined(DEBUG_FLAGS)
186 STRIP?=         -s
187 .endif
188
189 COMPRESS_CMD?=  gzip -cn
190 COMPRESS_EXT?=  .gz
191
192 .if !defined(_WITHOUT_SRCCONF)
193 #
194 # Define MK_* variables (which are either "yes" or "no") for users
195 # to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
196 # make(1) environment.
197 # These should be tested with `== "no"' or `!= "no"' in makefiles.
198 # The NO_* variables should only be set by makefiles.
199 #
200
201 #
202 # Supported NO_* options (if defined, MK_* will be forced to "no",
203 # regardless of user's setting).
204 #
205 .for var in \
206     CTF \
207     INSTALLLIB \
208     MAN \
209     PROFILE
210 .if defined(NO_${var})
211 .if defined(WITH_${var})
212 .warning unsetting WITH_${var}
213 .undef WITH_${var}
214 .if defined(WITH_${var})
215 .error wtf
216 .endif
217 .endif
218 WITHOUT_${var}=
219 .endif
220 .endfor
221
222 #
223 # Compat NO_* options (same as above, except their use is deprecated).
224 #
225 .if !defined(BURN_BRIDGES)
226 .for var in \
227     ACPI \
228     ATM \
229     AUDIT \
230     AUTHPF \
231     BIND \
232     BIND_DNSSEC \
233     BIND_ETC \
234     BIND_LIBS_LWRES \
235     BIND_MTREE \
236     BIND_NAMED \
237     BIND_UTILS \
238     BLUETOOTH \
239     BOOT \
240     CALENDAR \
241     CPP \
242     CRYPT \
243     CVS \
244     CXX \
245     DICT \
246     DYNAMICROOT \
247     EXAMPLES \
248     FORTH \
249     FP_LIBC \
250     GAMES \
251     GCOV \
252     GDB \
253     GNU \
254     GPIB \
255     GROFF \
256     HTML \
257     INET6 \
258     INFO \
259     IPFILTER \
260     IPX \
261     KERBEROS \
262     LIB32 \
263     LIBPTHREAD \
264     LIBTHR \
265     LOCALES \
266     LPR \
267     MAILWRAPPER \
268     NETCAT \
269     NIS \
270     NLS \
271     NLS_CATALOGS \
272     NS_CACHING \
273     OPENSSH \
274     OPENSSL \
275     PAM \
276     PF \
277     RCMDS \
278     RCS \
279     RESCUE \
280     SENDMAIL \
281     SETUID_LOGIN \
282     SHAREDOCS \
283     SYSCONS \
284     TCSH \
285     TOOLCHAIN \
286     USB \
287     WPA_SUPPLICANT_EAPOL
288 .if defined(NO_${var})
289 #.warning NO_${var} is deprecated in favour of WITHOUT_${var}=
290 WITHOUT_${var}=
291 .endif
292 .endfor
293 .endif # !defined(BURN_BRIDGES)
294
295 #
296 # Older-style variables that enabled behaviour when set.
297 #
298 .if defined(YES_HESIOD)
299 WITH_HESIOD=
300 .endif
301 .if defined(MAKE_IDEA)
302 WITH_IDEA=
303 .endif
304
305 __DEFAULT_YES_OPTIONS = \
306     ACCT \
307     ACPI \
308     AMD \
309     APM \
310     ASSERT_DEBUG \
311     AT \
312     ATM \
313     AUDIT \
314     AUTHPF \
315     BIND \
316     BIND_DNSSEC \
317     BIND_ETC \
318     BIND_LIBS_LWRES \
319     BIND_MTREE \
320     BIND_NAMED \
321     BIND_UTILS \
322     BINUTILS \
323     BLUETOOTH \
324     BOOT \
325     BSD_CPIO \
326     BSNMP \
327     SOURCELESS \
328     SOURCELESS_HOST \
329     SOURCELESS_UCODE \
330     BZIP2 \
331     CALENDAR \
332     CDDL \
333     CPP \
334     CRYPT \
335     CTM \
336     CVS \
337     CXX \
338     DICT \
339     DYNAMICROOT \
340     EXAMPLES \
341     FLOPPY \
342     FORTH \
343     FP_LIBC \
344     FREEBSD_UPDATE \
345     GAMES \
346     GCC \
347     GCOV \
348     GDB \
349     GNU \
350     GPIB \
351     GPIO \
352     GROFF \
353     HTML \
354     INET \
355     INET6 \
356     INFO \
357     INSTALLLIB \
358     IPFILTER \
359     IPFW \
360     IPX \
361     JAIL \
362     KERBEROS \
363     KERNEL_SYMBOLS \
364     KVM \
365     LEGACY_CONSOLE \
366     LIB32 \
367     LIBPTHREAD \
368     LIBTHR \
369     LOCALES \
370     LOCATE \
371     LPR \
372     MAIL \
373     MAILWRAPPER \
374     MAKE \
375     MAN \
376     NCP \
377     NDIS \
378     NETCAT \
379     NETGRAPH \
380     NIS \
381     NLS \
382     NLS_CATALOGS \
383     NS_CACHING \
384     NTP \
385     OPENSSH \
386     OPENSSL \
387     PAM \
388     PF \
389     PKGTOOLS \
390     PMC \
391     PORTSNAP \
392     PPP \
393     PROFILE \
394     QUOTAS \
395     RCMDS \
396     RCS \
397     RESCUE \
398     ROUTED \
399     SENDMAIL \
400     SETUID_LOGIN \
401     SHAREDOCS \
402     SSP \
403     SYSINSTALL \
404     SYMVER \
405     SYSCONS \
406     TCSH \
407     TELNET \
408     TEXTPROC \
409     TOOLCHAIN \
410     USB \
411     UTMPX \
412     WIRELESS \
413     WPA_SUPPLICANT_EAPOL \
414     ZFS \
415     ZONEINFO
416
417 __DEFAULT_NO_OPTIONS = \
418     BSD_GREP \
419     BIND_IDN \
420     BIND_LARGE_FILE \
421     BIND_LIBS \
422     BIND_SIGCHASE \
423     BIND_XML \
424     CLANG_EXTRAS \
425     CLANG_IS_CC \
426     CTF \
427     HESIOD \
428     ICONV \
429     IDEA \
430     LIBCPLUSPLUS \
431     OFED \
432     SHARED_TOOLCHAIN
433
434 #
435 # Default behaviour of some options depends on the architecture.  Unfortunately
436 # this means that we have to test TARGET_ARCH (the buildworld case) as well
437 # as MACHINE_ARCH (the non-buildworld case).  Normally TARGET_ARCH is not
438 # used at all in bsd.*.mk, but we have to make an exception here if we want
439 # to allow defaults for some things like clang and fdt to vary by target
440 # architecture.
441 #
442 .if defined(TARGET_ARCH)
443 __T=${TARGET_ARCH}
444 .else
445 __T=${MACHINE_ARCH}
446 .endif
447 # Clang is only for x86 and powerpc right now, by default.
448 .if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*}
449 __DEFAULT_YES_OPTIONS+=CLANG
450 .else
451 __DEFAULT_NO_OPTIONS+=CLANG
452 .endif
453 # FDT is needed only for arm and powerpc
454 .if ${__T:Marm*} || ${__T:Mpowerpc*}
455 __DEFAULT_YES_OPTIONS+=FDT
456 .else
457 __DEFAULT_NO_OPTIONS+=FDT
458 .endif
459 .undef __T
460
461 #
462 # MK_* options which default to "yes".
463 #
464 .for var in ${__DEFAULT_YES_OPTIONS}
465 .if defined(WITH_${var}) && defined(WITHOUT_${var})
466 .error WITH_${var} and WITHOUT_${var} can't both be set.
467 .endif
468 .if defined(MK_${var})
469 .error MK_${var} can't be set by a user.
470 .endif
471 .if defined(WITHOUT_${var})
472 MK_${var}:=     no
473 .else
474 MK_${var}:=     yes
475 .endif
476 .endfor
477 .undef __DEFAULT_YES_OPTIONS
478
479 #
480 # MK_* options which default to "no".
481 #
482 .for var in ${__DEFAULT_NO_OPTIONS}
483 .if defined(WITH_${var}) && defined(WITHOUT_${var})
484 .error WITH_${var} and WITHOUT_${var} can't both be set.
485 .endif
486 .if defined(MK_${var})
487 .error MK_${var} can't be set by a user.
488 .endif
489 .if defined(WITH_${var})
490 MK_${var}:=     yes
491 .else
492 MK_${var}:=     no
493 .endif
494 .endfor
495 .undef __DEFAULT_NO_OPTIONS
496
497 #
498 # Force some options off if their dependencies are off.
499 # Order is somewhat important.
500 #
501 .if ${MK_LIBPTHREAD} == "no"
502 MK_LIBTHR:=     no
503 .endif
504
505 .if ${MK_LIBTHR} == "no"
506 MK_BIND:=       no
507 .endif
508
509 .if ${MK_BIND} == "no"
510 MK_BIND_DNSSEC:= no
511 MK_BIND_ETC:=   no
512 MK_BIND_LIBS:=  no
513 MK_BIND_LIBS_LWRES:= no
514 MK_BIND_MTREE:= no
515 MK_BIND_NAMED:= no
516 MK_BIND_UTILS:= no
517 .endif
518
519 .if ${MK_BIND_MTREE} == "no"
520 MK_BIND_ETC:=   no
521 .endif
522
523 .if ${MK_SOURCELESS} == "no"
524 MK_SOURCELESS_HOST:=    no
525 MK_SOURCELESS_UCODE:= no
526 .endif
527
528 .if ${MK_CDDL} == "no"
529 MK_ZFS:=        no
530 MK_CTF:=        no
531 .endif
532
533 .if ${MK_CLANG} == "no"
534 MK_CLANG_EXTRAS:= no
535 .endif
536
537 .if ${MK_CRYPT} == "no"
538 MK_OPENSSL:=    no
539 MK_OPENSSH:=    no
540 MK_KERBEROS:=   no
541 .endif
542
543 .if ${MK_CXX} == "no"
544 MK_CLANG:=      no
545 MK_GROFF:=      no
546 .endif
547
548 .if ${MK_IPX} == "no"
549 MK_NCP:=        no
550 .endif
551
552 .if ${MK_MAIL} == "no"
553 MK_MAILWRAPPER:= no
554 MK_SENDMAIL:=   no
555 .endif
556
557 .if ${MK_NETGRAPH} == "no"
558 MK_ATM:=        no
559 MK_BLUETOOTH:=  no
560 .endif
561
562 .if ${MK_OPENSSL} == "no"
563 MK_OPENSSH:=    no
564 MK_KERBEROS:=   no
565 .endif
566
567 .if ${MK_PF} == "no"
568 MK_AUTHPF:=     no
569 .endif
570
571 .if ${MK_TEXTPROC} == "no"
572 MK_GROFF:=      no
573 .endif
574
575 .if ${MK_TOOLCHAIN} == "no"
576 MK_BINUTILS:=   no
577 MK_CLANG:=      no
578 MK_GCC:=        no
579 MK_GDB:=        no
580 .endif
581
582 .if ${MK_CLANG} == "no"
583 MK_CLANG_IS_CC:= no
584 .endif
585
586 MK_LIBCPLUSPLUS?= no
587
588 MK_LIBCPLUSPLUS?= no
589
590 #
591 # Set defaults for the MK_*_SUPPORT variables.
592 #
593
594 #
595 # MK_*_SUPPORT options which default to "yes" unless their corresponding
596 # MK_* variable is set to "no".
597 #
598 .for var in \
599     BZIP2 \
600     GNU \
601     INET \
602     INET6 \
603     IPX \
604     KERBEROS \
605     KVM \
606     NETGRAPH \
607     PAM \
608     WIRELESS
609 .if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT)
610 .error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set.
611 .endif
612 .if defined(MK_${var}_SUPPORT)
613 .error MK_${var}_SUPPORT can't be set by a user.
614 .endif
615 .if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no"
616 MK_${var}_SUPPORT:= no
617 .else
618 MK_${var}_SUPPORT:= yes
619 .endif
620 .endfor
621
622 #
623 # MK_* options whose default value depends on another option.
624 #
625 .for vv in \
626     GSSAPI/KERBEROS \
627     MAN_UTILS/MAN
628 .if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H})
629 .error WITH_${vv:H} and WITHOUT_${vv:H} can't both be set.
630 .endif
631 .if defined(MK_${vv:H})
632 .error MK_${vv:H} can't be set by a user.
633 .endif
634 .if defined(WITH_${vv:H})
635 MK_${vv:H}:=    yes
636 .elif defined(WITHOUT_${vv:H})
637 MK_${vv:H}:=    no
638 .else
639 MK_${vv:H}:=    ${MK_${vv:T}}
640 .endif
641 .endfor
642
643 .if ${MK_CTF} != "no"
644 CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
645 .elif ${MAKE_VERSION} >= 9201210220
646 CTFCONVERT_CMD=
647 .else
648 CTFCONVERT_CMD= @:
649 .endif 
650
651 .endif # !_WITHOUT_SRCCONF
652
653 .endif  # !target(__<bsd.own.mk>__)