xref: /freebsd/share/mk/bsd.own.mk (revision 7899f917b1c0ea178f1d2be0cfb452086d079d23)
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.else
158CTFCONVERT_CMD=
159.endif
160
161.endif # !_WITHOUT_SRCCONF
162
163# Binaries
164BINOWN?=	root
165BINGRP?=	wheel
166BINMODE?=	555
167NOBINMODE?=	444
168
169KMODDIR?=	/boot/modules
170KMODOWN?=	${BINOWN}
171KMODGRP?=	${BINGRP}
172KMODMODE?=	${NOBINMODE}
173DTBDIR?=	/boot/dtb
174DTBODIR?=	/boot/dtb/overlays
175DTBOWN?=	root
176DTBGRP?=	wheel
177DTBMODE?=	444
178EFIDIR?=	/boot/efi
179EFIOWN?=	root
180EFIGRP?=	wheel
181EFIMODE?=	555
182
183# Use make.conf / environment LIBDIR as default if set...
184.if !empty(_PREMK_LIBDIR)
185LIBDIR_BASE?=	${_PREMK_LIBDIR}
186.endif
187# otherwise use our expected default value.
188LIBDIR_BASE?=	/usr/lib
189LIBDIR?=	${LIBDIR_BASE}
190LIBCOMPATDIR?=	/usr/lib/compat
191LIBDATADIR?=	/usr/libdata
192LIBEXECDIR?=	/usr/libexec
193SHLIBDIR?=	${LIBDIR}
194LIBOWN?=	${BINOWN}
195LIBGRP?=	${BINGRP}
196LIBMODE?=	${NOBINMODE}
197
198DEBUGDIR?=	/usr/lib/debug
199DEBUGMODE?=	${NOBINMODE}
200
201
202# Share files
203SHAREDIR?=	/usr/share
204SHAREOWN?=	root
205SHAREGRP?=	wheel
206SHAREMODE?=	${NOBINMODE}
207
208CONFDIR?=	/etc
209CONFOWN?=	root
210CONFGRP?=	wheel
211CONFMODE?=	644
212
213MANDIR?=	${SHAREDIR}/man/man
214MANOWN?=	${SHAREOWN}
215MANGRP?=	${SHAREGRP}
216MANMODE?=	${NOBINMODE}
217
218DIROWN?=	root
219DIRGRP?=	wheel
220DIRMODE?=	755
221
222DOCDIR?=	${SHAREDIR}/doc
223DOCOWN?=	${SHAREOWN}
224DOCGRP?=	${SHAREGRP}
225DOCMODE?=	${NOBINMODE}
226
227INFODIR?=	${SHAREDIR}/info
228INFOOWN?=	${SHAREOWN}
229INFOGRP?=	${SHAREGRP}
230INFOMODE?=	${NOBINMODE}
231
232NLSDIR?=	${SHAREDIR}/nls
233NLSOWN?=	${SHAREOWN}
234NLSGRP?=	${SHAREGRP}
235NLSMODE?=	${NOBINMODE}
236
237INCLUDEDIR?=	/usr/include
238
239#
240# install(1) parameters.
241#
242_LINKOWN?=	${LINKOWN:U${BINOWN}}
243_LINKGRP?=	${LINKGRP:U${BINGRP}}
244_LINKMODE?=	${LINKMODE:U${NOBINMODE}}
245_SYMLINKOWN?=	${SYMLINKOWN:U${BINOWN}}
246_SYMLINKGRP?=	${SYMLINKGRP:U${BINGRP}}
247_SYMLINKMODE?=	${SYMLINKMODE:U755}
248HRDLINK?=	-l mr -o ${_LINKOWN} -g ${_LINKGRP} -m ${_LINKMODE}
249MANHRDLINK?=	-l h -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
250SYMLINK?=	-l s -o ${_SYMLINKOWN} -g ${_SYMLINKGRP} -m ${_SYMLINKMODE}
251LSYMLINK?=	-l s -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE}
252RSYMLINK?=	-l rs -o ${_SYMLINKOWN} -g ${_SYMLINKGRP} -m ${_SYMLINKMODE}
253
254INSTALL_LINK?=		${INSTALL} ${HRDLINK}
255INSTALL_MANLINK?=	${INSTALL} ${MANHRDLINK}
256INSTALL_SYMLINK?=	${INSTALL} ${SYMLINK}
257INSTALL_LIBSYMLINK?=	${INSTALL} ${LSYMLINK}
258INSTALL_RSYMLINK?=	${INSTALL} ${RSYMLINK}
259
260# Common variables
261.if !defined(DEBUG_FLAGS)
262STRIP?=		-s
263.endif
264
265TAR_CMD?=	tar
266
267COMPRESS_CMD?=	gzip -cn
268COMPRESS_EXT?=	.gz
269
270# Set XZ_THREADS to 1 to disable multi-threading.
271XZ_THREADS?=	0
272
273.if !empty(XZ_THREADS)
274XZ_CMD?=	xz -T ${XZ_THREADS}
275.else
276XZ_CMD?=	xz
277.endif
278
279PKG_CMD?=	pkg
280
281# Pointer to the top directory into which tests are installed.  Should not be
282# overridden by Makefiles, but the user may choose to set this in src.conf(5).
283TESTSBASE?= /usr/tests
284
285DEPENDFILE?=	.depend
286
287# Compat for the moment -- old bsd.own.mk only included this when _WITHOUT_SRCCONF
288# wasn't defined. bsd.ports.mk and friends depend on this behavior. Remove in 12.
289.if !defined(_WITHOUT_SRCCONF)
290.include <bsd.compiler.mk>
291.endif # !_WITHOUT_SRCCONF
292
293.endif	# !target(__<bsd.own.mk>__)
294