xref: /freebsd/share/mk/bsd.own.mk (revision 282a3889ebf826db9839be296ff1dd903f6d6d6e)
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# LINTLIBDIR	Base path for lint libraries. [/usr/libdata/lint]
34#
35# SHLIBDIR	Base path for shared libraries. [${LIBDIR}]
36#
37# LIBOWN	Library owner. [${BINOWN}]
38#
39# LIBGRP	Library group. [${BINGRP}]
40#
41# LIBMODE	Library mode. [${NOBINMODE}]
42#
43#
44# KMODDIR	Base path for loadable kernel modules
45#		(see kld(4)). [/boot/kernel]
46#
47# KMODOWN	KLD owner. [${BINOWN}]
48#
49# KMODGRP	KLD group. [${BINGRP}]
50#
51# KMODMODE	KLD mode. [${BINMODE}]
52#
53#
54# SHAREDIR	Base path for architecture-independent ascii
55#		text files. [/usr/share]
56#
57# SHAREOWN	ASCII text file owner. [root]
58#
59# SHAREGRP	ASCII text file group. [wheel]
60#
61# SHAREMODE	ASCII text file mode. [${NOBINMODE}]
62#
63#
64# DOCDIR	Base path for system documentation (e.g. PSD, USD,
65#		handbook, FAQ etc.). [${SHAREDIR}/doc]
66#
67# DOCOWN	Documentation owner. [${SHAREOWN}]
68#
69# DOCGRP	Documentation group. [${SHAREGRP}]
70#
71# DOCMODE	Documentation mode. [${NOBINMODE}]
72#
73#
74# INFODIR	Base path for GNU's hypertext system
75#		called Info (see info(1)). [${SHAREDIR}/info]
76#
77# INFOOWN	Info owner. [${SHAREOWN}]
78#
79# INFOGRP	Info group. [${SHAREGRP}]
80#
81# INFOMODE	Info mode. [${NOBINMODE}]
82#
83#
84# MANDIR	Base path for manual installation. [${SHAREDIR}/man/man]
85#
86# MANOWN	Manual owner. [${SHAREOWN}]
87#
88# MANGRP	Manual group. [${SHAREGRP}]
89#
90# MANMODE	Manual mode. [${NOBINMODE}]
91#
92#
93# NLSDIR	Base path for National Language Support files
94#		installation. [${SHAREDIR}/nls]
95#
96# NLSOWN	National Language Support files owner. [${SHAREOWN}]
97#
98# NLSGRP	National Language Support files group. [${SHAREGRP}]
99#
100# NLSMODE	National Language Support files mode. [${NOBINMODE}]
101#
102# INCLUDEDIR	Base path for standard C include files [/usr/include]
103
104.if !target(__<bsd.own.mk>__)
105__<bsd.own.mk>__:
106
107.if !defined(_WITHOUT_SRCCONF)
108SRCCONF?=	/etc/src.conf
109.if exists(${SRCCONF})
110.include "${SRCCONF}"
111.endif
112.endif
113
114# Binaries
115BINOWN?=	root
116BINGRP?=	wheel
117BINMODE?=	555
118NOBINMODE?=	444
119
120.if defined(MODULES_WITH_WORLD)
121KMODDIR?=	/boot/modules
122.else
123KMODDIR?=	/boot/kernel
124.endif
125KMODOWN?=	${BINOWN}
126KMODGRP?=	${BINGRP}
127KMODMODE?=	${BINMODE}
128
129LIBDIR?=	/usr/lib
130LIBCOMPATDIR?=	/usr/lib/compat
131LIBDATADIR?=	/usr/libdata
132LINTLIBDIR?=	/usr/libdata/lint
133SHLIBDIR?=	${LIBDIR}
134LIBOWN?=	${BINOWN}
135LIBGRP?=	${BINGRP}
136LIBMODE?=	${NOBINMODE}
137
138
139# Share files
140SHAREDIR?=	/usr/share
141SHAREOWN?=	root
142SHAREGRP?=	wheel
143SHAREMODE?=	${NOBINMODE}
144
145MANDIR?=	${SHAREDIR}/man/man
146MANOWN?=	${SHAREOWN}
147MANGRP?=	${SHAREGRP}
148MANMODE?=	${NOBINMODE}
149
150DOCDIR?=	${SHAREDIR}/doc
151DOCOWN?=	${SHAREOWN}
152DOCGRP?=	${SHAREGRP}
153DOCMODE?=	${NOBINMODE}
154
155INFODIR?=	${SHAREDIR}/info
156INFOOWN?=	${SHAREOWN}
157INFOGRP?=	${SHAREGRP}
158INFOMODE?=	${NOBINMODE}
159
160NLSDIR?=	${SHAREDIR}/nls
161NLSOWN?=	${SHAREOWN}
162NLSGRP?=	${SHAREGRP}
163NLSMODE?=	${NOBINMODE}
164
165DEFAULT_THREAD_LIB?=	libthr
166
167INCLUDEDIR?=	/usr/include
168
169# Common variables
170.if !defined(DEBUG_FLAGS)
171STRIP?=		-s
172.endif
173
174COMPRESS_CMD?=	gzip -cn
175COMPRESS_EXT?=	.gz
176
177.if !defined(_WITHOUT_SRCCONF)
178#
179# Define MK_* variables (which are either "yes" or "no") for users
180# to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
181# make(1) environment.
182# These should be tested with `== "no"' or `!= "no"' in makefiles.
183# The NO_* variables should only be set by makefiles.
184#
185
186#
187# Supported NO_* options (if defined, MK_* will be forced to "no",
188# regardless of user's setting).
189#
190.for var in \
191    MAN \
192    PROFILE
193.if defined(NO_${var})
194WITHOUT_${var}=
195.endif
196.endfor
197
198#
199# Compat NO_* options (same as above, except their use is deprecated).
200#
201.if !defined(BURN_BRIDGES)
202.for var in \
203    ACPI \
204    ATM \
205    AUDIT \
206    AUTHPF \
207    BIND \
208    BIND_DNSSEC \
209    BIND_ETC \
210    BIND_LIBS_LWRES \
211    BIND_MTREE \
212    BIND_NAMED \
213    BIND_UTILS \
214    BLUETOOTH \
215    BOOT \
216    CALENDAR \
217    CPP \
218    CRYPT \
219    CVS \
220    CXX \
221    DICT \
222    DYNAMICROOT \
223    EXAMPLES \
224    FORTH \
225    FORTRAN \
226    FP_LIBC \
227    GAMES \
228    GCOV \
229    GDB \
230    GNU \
231    GPIB \
232    GROFF \
233    HTML \
234    I4B \
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# MK_* options which default to "yes".
286#
287.for var in \
288    ACPI \
289    ASSERT_DEBUG \
290    ATM \
291    AUDIT \
292    AUTHPF \
293    BIND \
294    BIND_DNSSEC \
295    BIND_ETC \
296    BIND_LIBS_LWRES \
297    BIND_MTREE \
298    BIND_NAMED \
299    BIND_UTILS \
300    BLUETOOTH \
301    BOOT \
302    BZIP2 \
303    CALENDAR \
304    CDDL \
305    CPP \
306    CRYPT \
307    CVS \
308    CXX \
309    DICT \
310    DYNAMICROOT \
311    EXAMPLES \
312    FORTH \
313    FORTRAN \
314    FP_LIBC \
315    GAMES \
316    GCOV \
317    GDB \
318    GNU \
319    GPIB \
320    GROFF \
321    HTML \
322    I4B \
323    INET6 \
324    INFO \
325    IPFILTER \
326    IPX \
327    KERBEROS \
328    KVM \
329    LIB32 \
330    LIBPTHREAD \
331    LIBTHR \
332    LOCALES \
333    LPR \
334    MAILWRAPPER \
335    MAN \
336    NCP \
337    NETCAT \
338    NIS \
339    NLS \
340    NLS_CATALOGS \
341    NS_CACHING \
342    OBJC \
343    OPENSSH \
344    OPENSSL \
345    PAM \
346    PF \
347    PROFILE \
348    RCMDS \
349    RCS \
350    RESCUE \
351    SENDMAIL \
352    SETUID_LOGIN \
353    SHAREDOCS \
354    SSP \
355    SYMVER \
356    SYSCONS \
357    TCSH \
358    TOOLCHAIN \
359    USB \
360    WPA_SUPPLICANT_EAPOL \
361    ZONEINFO \
362    ZFS
363.if defined(WITH_${var}) && defined(WITHOUT_${var})
364.error WITH_${var} and WITHOUT_${var} can't both be set.
365.endif
366.if defined(MK_${var})
367.error MK_${var} can't be set by a user.
368.endif
369.if defined(WITHOUT_${var})
370MK_${var}:=	no
371.else
372MK_${var}:=	yes
373.endif
374.endfor
375
376#
377# MK_* options which default to "no".
378#
379.for var in \
380    BIND_LIBS \
381    HESIOD \
382    IDEA
383.if defined(WITH_${var}) && defined(WITHOUT_${var})
384.error WITH_${var} and WITHOUT_${var} can't both be set.
385.endif
386.if defined(MK_${var})
387.error MK_${var} can't be set by a user.
388.endif
389.if defined(WITH_${var})
390MK_${var}:=	yes
391.else
392MK_${var}:=	no
393.endif
394.endfor
395
396#
397# Force some options off if their dependencies are off.
398#
399.if ${MK_BIND} == "no"
400MK_BIND_DNSSEC:= no
401MK_BIND_ETC:=	no
402MK_BIND_LIBS:=	no
403MK_BIND_LIBS_LWRES:= no
404MK_BIND_MTREE:=	no
405MK_BIND_NAMED:=	no
406MK_BIND_UTILS:=	no
407.endif
408
409.if ${MK_BIND_MTREE} == "no"
410MK_BIND_ETC:=	no
411.endif
412
413.if ${MK_CDDL} == "no"
414MK_ZFS:=	no
415.endif
416
417.if ${MK_CRYPT} == "no"
418MK_OPENSSL:=	no
419MK_OPENSSH:=	no
420MK_KERBEROS:=	no
421.endif
422
423.if ${MK_IPX} == "no"
424MK_NCP:=	no
425.endif
426
427.if ${MK_OPENSSL} == "no"
428MK_OPENSSH:=	no
429MK_KERBEROS:=	no
430.endif
431
432.if ${MK_PF} == "no"
433MK_AUTHPF:=	no
434.endif
435
436.if ${MK_TOOLCHAIN} == "no"
437MK_GDB:=	no
438.endif
439
440#
441# Set defaults for the MK_*_SUPPORT variables.
442#
443
444#
445# MK_*_SUPPORT options which default to "yes" unless their corresponding
446# MK_* variable is set to "no".
447#
448.for var in \
449    BZIP2 \
450    GNU \
451    INET6 \
452    IPX \
453    KERBEROS \
454    KVM \
455    PAM
456.if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT)
457.error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set.
458.endif
459.if defined(MK_${var}_SUPPORT)
460.error MK_${var}_SUPPORT can't be set by a user.
461.endif
462.if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no"
463MK_${var}_SUPPORT:= no
464.else
465MK_${var}_SUPPORT:= yes
466.endif
467.endfor
468.endif # !_WITHOUT_SRCCONF
469
470.endif	# !target(__<bsd.own.mk>__)
471