xref: /freebsd/share/mk/bsd.own.mk (revision 38f0b757fd84d17d0fc24739a7cda160c4516d81)
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# 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>
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 -gn
144.for x in BIN CONF DOC 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}
167
168LIBDIR?=	/usr/lib
169LIBCOMPATDIR?=	/usr/lib/compat
170LIBPRIVATEDIR?=	/usr/lib/private
171LIBDATADIR?=	/usr/libdata
172LIBEXECDIR?=	/usr/libexec
173LINTLIBDIR?=	/usr/libdata/lint
174SHLIBDIR?=	${LIBDIR}
175LIBOWN?=	${BINOWN}
176LIBGRP?=	${BINGRP}
177LIBMODE?=	${NOBINMODE}
178
179DEBUGDIR?=	/usr/lib/debug
180DEBUGMODE?=	${NOBINMODE}
181
182
183# Share files
184SHAREDIR?=	/usr/share
185SHAREOWN?=	root
186SHAREGRP?=	wheel
187SHAREMODE?=	${NOBINMODE}
188
189CONFDIR?=	/etc
190CONFOWN?=	root
191CONFGRP?=	wheel
192CONFMODE?=	644
193
194MANDIR?=	${SHAREDIR}/man/man
195MANOWN?=	${SHAREOWN}
196MANGRP?=	${SHAREGRP}
197MANMODE?=	${NOBINMODE}
198
199DOCDIR?=	${SHAREDIR}/doc
200DOCOWN?=	${SHAREOWN}
201DOCGRP?=	${SHAREGRP}
202DOCMODE?=	${NOBINMODE}
203
204INFODIR?=	${SHAREDIR}/info
205INFOOWN?=	${SHAREOWN}
206INFOGRP?=	${SHAREGRP}
207INFOMODE?=	${NOBINMODE}
208
209NLSDIR?=	${SHAREDIR}/nls
210NLSOWN?=	${SHAREOWN}
211NLSGRP?=	${SHAREGRP}
212NLSMODE?=	${NOBINMODE}
213
214INCLUDEDIR?=	/usr/include
215
216#
217# install(1) parameters.
218#
219HRDLINK?=	-l h
220SYMLINK?=	-l s
221
222INSTALL_LINK?=		${INSTALL} ${HRDLINK}
223INSTALL_SYMLINK?=	${INSTALL} ${SYMLINK}
224
225# Common variables
226.if !defined(DEBUG_FLAGS)
227STRIP?=		-s
228.endif
229
230COMPRESS_CMD?=	gzip -cn
231COMPRESS_EXT?=	.gz
232
233# Pointer to the top directory into which tests are installed.  Should not be
234# overriden by Makefiles, but the user may choose to set this in src.conf(5).
235TESTSBASE?= /usr/tests
236
237.endif	# !target(__<bsd.own.mk>__)
238