]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - tools/build/Makefile
devfs_allocv(): style
[FreeBSD/FreeBSD.git] / tools / build / Makefile
1
2 .PATH: ${.CURDIR}/../../include
3
4 LIB=            egacy
5 SRC=
6 INCSGROUPS=     INCS SYSINCS CASPERINC UFSINCS FFSINCS MSDOSFSINCS DISKINCS
7 INCSGROUPS+=    MACHINESYSINCS RPCINCS
8 INCS=
9
10 SYSINCSDIR=     ${INCLUDEDIR}/sys
11 CASPERINCDIR=   ${INCLUDEDIR}/casper
12 # Also add ufs/ffs/msdosfs/disk headers to allow building makefs as a bootstrap tool
13 UFSINCSDIR=     ${INCLUDEDIR}/ufs/ufs
14 FFSINCSDIR=     ${INCLUDEDIR}/ufs/ffs
15 MSDOSFSINCSDIR= ${INCLUDEDIR}/fs/msdosfs
16 DISKINCSDIR=    ${INCLUDEDIR}/sys/disk
17 MACHINESYSINCSDIR=      ${INCLUDEDIR}/machine
18 RPCINCSDIR=     ${INCLUDEDIR}/rpc
19
20 BOOTSTRAPPING?= 0
21
22
23 .if ${.MAKE.OS} == "Darwin"
24 _XCODE_ROOT!=xcode-select -p
25 # since macOS 10.14 C headers are no longer installed in /usr but only
26 # provided via the SDK
27 .if ${_XCODE_ROOT} == "/Library/Developer/CommandLineTools"
28 # Only command line tools installed -> host headers are in the SDKs directory
29 _MACOS_SDK_DIR=${_XCODE_ROOT}/SDKs/MacOSX.sdk/
30 .else
31 # Full XCode installed -> host headers are below Platforms/MacOSX.platform
32 _MACOS_SDK_DIR=${_XCODE_ROOT}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
33 .endif
34 HOST_INCLUDE_ROOT=${_MACOS_SDK_DIR}/usr/include
35 .if !exists(${HOST_INCLUDE_ROOT}/stdio.h)
36 .error You must install the macOS SDK (try xcode-select --install)
37 .endif
38 .else
39 HOST_INCLUDE_ROOT=/usr/include
40 .endif
41
42 # Allow building libc-internal files (also on non-FreeBSD hosts)
43 CFLAGS+=        -I${.CURDIR}/libc-bootstrap
44 # Symbol versioning is not required for -legacy (and macOS bootstrap)
45 MK_SYMVER=      no
46
47 _WITH_PWCACHEDB!= grep -c pwcache_groupdb ${HOST_INCLUDE_ROOT}/grp.h || true
48 .if ${_WITH_PWCACHEDB} == 0
49 .PATH: ${.CURDIR}/../../contrib/libc-pwcache
50 CFLAGS.pwcache.c+=      -I${.CURDIR}/../../contrib/libc-pwcache
51 SRCS+=          pwcache.c
52 .endif
53
54 _WITH_STRSVIS!= grep -c strsvis ${HOST_INCLUDE_ROOT}/vis.h 2>/dev/null || true
55 .if ${_WITH_STRSVIS} == 0
56 .PATH: ${.CURDIR}/../../contrib/libc-vis
57 INCS+=          vis.h
58 SRCS+=          vis.c unvis.c
59 CFLAGS.vis.c+=  -I${.CURDIR}/../../contrib/libc-vis -DHAVE_VIS=0 -DHAVE_SVIS=0
60 CFLAGS.unvis.c+=        -I${.CURDIR}/../../contrib/libc-vis -DHAVE_VIS=0 -DHAVE_SVIS=0
61 .endif
62
63 _WITH_REALLOCARRAY!= grep -c reallocarray ${HOST_INCLUDE_ROOT}/stdlib.h || true
64 .if ${_WITH_REALLOCARRAY} == 0
65 .PATH: ${.CURDIR}/../../lib/libc/stdlib
66 INCS+=          stdlib.h
67 SRCS+=          reallocarray.c
68 .endif
69
70 .if exists(${HOST_INCLUDE_ROOT}/sys/stat.h)
71 _WITH_UTIMENS!= grep -c utimensat ${HOST_INCLUDE_ROOT}/sys/stat.h || true
72 .else
73 _WITH_UTIMENS= 0
74 .endif
75 .if ${_WITH_UTIMENS} == 0
76 SYSINCS+=       stat.h
77 SRCS+=          futimens.c utimensat.c
78 .endif
79
80 _WITH_EXPLICIT_BZERO!= cat ${HOST_INCLUDE_ROOT}/strings.h ${HOST_INCLUDE_ROOT}/string.h | grep -c explicit_bzero || true
81 .if ${_WITH_EXPLICIT_BZERO} == 0
82 # .PATH: ${SRCTOP}/sys/libkern
83 # Adding sys/libkern to .PATH breaks building the cross-build compat library
84 # since that attempts to build strlcpy.c from libc and adding libkern here will
85 # cause it to pick the file from libkern instead (which won't compile).
86 # Avoid modifying .PATH by creating a copy in the build directory instead.
87 explicit_bzero.c: ${SRCTOP}/sys/libkern/explicit_bzero.c
88         cp ${.ALLSRC} ${.TARGET}
89 CLEANFILES+=    explicit_bzero.c
90 INCS+=          strings.h
91 SRCS+=          explicit_bzero.c
92 .endif
93
94 _WITH_FSPACECTL!= grep -c fspacectl ${HOST_INCLUDE_ROOT}/fcntl.h || true
95 .if ${_WITH_FSPACECTL} == 0
96 INCS+=          fcntl.h
97 SRCS+=          fspacectl.c
98 .endif
99
100 .if exists(${HOST_INCLUDE_ROOT}/capsicum_helpers.h)
101 _WITH_CAPH_ENTER!= grep -c caph_enter ${HOST_INCLUDE_ROOT}/capsicum_helpers.h || true
102 _WITH_CAPH_RIGHTS_LIMIT!= grep -c caph_rights_limit ${HOST_INCLUDE_ROOT}/capsicum_helpers.h || true
103 .endif
104 .if !defined(_WITH_CAPH_ENTER) || ${_WITH_CAPH_ENTER} == 0 || ${_WITH_CAPH_RIGHTS_LIMIT} == 0
105 .PATH: ${SRCTOP}/lib/libcapsicum
106 INCS+=          capsicum_helpers.h
107 .PATH: ${SRCTOP}/lib/libcasper/libcasper
108 INCS+=          libcasper.h
109 .endif
110
111 # rpcgen should build against the source tree rpc/types.h and not the host.
112 # This is especially important on non-FreeBSD systems where the types may
113 # not match.
114 RPCINCS+=       ${SRCTOP}/sys/rpc/types.h
115
116 INCS+=  ${SRCTOP}/include/mpool.h
117 INCS+=  ${SRCTOP}/include/ndbm.h
118 INCS+=  ${SRCTOP}/include/err.h
119 INCS+=  ${SRCTOP}/include/stringlist.h
120
121 # Needed to build arc4random.c
122 INCSGROUPS+=    CHACHA20INCS
123 CHACHA20INCSDIR=        ${INCLUDEDIR}/crypto/chacha20
124 CHACHA20INCS+=  ${SRCTOP}/sys/crypto/chacha20/_chacha.h \
125         ${SRCTOP}/sys/crypto/chacha20/chacha.h
126
127 .if ${MACHINE} == "host"
128 _host_arch= ${_HOST_ARCH}
129 .elif ${MACHINE} == "host32"
130 _host_arch= ${_HOST_ARCH32}
131 .else
132 _host_arch=${MACHINE}
133 .endif
134 .if ${_host_arch} == "x86_64"
135 # bmake on Linux/mac often prints that instead of amd64
136 _host_arch=amd64
137 .elif ${_host_arch} == "aarch64"
138 # Linux calls arm64, aarch64, across the board
139 _host_arch=arm64
140 .elif ${_host_arch:Mppc*}
141 _host_arch=powerpc
142 .endif
143 .if ${_host_arch} == "unknown"
144 # HACK: If MACHINE is unknown, assume we are building on x86
145 _host_arch=amd64
146 .endif
147 MACHINESYSINCS+=        ${SRCTOP}/sys/${_host_arch}/include/elf.h
148 .if ${_host_arch} == "amd64" || ${_host_arch} == "i386"
149 INCSGROUPS+=    X86INCS
150 X86INCSDIR=     ${INCLUDEDIR}/x86
151 X86INCS+=       ${SRCTOP}/sys/x86/include/elf.h
152 .endif
153
154 # needed for btxld:
155 MACHINESYSINCS+=        ${SRCTOP}/sys/${_host_arch}/include/exec.h
156 MACHINESYSINCS+=        ${SRCTOP}/sys/${_host_arch}/include/reloc.h
157 INCS+=  ${SRCTOP}/include/a.out.h
158 INCS+=  ${SRCTOP}/include/nlist.h
159 SYSINCS+=       ${SRCTOP}/sys/sys/imgact_aout.h
160 SYSINCS+=       ${SRCTOP}/sys/sys/nlist_aout.h
161
162 # macOS's bitstring lacks FreeBSD-specific additions used by makefs's ZFS code
163 # and Linux doesn't have it at all.  Older FreeBSD versions lack recent
164 # additions.
165 INCS+=  ${SRCTOP}/include/bitstring.h
166 SYSINCS+=       ${SRCTOP}/sys/sys/bitstring.h
167
168 .if ${.MAKE.OS} != "FreeBSD"
169 .PATH: ${.CURDIR}/cross-build
170
171 # Needed by our sys/types.h wrapper
172 SYSINCS+=       ${SRCTOP}/sys/sys/bitcount.h
173
174 # dbopen() behaves differently on Linux and FreeBSD so we ensure that we
175 # bootstrap the FreeBSD db code. The cross-build headers #define dbopen() to
176 # __freebsd_dbopen() so that we don't ever use the host version
177 INCS+=  ${SRCTOP}/include/db.h
178 LIBC_SRCTOP=    ${SRCTOP}/lib/libc/
179 .include "${LIBC_SRCTOP}/db/Makefile.inc"
180 # Do the same as we did for dbopen() for getopt() on since it's not compatible
181 # on Linux (and to avoid surprises also compile the FreeBSD code on macOS)
182 .PATH: ${LIBC_SRCTOP}/stdlib
183 SRCS+=  getopt.c getopt_long.c
184 INCS+=   ${SRCTOP}/include/getopt.h
185
186 # getcap.c is needed for cap_mkdb:
187 .PATH: ${LIBC_SRCTOP}/gen
188 SRCS+=  getcap.c
189 # Glibc does not provide all err*/warn* functions, and for macOS we need the
190 # alias with the extra underscore.
191 SRCS+=  err.c
192 # Add various libbc functions that are not available in glibc:
193 SRCS+=  stringlist.c setmode.c
194 SRCS+=  strtonum.c merge.c heapsort.c reallocf.c
195 .PATH: ${LIBC_SRCTOP}/locale
196 SRCS+=  rpmatch.c
197
198 .if ${.MAKE.OS} == "Linux"
199 # On Linux, glibc does not provide strmode. It only provides strlcpy
200 # and strlcat from glibc 2.38.
201 .PATH: ${LIBC_SRCTOP}/string
202 SRCS+=  strmode.c
203 # Assume if strlcpy exists so does strlcat
204 _WITH_EXPLICIT_STRLCPY!= cat ${HOST_INCLUDE_ROOT}/strings.h ${HOST_INCLUDE_ROOT}/string.h | grep -c strlcpy || true
205 .if ${_WITH_EXPLICIT_STRLCPY} == 0
206 SRCS+=  strlcpy.c strlcat.c
207 .endif
208 # On Linux, glibc provides ffs* but not fls*
209 SRCS+=  fls.c flsl.c flsll.c
210 # Compile the fgetln/fgetwln/closefrom fallback code from libbsd:
211 SRCS+=  fgetln_fallback.c fgetwln_fallback.c closefrom.c
212 CFLAGS.closefrom.c+=    -DSTDC_HEADERS -DHAVE_SYS_DIR_H -DHAVE_DIRENT_H \
213         -DHAVE_DIRFD -DHAVE_SYSCONF
214 # Provide getprogname/setprograme
215 SRCS+=  progname.c
216 # Stub implementations of fflagstostr/strtofflags
217 SRCS+=  fflags.c
218
219 # macOS has a standalone cross-build implementation, but Linux can use the same
220 # ELF one as FreeBSD
221 SYSINCS+=       ${SRCTOP}/sys/sys/linker_set.h
222
223 .endif # ${MAKE.OS} == "Linux"
224
225 .if ${.MAKE.OS} == "Darwin"
226 # Standalone implementation of secure_getenv(), not available on MacOS.
227 SRCS+=  secure_getenv.c
228 .endif # ${MAKE.OS} == "Darwin"
229
230 # Provide the same arc4random implementation on Linux/macOS
231 CFLAGS.arc4random.c+=   -I${SRCTOP}/sys/crypto/chacha20 -D__isthreaded=1
232 SRCS+=  arc4random.c arc4random_uniform.c
233
234 # expand_number() is not provided by either Linux or MacOS libutil
235 .PATH: ${SRCTOP}/lib/libutil
236 SRCS+=  expand_number.c
237 # Linux libutil also doesn't have fparseln
238 SRCS+=  fparseln.c
239 # A dummy sysctl for tzsetup:
240 SRCS+=  fake_sysctl.c
241
242 # capsicum support
243 SYSINCS+=       ${SRCTOP}/sys/sys/capsicum.h
244 SYSINCS+=       ${SRCTOP}/sys/sys/caprights.h
245 SRCS+=  capsicum_stubs.c
246 # XXX: we can't add ${SRCTOP}/sys/kern to .PATH since that will causes
247 # conflicts with other files. Instead copy subr_capability to the build dir.
248 subr_capability.c: ${SRCTOP}/sys/kern/subr_capability.c
249         cp ${.ALLSRC} ${.TARGET}
250 SRCS+=  subr_capability.c
251 CLEANFILES+=    subr_capability.c
252 .endif # ${MAKE.OS} != "FreeBSD"
253
254 CASPERINC+=     ${SRCTOP}/lib/libcasper/services/cap_fileargs/cap_fileargs.h
255 CASPERINC+=     ${SRCTOP}/lib/libcasper/services/cap_net/cap_net.h
256
257 .if empty(SRCS)
258 SRCS=           dummy.c
259 .endif
260
261 .if defined(CROSS_BUILD_TESTING)
262 SUBDIR=         cross-build
263 .endif
264
265 # To allow bootstrapping makefs on FreeBSD 11 or non-FreeBSD systems:
266 UFSINCS+=       ${SRCTOP}/sys/ufs/ufs/dinode.h
267 UFSINCS+=       ${SRCTOP}/sys/ufs/ufs/dir.h
268 FFSINCS+=       ${SRCTOP}/sys/ufs/ffs/fs.h
269
270 MSDOSFSINCS+=   ${SRCTOP}/sys/fs/msdosfs/bootsect.h
271 MSDOSFSINCS+=   ${SRCTOP}/sys/fs/msdosfs/bpb.h
272 MSDOSFSINCS+=   ${SRCTOP}/sys/fs/msdosfs/denode.h
273 MSDOSFSINCS+=   ${SRCTOP}/sys/fs/msdosfs/direntry.h
274 MSDOSFSINCS+=   ${SRCTOP}/sys/fs/msdosfs/fat.h
275 MSDOSFSINCS+=   ${SRCTOP}/sys/fs/msdosfs/msdosfsmount.h
276 DISKINCS+=      ${SRCTOP}/sys/sys/disk/bsd.h
277
278 # Needed to build config (since it uses libnv)
279 SYSINCS+=       ${SRCTOP}/sys/sys/nv.h ${SRCTOP}/sys/sys/cnv.h \
280                 ${SRCTOP}/sys/sys/dnv.h ${SRCTOP}/sys/sys/nv_namespace.h
281
282 # Needed when bootstrapping ldd (since it uses DF_1_PIE)
283 SYSINCS+=       ${SRCTOP}/sys/sys/elf32.h
284 SYSINCS+=       ${SRCTOP}/sys/sys/elf64.h
285 SYSINCS+=       ${SRCTOP}/sys/sys/elf_common.h
286 SYSINCS+=       ${SRCTOP}/sys/sys/elf_generic.h
287 SYSINCS+=       ${SRCTOP}/sys/sys/queue.h
288 SYSINCS+=       ${SRCTOP}/sys/sys/md5.h
289 SYSINCS+=       ${SRCTOP}/sys/sys/sbuf.h
290 SYSINCS+=       ${SRCTOP}/sys/sys/tree.h
291
292 # vtfontcvt is using sys/font.h
293 SYSINCS+=       ${SRCTOP}/sys/sys/font.h
294 # For mkscrfil.c:
295 SYSINCS+=       ${SRCTOP}/sys/sys/consio.h
296 # for gencat:
297 INCS+=  ${SRCTOP}/include/nl_types.h
298 # for vtfontcvt:
299 SYSINCS+=       ${SRCTOP}/sys/sys/fnv_hash.h
300 # opensolaris compatibility
301 INCS+=  ${SRCTOP}/include/elf.h
302 SYSINCS+=       ${SRCTOP}/sys/sys/elf.h
303 SYSINCS+=       ${SRCTOP}/sys/sys/ctf.h
304 # for kbdcontrol:
305 SYSINCS+=       ${SRCTOP}/sys/sys/kbio.h
306 # for kldxref:
307 SYSINCS+=       ${SRCTOP}/sys/sys/module.h
308
309 # We want to run the build with only ${WORLDTMP} in $PATH to ensure we don't
310 # accidentally run tools that are incompatible but happen to be in $PATH.
311 # This is especially important when building on Linux/MacOS where many of the
312 # programs used during the build accept different flags or generate different
313 # output. On those platforms we only symlink the tools known to be compatible
314 # (e.g. basic utilities such as mkdir) into ${WORLDTMP} and build all others
315 # from the FreeBSD sources during the bootstrap-tools stage.
316
317 # basic commands: It is fine to use the host version for all of these even on
318 # Linux/MacOS since we only use flags that are supported by all of them.
319 _host_tools_to_symlink= basename bzip2 bunzip2 chmod chown cmp comm cp date dd \
320         dirname echo env false find fmt gzip gunzip head hostname id ln ls \
321         mkdir mv nice patch rm sh sleep stat tee time touch tr true uname uniq \
322         unxz wc which xz
323
324 # We also need a symlink to the absolute path to the make binary used for
325 # the toplevel makefile. This is not necessarily the same as `which make`
326 # since e.g. on Linux and MacOS that will be GNU make.
327 _make_abs!=     which "${MAKE}"
328 _host_abs_tools_to_symlink=     ${_make_abs}:make ${_make_abs}:bmake
329
330 _LINK_HOST_TOOL=        ln -sfn
331
332 .if ${.MAKE.OS} == "FreeBSD"
333 # When building on FreeBSD we always copy the host tools instead of linking
334 # into WORLDTMP to avoid issues with incompatible libraries (see r364030).
335 # Note: we could create links if we don't intend to update the current machine.
336 _COPY_HOST_TOOL=        cp -pf
337 .else
338 # However, this is not necessary on Linux/macOS. Additionally, copying the host
339 # tools to another directory with cp -p results in freezes on macOS Big Sur for
340 # some unknown reason. It can also break building inside docker containers if
341 # there are ACLs on shared volumes.
342 _COPY_HOST_TOOL=        ${_LINK_HOST_TOOL}
343
344 .if ${.MAKE.OS} == "Darwin"
345 # /usr/bin/cpp may invoke xcrun:
346 _host_tools_to_symlink+=        xcrun
347 .endif  # ${.MAKE.OS} == "Darwin"
348
349 # On Ubuntu /bin/sh is dash which is totally useless, and the same for modern
350 # macOS. Let's just link bash as the build sh since that will work fine.
351 _host_abs_tools_to_symlink+=    /bin/bash:sh
352 _host_tools_to_symlink:=        ${_host_tools_to_symlink:Nsh}
353 .endif
354
355 # We also need to symlink any non-absolute toolchain commands. Clang finds its
356 # resource directory relative to itself, so CC/CXX/CPP cannot be copied, and
357 # there should be no concerns about installing over the current system since we
358 # don't use the toolchain during install, so that's not an issue. However,
359 # before Clang 13 there was no symlink detection for FreeBSD so that was broken
360 # in the same way as copying (https://reviews.llvm.org/D103346), thus create a
361 # wrapper script for each to work around this and behave like a symlink.
362 # Remove this hack and just use a symlink once Clang 13 can be assumed.
363 # For consistency, we use the same strategy for LD.
364 .include <bsd.compiler.mk>
365 .if ${.MAKE.OS} == "FreeBSD" && ${COMPILER_TYPE} == "clang" && \
366     ${COMPILER_VERSION} < 130000
367 _WRAP_HOST_TOOL=        sh -c "printf '\#!/bin/sh\nexec \"\%s\" \"\$$@\"\n' \"\$$0\" > \"\$$1\" && chmod +x \"\$$1\""
368 .else
369 _WRAP_HOST_TOOL=        ${_LINK_HOST_TOOL}
370 .endif
371 .for var in CC CXX CPP LD
372 .for X in $${_empty_var_} X
373 .if !empty(${X}${var}) && !${${X}${var}:[1]:M/*} && \
374         !${_toolchain_tools_to_symlink:U:M${${X}${var}:[1]}}
375 _toolchain_tools_to_symlink+=   ${${X}${var}:[1]}
376 .endif
377 .endfor
378 .endfor
379
380 host-symlinks:
381         @echo "Linking host tools into ${DESTDIR}/bin"
382 .for _tool in ${_host_tools_to_symlink}
383         @export PATH=$${PATH}:/usr/local/bin; \
384         source_path=`which ${_tool} || echo /dev/null/no/such`; \
385         if [ ! -e "$${source_path}" ] ; then \
386                 echo "Cannot find host tool '${_tool}' in PATH ($$PATH)." >&2; false; \
387         fi; \
388         rm -f "${DESTDIR}/bin/${_tool}"; \
389         ${_COPY_HOST_TOOL} "$${source_path}" "${DESTDIR}/bin/${_tool}"
390 .endfor
391 .for _tool in ${_host_abs_tools_to_symlink}
392         @source_path="${_tool:S/:/ /:[1]}"; \
393         target_path="${DESTDIR}/bin/${_tool:S/:/ /:[2]}"; \
394         if [ ! -e "$${source_path}" ] ; then \
395                 echo "Host tool '$${source_path}' is missing"; false; \
396         fi; \
397         rm -f "$${target_path}"; \
398         ${_COPY_HOST_TOOL} "$${source_path}" "$${target_path}"
399 .endfor
400 .if exists(/usr/libexec/flua)
401         rm -f ${DESTDIR}/usr/libexec/flua
402         ${_COPY_HOST_TOOL} /usr/libexec/flua ${DESTDIR}/usr/libexec/flua
403 .endif
404 .for _tool in ${_toolchain_tools_to_symlink}
405         @export PATH=$${PATH}:/usr/local/bin; \
406         source_path=`which ${_tool} || echo /dev/null/no/such`; \
407         if [ ! -e "$${source_path}" ] ; then \
408                 echo "Cannot find host tool '${_tool}' in PATH ($$PATH)." >&2; false; \
409         fi; \
410         rm -f "${DESTDIR}/bin/${_tool}"; \
411         ${_WRAP_HOST_TOOL} "$${source_path}" "${DESTDIR}/bin/${_tool}"
412 .endfor
413
414 # Create all the directories that are needed during the legacy, bootstrap-tools
415 # and cross-tools stages. We do this here using mkdir since mtree may not exist
416 # yet (this happens if we are crossbuilding from Linux/Mac).
417 INSTALLDIR_LIST= \
418         bin \
419         lib/geom \
420         usr/include/casper \
421         usr/include/private/ucl \
422         usr/include/private/zstd \
423         usr/lib \
424         usr/libdata/pkgconfig \
425         usr/libexec
426
427 installdirs:
428         mkdir -p ${INSTALLDIR_LIST:S,^,${DESTDIR}/,}
429
430 # Link usr/bin, sbin, and usr/sbin to bin so that it doesn't matter whether a
431 # bootstrap tool was added to WORLTMP with a symlink or by building it in the
432 # bootstrap-tools phase. We could also overrride BINDIR when building bootstrap
433 # tools but adding the symlinks is easier and means all tools are also
434 # in the directory that they are installed to normally.
435
436 .for _dir in sbin usr/sbin usr/bin
437 # delete existing directories from before r340157
438         @if [ -e ${DESTDIR}/${_dir} ] && [ ! -L ${DESTDIR}/${_dir} ]; then \
439             echo "removing old non-symlink ${DESTDIR}/${_dir}"; \
440             rm -rf "${DESTDIR}/${_dir}"; \
441         fi
442 .endfor
443         ln -sfn bin ${DESTDIR}/sbin
444         ln -sfn ../bin ${DESTDIR}/usr/bin
445         ln -sfn ../bin ${DESTDIR}/usr/sbin
446 .for _group in ${INCSGROUPS:NINCS}
447         mkdir -p "${DESTDIR}/${${_group}DIR}"
448 .endfor
449
450 .include <bsd.lib.mk>