]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/mk/bsd.own.mk
MFC r304696:
[FreeBSD/FreeBSD.git] / share / mk / bsd.own.mk
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 .if !target(__<bsd.own.mk>__)
121 __<bsd.own.mk>__:
122
123 .include <bsd.opts.mk>          # options now here or src.opts.mk
124
125 .if !defined(_WITHOUT_SRCCONF)
126
127 .if ${MK_CTF} != "no"
128 CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
129 .elif defined(.PARSEDIR) || (defined(MAKE_VERSION) && ${MAKE_VERSION} >= 5201111300)
130 CTFCONVERT_CMD=
131 .else
132 CTFCONVERT_CMD= @:
133 .endif 
134
135 .if ${MK_INSTALL_AS_USER} != "no"
136 .if !defined(_uid)
137 _uid!=  id -u
138 .export _uid
139 .endif
140 .if ${_uid} != 0
141 .if !defined(USER)
142 # Avoid exporting USER
143 .if !defined(_USER)
144 _USER!= id -un
145 .export _USER
146 .endif
147 USER=   ${_USER}
148 .endif
149 .if !defined(_gid)
150 _gid!=  id -g
151 .export _gid
152 .endif
153 .for x in BIN CONF DOC DTB INFO KMOD LIB MAN NLS SHARE
154 $xOWN=  ${USER}
155 $xGRP=  ${_gid}
156 .endfor
157 .endif
158 .endif
159
160 .endif # !_WITHOUT_SRCCONF
161
162 # Binaries
163 BINOWN?=        root
164 BINGRP?=        wheel
165 BINMODE?=       555
166 NOBINMODE?=     444
167
168 KMODDIR?=       /boot/modules
169 KMODOWN?=       ${BINOWN}
170 KMODGRP?=       ${BINGRP}
171 KMODMODE?=      ${BINMODE}
172 DTBDIR?=        /boot/dtb
173 DTBOWN?=        root
174 DTBGRP?=        wheel
175 DTBMODE?=       444
176
177 LIBDIR?=        /usr/lib
178 LIBCOMPATDIR?=  /usr/lib/compat
179 LIBDATADIR?=    /usr/libdata
180 LIBEXECDIR?=    /usr/libexec
181 LINTLIBDIR?=    /usr/libdata/lint
182 SHLIBDIR?=      ${LIBDIR}
183 LIBOWN?=        ${BINOWN}
184 LIBGRP?=        ${BINGRP}
185 LIBMODE?=       ${NOBINMODE}
186
187 DEBUGDIR?=      /usr/lib/debug
188 DEBUGMODE?=     ${NOBINMODE}
189
190
191 # Share files
192 SHAREDIR?=      /usr/share
193 SHAREOWN?=      root
194 SHAREGRP?=      wheel
195 SHAREMODE?=     ${NOBINMODE}
196
197 CONFDIR?=       /etc
198 CONFOWN?=       root
199 CONFGRP?=       wheel
200 CONFMODE?=      644
201
202 MANDIR?=        ${SHAREDIR}/man/man
203 MANOWN?=        ${SHAREOWN}
204 MANGRP?=        ${SHAREGRP}
205 MANMODE?=       ${NOBINMODE}
206
207 DOCDIR?=        ${SHAREDIR}/doc
208 DOCOWN?=        ${SHAREOWN}
209 DOCGRP?=        ${SHAREGRP}
210 DOCMODE?=       ${NOBINMODE}
211
212 INFODIR?=       ${SHAREDIR}/info
213 INFOOWN?=       ${SHAREOWN}
214 INFOGRP?=       ${SHAREGRP}
215 INFOMODE?=      ${NOBINMODE}
216
217 NLSDIR?=        ${SHAREDIR}/nls
218 NLSOWN?=        ${SHAREOWN}
219 NLSGRP?=        ${SHAREGRP}
220 NLSMODE?=       ${NOBINMODE}
221
222 INCLUDEDIR?=    /usr/include
223
224 #
225 # install(1) parameters.
226 #
227 HRDLINK?=       -l h
228 SYMLINK?=       -l s
229 RSYMLINK?=      -l rs
230
231 INSTALL_LINK?=          ${INSTALL} ${HRDLINK}
232 INSTALL_SYMLINK?=       ${INSTALL} ${SYMLINK}
233 INSTALL_RSYMLINK?=      ${INSTALL} ${RSYMLINK}
234
235 # Common variables
236 .if !defined(DEBUG_FLAGS)
237 STRIP?=         -s
238 .endif
239
240 COMPRESS_CMD?=  gzip -cn
241 COMPRESS_EXT?=  .gz
242
243 # Set XZ_THREADS to 1 to disable multi-threading.
244 XZ_THREADS?=    0
245
246 .if !empty(XZ_THREADS)
247 XZ_CMD?=        xz -T ${XZ_THREADS}
248 .else
249 XZ_CMD?=        xz
250 .endif
251
252 # Pointer to the top directory into which tests are installed.  Should not be
253 # overriden by Makefiles, but the user may choose to set this in src.conf(5).
254 TESTSBASE?= /usr/tests
255
256 DEPENDFILE?=    .depend
257
258 # Compat for the moment -- old bsd.own.mk only included this when _WITHOUT_SRCCONF
259 # wasn't defined. bsd.ports.mk and friends depend on this behavior. Remove in 12.
260 .if !defined(_WITHOUT_SRCCONF)
261 .include <bsd.compiler.mk>
262 .endif # !_WITHOUT_SRCCONF
263
264 .endif  # !target(__<bsd.own.mk>__)