xref: /freebsd/share/mk/bsd.own.mk (revision c36e54bb328697af1e6113812caecbd3bac89fe0)
1# $FreeBSD$
2#
3# The include file <src.opts.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# LIBPRIVATEDIR	Base path for private libraries. [/usr/lib/private]
32#
33# LIBDATADIR	Base path for misc. utility data files. [/usr/libdata]
34#
35# LIBEXECDIR	Base path for system daemons and utilities. [/usr/libexec]
36#
37# LINTLIBDIR	Base path for lint libraries. [/usr/libdata/lint]
38#
39# SHLIBDIR	Base path for shared libraries. [${LIBDIR}]
40#
41# LIBOWN	Library owner. [${BINOWN}]
42#
43# LIBGRP	Library group. [${BINGRP}]
44#
45# LIBMODE	Library mode. [${NOBINMODE}]
46#
47#
48# DEBUGDIR	Base path for standalone debug files. [/usr/lib/debug]
49#
50# DEBUGMODE	Mode for debug files. [${NOBINMODE}]
51#
52#
53# KMODDIR	Base path for loadable kernel modules
54#		(see kld(4)). [/boot/kernel]
55#
56# KMODOWN	Kernel and KLD owner. [${BINOWN}]
57#
58# KMODGRP	Kernel and KLD group. [${BINGRP}]
59#
60# KMODMODE	KLD mode. [${BINMODE}]
61#
62#
63# SHAREDIR	Base path for architecture-independent ascii
64#		text files. [/usr/share]
65#
66# SHAREOWN	ASCII text file owner. [root]
67#
68# SHAREGRP	ASCII text file group. [wheel]
69#
70# SHAREMODE	ASCII text file mode. [${NOBINMODE}]
71#
72#
73# CONFDIR	Base path for configuration files. [/etc]
74#
75# CONFOWN	Configuration file owner. [root]
76#
77# CONFGRP	Configuration file group. [wheel]
78#
79# CONFMODE	Configuration file mode. [644]
80#
81#
82# DOCDIR	Base path for system documentation (e.g. PSD, USD,
83#		handbook, FAQ etc.). [${SHAREDIR}/doc]
84#
85# DOCOWN	Documentation owner. [${SHAREOWN}]
86#
87# DOCGRP	Documentation group. [${SHAREGRP}]
88#
89# DOCMODE	Documentation mode. [${NOBINMODE}]
90#
91#
92# INFODIR	Base path for GNU's hypertext system
93#		called Info (see info(1)). [${SHAREDIR}/info]
94#
95# INFOOWN	Info owner. [${SHAREOWN}]
96#
97# INFOGRP	Info group. [${SHAREGRP}]
98#
99# INFOMODE	Info mode. [${NOBINMODE}]
100#
101#
102# MANDIR	Base path for manual installation. [${SHAREDIR}/man/man]
103#
104# MANOWN	Manual owner. [${SHAREOWN}]
105#
106# MANGRP	Manual group. [${SHAREGRP}]
107#
108# MANMODE	Manual mode. [${NOBINMODE}]
109#
110#
111# NLSDIR	Base path for National Language Support files
112#		installation. [${SHAREDIR}/nls]
113#
114# NLSOWN	National Language Support files owner. [${SHAREOWN}]
115#
116# NLSGRP	National Language Support files group. [${SHAREGRP}]
117#
118# NLSMODE	National Language Support files mode. [${NOBINMODE}]
119#
120# INCLUDEDIR	Base path for standard C include files [/usr/include]
121
122.if !target(__<bsd.own.mk>__)
123__<bsd.own.mk>__:
124
125.include <bsd.opts.mk>		# options now here or src.opts.mk
126
127.if !defined(_WITHOUT_SRCCONF)
128
129.if ${MK_CTF} != "no"
130CTFCONVERT_CMD=	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
131.elif defined(.PARSEDIR) || (defined(MAKE_VERSION) && ${MAKE_VERSION} >= 5201111300)
132CTFCONVERT_CMD=
133.else
134CTFCONVERT_CMD=	@:
135.endif
136
137.if ${MK_INSTALL_AS_USER} != "no"
138_uid!=	id -u
139.if ${_uid} != 0
140.if !defined(USER)
141USER!=	id -un
142.endif
143_gid!=	id -g
144.for x in BIN CONF DOC DTB INFO KMOD LIB MAN NLS SHARE
145$xOWN=	${USER}
146$xGRP=	${_gid}
147.endfor
148.endif
149.endif
150
151.endif # !_WITHOUT_SRCCONF
152
153# Binaries
154BINOWN?=	root
155BINGRP?=	wheel
156BINMODE?=	555
157NOBINMODE?=	444
158
159.if defined(MODULES_WITH_WORLD)
160KMODDIR?=	/boot/modules
161.else
162KMODDIR?=	/boot/kernel
163.endif
164KMODOWN?=	${BINOWN}
165KMODGRP?=	${BINGRP}
166KMODMODE?=	${BINMODE}
167DTBDIR?=	/boot/dtb
168DTBOWN?=	root
169DTBGRP?=	wheel
170DTBMODE?=	444
171
172LIBDIR?=	/usr/lib
173LIBCOMPATDIR?=	/usr/lib/compat
174LIBPRIVATEDIR?=	/usr/lib/private
175LIBDATADIR?=	/usr/libdata
176LIBEXECDIR?=	/usr/libexec
177LINTLIBDIR?=	/usr/libdata/lint
178SHLIBDIR?=	${LIBDIR}
179LIBOWN?=	${BINOWN}
180LIBGRP?=	${BINGRP}
181LIBMODE?=	${NOBINMODE}
182
183DEBUGDIR?=	/usr/lib/debug
184DEBUGMODE?=	${NOBINMODE}
185
186
187# Share files
188SHAREDIR?=	/usr/share
189SHAREOWN?=	root
190SHAREGRP?=	wheel
191SHAREMODE?=	${NOBINMODE}
192
193CONFDIR?=	/etc
194CONFOWN?=	root
195CONFGRP?=	wheel
196CONFMODE?=	644
197
198MANDIR?=	${SHAREDIR}/man/man
199MANOWN?=	${SHAREOWN}
200MANGRP?=	${SHAREGRP}
201MANMODE?=	${NOBINMODE}
202
203DOCDIR?=	${SHAREDIR}/doc
204DOCOWN?=	${SHAREOWN}
205DOCGRP?=	${SHAREGRP}
206DOCMODE?=	${NOBINMODE}
207
208INFODIR?=	${SHAREDIR}/info
209INFOOWN?=	${SHAREOWN}
210INFOGRP?=	${SHAREGRP}
211INFOMODE?=	${NOBINMODE}
212
213NLSDIR?=	${SHAREDIR}/nls
214NLSOWN?=	${SHAREOWN}
215NLSGRP?=	${SHAREGRP}
216NLSMODE?=	${NOBINMODE}
217
218INCLUDEDIR?=	/usr/include
219
220#
221# install(1) parameters.
222#
223HRDLINK?=	-l h
224SYMLINK?=	-l s
225RSYMLINK?=	-l rs
226
227INSTALL_LINK?=		${INSTALL} ${HRDLINK}
228INSTALL_SYMLINK?=	${INSTALL} ${SYMLINK}
229INSTALL_RSYMLINK?=	${INSTALL} ${RSYMLINK}
230
231# Common variables
232.if !defined(DEBUG_FLAGS)
233STRIP?=		-s
234.endif
235
236COMPRESS_CMD?=	gzip -cn
237COMPRESS_EXT?=	.gz
238
239# Set XZ_THREADS to 1 to disable multi-threading.
240XZ_THREADS?=	0
241
242.if !empty(XZ_THREADS)
243XZ_CMD?=	xz -T ${XZ_THREADS}
244.else
245XZ_CMD?=	xz
246.endif
247
248# Pointer to the top directory into which tests are installed.  Should not be
249# overriden by Makefiles, but the user may choose to set this in src.conf(5).
250TESTSBASE?= /usr/tests
251
252# Compat for the moment
253.include <bsd.compiler.mk>
254
255.endif	# !target(__<bsd.own.mk>__)
256