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