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