xref: /freebsd/share/mk/bsd.own.mk (revision 9268022b74279434ed6300244e3f977e56a8ceb5)
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_gn!=	id -gn
145.for x in BIN CONF DOC INFO KMOD LIB MAN NLS SHARE
146$xOWN=	${USER}
147$xGRP=	${_gn}
148.endfor
149.endif
150.endif
151
152.endif # !_WITHOUT_SRCCONF
153
154# Binaries
155BINOWN?=	root
156BINGRP?=	wheel
157BINMODE?=	555
158NOBINMODE?=	444
159
160.if defined(MODULES_WITH_WORLD)
161KMODDIR?=	/boot/modules
162.else
163KMODDIR?=	/boot/kernel
164.endif
165KMODOWN?=	${BINOWN}
166KMODGRP?=	${BINGRP}
167KMODMODE?=	${BINMODE}
168
169LIBDIR?=	/usr/lib
170LIBCOMPATDIR?=	/usr/lib/compat
171LIBPRIVATEDIR?=	/usr/lib/private
172LIBDATADIR?=	/usr/libdata
173LIBEXECDIR?=	/usr/libexec
174LINTLIBDIR?=	/usr/libdata/lint
175SHLIBDIR?=	${LIBDIR}
176LIBOWN?=	${BINOWN}
177LIBGRP?=	${BINGRP}
178LIBMODE?=	${NOBINMODE}
179
180DEBUGDIR?=	/usr/lib/debug
181DEBUGMODE?=	${NOBINMODE}
182
183
184# Share files
185SHAREDIR?=	/usr/share
186SHAREOWN?=	root
187SHAREGRP?=	wheel
188SHAREMODE?=	${NOBINMODE}
189
190CONFDIR?=	/etc
191CONFOWN?=	root
192CONFGRP?=	wheel
193CONFMODE?=	644
194
195MANDIR?=	${SHAREDIR}/man/man
196MANOWN?=	${SHAREOWN}
197MANGRP?=	${SHAREGRP}
198MANMODE?=	${NOBINMODE}
199
200DOCDIR?=	${SHAREDIR}/doc
201DOCOWN?=	${SHAREOWN}
202DOCGRP?=	${SHAREGRP}
203DOCMODE?=	${NOBINMODE}
204
205INFODIR?=	${SHAREDIR}/info
206INFOOWN?=	${SHAREOWN}
207INFOGRP?=	${SHAREGRP}
208INFOMODE?=	${NOBINMODE}
209
210NLSDIR?=	${SHAREDIR}/nls
211NLSOWN?=	${SHAREOWN}
212NLSGRP?=	${SHAREGRP}
213NLSMODE?=	${NOBINMODE}
214
215INCLUDEDIR?=	/usr/include
216
217#
218# install(1) parameters.
219#
220HRDLINK?=	-l h
221SYMLINK?=	-l s
222
223INSTALL_LINK?=		${INSTALL} ${HRDLINK}
224INSTALL_SYMLINK?=	${INSTALL} ${SYMLINK}
225
226# Common variables
227.if !defined(DEBUG_FLAGS)
228STRIP?=		-s
229.endif
230
231COMPRESS_CMD?=	gzip -cn
232COMPRESS_EXT?=	.gz
233
234# Pointer to the top directory into which tests are installed.  Should not be
235# overriden by Makefiles, but the user may choose to set this in src.conf(5).
236TESTSBASE?= /usr/tests
237
238# Compat for the moment
239.include <bsd.compiler.mk>
240
241.endif	# !target(__<bsd.own.mk>__)
242