xref: /freebsd/share/mk/bsd.own.mk (revision 1db64f89363c97858961c4df0b7d02f3223723cf)
1#
2# The include file <bsd.own.mk> set common variables for owner,
3# group, mode, and directories. Defaults are in brackets.
4#
5#
6# +++ variables +++
7#
8# DESTDIR	Change the tree where the file gets installed. [not set]
9#
10# DISTDIR	Change the tree where the file for a distribution
11# 		gets installed (see /usr/src/release/Makefile). [not set]
12#
13# COMPRESS_CMD	Program to compress documents.
14#		Output is to stdout. [gzip -cn]
15#
16# COMPRESS_EXT	File name extension of ${COMPRESS_CMD} command. [.gz]
17#
18# BINOWN	Binary owner. [root]
19#
20# BINGRP	Binary group. [wheel]
21#
22# BINMODE	Binary mode. [555]
23#
24# NOBINMODE	Mode for non-executable files. [444]
25#
26# LIBDIR	Base path for libraries. [/usr/lib]
27#
28# LIBCOMPATDIR	Base path for compat libraries. [/usr/lib/compat]
29#
30# LIBDATADIR	Base path for misc. utility data files. [/usr/libdata]
31#
32# LIBEXECDIR	Base path for system daemons and utilities. [/usr/libexec]
33#
34# SHLIBDIR	Base path for shared libraries. [${LIBDIR}]
35#
36# LIBOWN	Library owner. [${BINOWN}]
37#
38# LIBGRP	Library group. [${BINGRP}]
39#
40# LIBMODE	Library mode. [${NOBINMODE}]
41#
42#
43# DEBUGDIR	Base path for standalone debug files. [/usr/lib/debug]
44#
45# DEBUGMODE	Mode for debug files. [${NOBINMODE}]
46#
47#
48# KMODDIR	Base path for loadable kernel modules
49#		(see kld(4)). [/boot/modules]
50#
51# KMODOWN	Kernel and KLD owner. [${BINOWN}]
52#
53# KMODGRP	Kernel and KLD group. [${BINGRP}]
54#
55# KMODMODE	KLD mode. [${BINMODE}]
56#
57#
58# EFIDIR	Base path for the UEFI ESP [/boot/efi]
59#
60# EFIOWN	EFIDIR owner. [root]
61#
62# EFIGRP	EFIDIR group. [wheel]
63#
64# EFIMODE	EFIDIR mode. [555]
65#
66#
67# SHAREDIR	Base path for architecture-independent ascii
68#		text files. [/usr/share]
69#
70# SHAREOWN	ASCII text file owner. [root]
71#
72# SHAREGRP	ASCII text file group. [wheel]
73#
74# SHAREMODE	ASCII text file mode. [${NOBINMODE}]
75#
76#
77# CONFDIR	Base path for configuration files. [/etc]
78#
79# CONFOWN	Configuration file owner. [root]
80#
81# CONFGRP	Configuration file group. [wheel]
82#
83# CONFMODE	Configuration file mode. [644]
84#
85#
86# DIROWN	Directory owner. [root]
87#
88# DIRGRP	Directory group. [wheel]
89#
90# DIRMODE	Directory mode. [755]
91#
92#
93# DOCDIR	Base path for system documentation (e.g. PSD, USD,
94#		handbook, FAQ etc.). [${SHAREDIR}/doc]
95#
96# DOCOWN	Documentation owner. [${SHAREOWN}]
97#
98# DOCGRP	Documentation group. [${SHAREGRP}]
99#
100# DOCMODE	Documentation mode. [${NOBINMODE}]
101#
102#
103# INFODIR	Base path for GNU's hypertext system
104#		called Info (see info(1)). [${SHAREDIR}/info]
105#
106# INFOOWN	Info owner. [${SHAREOWN}]
107#
108# INFOGRP	Info group. [${SHAREGRP}]
109#
110# INFOMODE	Info mode. [${NOBINMODE}]
111#
112#
113# MANDIR	Base path for manual installation. [${SHAREDIR}/man/man]
114#
115# MANOWN	Manual owner. [${SHAREOWN}]
116#
117# MANGRP	Manual group. [${SHAREGRP}]
118#
119# MANMODE	Manual mode. [${NOBINMODE}]
120#
121#
122# NLSDIR	Base path for National Language Support files
123#		installation. [${SHAREDIR}/nls]
124#
125# NLSOWN	National Language Support files owner. [${SHAREOWN}]
126#
127# NLSGRP	National Language Support files group. [${SHAREGRP}]
128#
129# NLSMODE	National Language Support files mode. [${NOBINMODE}]
130#
131# INCLUDEDIR	Base path for standard C include files [/usr/include]
132#
133# PKG_CMD	Program for creating and manipulating packages.
134#               [pkg]
135#
136# LINKOWN	Hard link owner [${BINOWN}]
137#
138# LINKGRP	Hard link group [${BINGRP}]
139#
140# LINKMODE	Hard link mode [${NOBINMODE}]
141#
142# SYMLINKOWN	Symbolic link owner [${BINOWN} or ${LIBOWN}]
143#
144# SYMLINKGRP	Symbolic link group [${BINGRP} or ${LIBGRP}]
145#
146# SYMLINKMODE	Symbolic link mode [755]
147
148.if !target(__<bsd.own.mk>__)
149__<bsd.own.mk>__:
150
151.include <bsd.opts.mk>		# options now here or src.opts.mk
152
153.if !defined(_WITHOUT_SRCCONF)
154
155.if ${MK_CTF} != "no"
156CTFCONVERT_CMD=	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
157.elif defined(.PARSEDIR) || (defined(MAKE_VERSION) && ${MAKE_VERSION} >= 5201111300)
158CTFCONVERT_CMD=
159.else
160CTFCONVERT_CMD=	@:
161.endif
162
163.endif # !_WITHOUT_SRCCONF
164
165# Binaries
166BINOWN?=	root
167BINGRP?=	wheel
168BINMODE?=	555
169NOBINMODE?=	444
170
171KMODDIR?=	/boot/modules
172KMODOWN?=	${BINOWN}
173KMODGRP?=	${BINGRP}
174KMODMODE?=	${NOBINMODE}
175DTBDIR?=	/boot/dtb
176DTBODIR?=	/boot/dtb/overlays
177DTBOWN?=	root
178DTBGRP?=	wheel
179DTBMODE?=	444
180EFIDIR?=	/boot/efi
181EFIOWN?=	root
182EFIGRP?=	wheel
183EFIMODE?=	555
184
185# Use make.conf / environment LIBDIR as default if set...
186.if !empty(_PREMK_LIBDIR)
187LIBDIR_BASE?=	${_PREMK_LIBDIR}
188.endif
189# otherwise use our expected default value.
190LIBDIR_BASE?=	/usr/lib
191LIBDIR?=	${LIBDIR_BASE}
192LIBCOMPATDIR?=	/usr/lib/compat
193LIBDATADIR?=	/usr/libdata
194LIBEXECDIR?=	/usr/libexec
195SHLIBDIR?=	${LIBDIR}
196LIBOWN?=	${BINOWN}
197LIBGRP?=	${BINGRP}
198LIBMODE?=	${NOBINMODE}
199
200DEBUGDIR?=	/usr/lib/debug
201DEBUGMODE?=	${NOBINMODE}
202
203
204# Share files
205SHAREDIR?=	/usr/share
206SHAREOWN?=	root
207SHAREGRP?=	wheel
208SHAREMODE?=	${NOBINMODE}
209
210CONFDIR?=	/etc
211CONFOWN?=	root
212CONFGRP?=	wheel
213CONFMODE?=	644
214
215MANDIR?=	${SHAREDIR}/man/man
216MANOWN?=	${SHAREOWN}
217MANGRP?=	${SHAREGRP}
218MANMODE?=	${NOBINMODE}
219
220DIROWN?=	root
221DIRGRP?=	wheel
222DIRMODE?=	755
223
224DOCDIR?=	${SHAREDIR}/doc
225DOCOWN?=	${SHAREOWN}
226DOCGRP?=	${SHAREGRP}
227DOCMODE?=	${NOBINMODE}
228
229INFODIR?=	${SHAREDIR}/info
230INFOOWN?=	${SHAREOWN}
231INFOGRP?=	${SHAREGRP}
232INFOMODE?=	${NOBINMODE}
233
234NLSDIR?=	${SHAREDIR}/nls
235NLSOWN?=	${SHAREOWN}
236NLSGRP?=	${SHAREGRP}
237NLSMODE?=	${NOBINMODE}
238
239INCLUDEDIR?=	/usr/include
240
241#
242# install(1) parameters.
243#
244_LINKOWN?=	${LINKOWN:U${BINOWN}}
245_LINKGRP?=	${LINKGRP:U${BINGRP}}
246_LINKMODE?=	${LINKMODE:U${NOBINMODE}}
247_SYMLINKOWN?=	${SYMLINKOWN:U${BINOWN}}
248_SYMLINKGRP?=	${SYMLINKGRP:U${BINGRP}}
249_SYMLINKMODE?=	${SYMLINKMODE:U755}
250HRDLINK?=	-l mr -o ${_LINKOWN} -g ${_LINKGRP} -m ${_LINKMODE}
251MANHRDLINK?=	-l h -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
252SYMLINK?=	-l s -o ${_SYMLINKOWN} -g ${_SYMLINKGRP} -m ${_SYMLINKMODE}
253LSYMLINK?=	-l s -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE}
254RSYMLINK?=	-l rs -o ${_SYMLINKOWN} -g ${_SYMLINKGRP} -m ${_SYMLINKMODE}
255
256INSTALL_LINK?=		${INSTALL} ${HRDLINK}
257INSTALL_MANLINK?=	${INSTALL} ${MANHRDLINK}
258INSTALL_SYMLINK?=	${INSTALL} ${SYMLINK}
259INSTALL_LIBSYMLINK?=	${INSTALL} ${LSYMLINK}
260INSTALL_RSYMLINK?=	${INSTALL} ${RSYMLINK}
261
262# Common variables
263.if !defined(DEBUG_FLAGS)
264STRIP?=		-s
265.endif
266
267TAR_CMD?=	tar
268
269COMPRESS_CMD?=	gzip -cn
270COMPRESS_EXT?=	.gz
271
272# Set XZ_THREADS to 1 to disable multi-threading.
273XZ_THREADS?=	0
274
275.if !empty(XZ_THREADS)
276XZ_CMD?=	xz -T ${XZ_THREADS}
277.else
278XZ_CMD?=	xz
279.endif
280
281PKG_CMD?=	pkg
282
283# Pointer to the top directory into which tests are installed.  Should not be
284# overridden by Makefiles, but the user may choose to set this in src.conf(5).
285TESTSBASE?= /usr/tests
286
287DEPENDFILE?=	.depend
288
289# Compat for the moment -- old bsd.own.mk only included this when _WITHOUT_SRCCONF
290# wasn't defined. bsd.ports.mk and friends depend on this behavior. Remove in 12.
291.if !defined(_WITHOUT_SRCCONF)
292.include <bsd.compiler.mk>
293.endif # !_WITHOUT_SRCCONF
294
295.endif	# !target(__<bsd.own.mk>__)
296