4 # Make command line options:
5 # -DNO_CLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
6 # -DNO_CLEAN do not clean at all
7 # -DNO_SHARE do not go into share subdir
8 # -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel
9 # -DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel
10 # -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel
11 # -DNO_PORTSUPDATE do not update ports in ${MAKE} update
12 # -DNO_DOCUPDATE do not update doc in ${MAKE} update
13 # -DNO_CTF do not run the DTrace CTF conversion tools on built objects
14 # LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
15 # TARGET="machine" to crossbuild world for a different machine type
18 # The intended user-driven targets are:
19 # buildworld - rebuild *everything*, including glue to help do upgrades
20 # installworld- install everything built by "buildworld"
21 # doxygen - build API documentation of the kernel
22 # update - convenient way to update your source tree (eg: cvsup/cvs)
24 # Standard targets (not defined here) are documented in the makefiles in
25 # /usr/share/mk. These include:
26 # obj depend all install clean cleandepend cleanobj
30 .if ${MACHINE_ARCH} == "mips"
31 MK_RESCUE=no # not yet
34 # We must do share/info early so that installation of info `dir'
35 # entries works correctly. Do it first since it is less likely to
36 # grow dependencies on include and lib than vice versa.
38 # We must do lib/ and libexec/ before bin/, because if installworld
39 # installs a new /bin/sh, the 'make' command will *immediately*
40 # use that new version. And the new (dynamically-linked) /bin/sh
41 # will expect to find appropriate libraries in /lib and /libexec.
43 SUBDIR= share/info lib libexec
45 .if ${MK_GAMES} != "no"
48 .if ${MK_CDDL} != "no"
54 .if ${MK_KERBEROS} != "no"
57 .if ${MK_RESCUE} != "no"
61 .if ${MK_CRYPT} != "no"
64 .if !defined(NO_SHARE)
67 SUBDIR+=sys usr.bin usr.sbin
69 # We must do etc/ last for install/distribute to work.
73 # These are last, since it is nice to at least get the base system
74 # rebuilt before you do them.
75 .for _DIR in ${LOCAL_DIRS}
76 .if exists(${.CURDIR}/${_DIR}/Makefile)
81 .if defined(SUBDIR_OVERRIDE)
82 SUBDIR= ${SUBDIR_OVERRIDE}
88 .if defined(NO_CLEANDIR)
89 CLEANDIR= clean cleandepend
95 CVSFLAGS?= -A -P -d -I!
99 SUPFLAGS+= -h ${SUPHOST}
102 MAKEOBJDIRPREFIX?= /usr/obj
103 .if !defined(OSRELDATE)
104 .if exists(/usr/include/osreldate.h)
105 OSRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \
106 /usr/include/osreldate.h
112 .if !defined(VERSION)
114 VERSION+= ${OSRELDATE}
117 # Guess machine architecture from machine type, and vice versa.
118 .if !defined(TARGET_ARCH) && defined(TARGET)
119 TARGET_ARCH= ${TARGET:S/pc98/i386/:S/sun4v/sparc64/}
120 .elif !defined(TARGET) && defined(TARGET_ARCH) && \
121 ${TARGET_ARCH} != ${MACHINE_ARCH}
122 TARGET= ${TARGET_ARCH}
124 # Otherwise, default to current machine type and architecture.
126 TARGET_ARCH?= ${MACHINE_ARCH}
128 KNOWN_ARCHES?= amd64 arm i386 i386/pc98 ia64 mips powerpc sparc64 sparc64/sun4v
129 .if ${TARGET} == ${TARGET_ARCH}
132 _t= ${TARGET_ARCH}/${TARGET}
135 .if empty(KNOWN_ARCHES:M${_t})
136 .error Unknown target ${TARGET_ARCH}:${TARGET}.
140 .if ${TARGET} == ${MACHINE}
141 TARGET_CPUTYPE?=${CPUTYPE}
146 .if !empty(TARGET_CPUTYPE)
147 _TARGET_CPUTYPE=${TARGET_CPUTYPE}
149 _TARGET_CPUTYPE=dummy
151 _CPUTYPE!= MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAKE} \
152 -f /dev/null -m ${.CURDIR}/share/mk -V CPUTYPE
153 .if ${_CPUTYPE} != ${_TARGET_CPUTYPE}
154 .error CPUTYPE global should be set with ?=.
157 BUILD_ARCH!= uname -p
158 .if ${MACHINE_ARCH} != ${BUILD_ARCH}
159 .error To cross-build, set TARGET_ARCH.
162 .if ${MACHINE} == ${TARGET} && !defined(CROSS_BUILD_TESTING)
163 OBJTREE= ${MAKEOBJDIRPREFIX}
165 OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}
167 WORLDTMP= ${OBJTREE}${.CURDIR}/tmp
168 # /usr/games added for fortune which depend on strfile
169 BPATH= ${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/usr/games
170 XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games
171 STRICTTMPPATH= ${BPATH}:${XPATH}
172 TMPPATH= ${STRICTTMPPATH}:${PATH}
175 # Avoid running mktemp(1) unless actually needed.
176 # It may not be functional, e.g., due to new ABI
177 # when in the middle of installing over this system.
179 .if make(distributeworld) || make(installworld)
180 INSTALLTMP!= /usr/bin/mktemp -d -u -t install
184 # Building a world goes through the following stages
186 # 1. legacy stage [BMAKE]
187 # This stage is responsible for creating compatibility
188 # shims that are needed by the bootstrap-tools,
189 # build-tools and cross-tools stages.
190 # 1. bootstrap-tools stage [BMAKE]
191 # This stage is responsible for creating programs that
192 # are needed for backward compatibility reasons. They
193 # are not built as cross-tools.
194 # 2. build-tools stage [TMAKE]
195 # This stage is responsible for creating the object
196 # tree and building any tools that are needed during
198 # 3. cross-tools stage [XMAKE]
199 # This stage is responsible for creating any tools that
200 # are needed for cross-builds. A cross-compiler is one
202 # 4. world stage [WMAKE]
203 # This stage actually builds the world.
204 # 5. install stage (optional) [IMAKE]
205 # This stage installs a previously built world.
210 # Common environment for world related stages
211 CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \
212 MACHINE_ARCH=${TARGET_ARCH} \
214 CPUTYPE=${TARGET_CPUTYPE} \
215 GROFF_BIN_PATH=${WORLDTMP}/legacy/usr/bin \
216 GROFF_FONT_PATH=${WORLDTMP}/legacy/usr/share/groff_font \
217 GROFF_TMAC_PATH=${WORLDTMP}/legacy/usr/share/tmac
218 .if ${OSRELDATE} < 700044
219 CROSSENV+= AR=gnu-ar RANLIB=gnu-ranlib
222 # bootstrap-tools stage
223 BMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \
224 PATH=${BPATH}:${PATH} \
225 WORLDTMP=${WORLDTMP} \
226 VERSION="${VERSION}" \
227 MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}"
228 BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \
229 ${BMAKEENV} ${MAKE} -f Makefile.inc1 \
231 BOOTSTRAPPING=${OSRELDATE} \
233 -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \
234 -DWITHOUT_NLS -DNO_PIC -DWITHOUT_PROFILE -DNO_SHARED \
235 -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF
238 TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \
239 ${BMAKEENV} ${MAKE} -f Makefile.inc1 \
240 TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
242 BOOTSTRAPPING=${OSRELDATE} -DNO_LINT -DNO_CPU_CFLAGS \
243 -DNO_WARNS -DNO_CTF -DWITHOUT_SSP
246 XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \
247 TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
251 WMAKEENV= ${CROSSENV} \
252 _SHLIBDIRPREFIX=${WORLDTMP} \
253 VERSION="${VERSION}" \
254 INSTALL="sh ${.CURDIR}/tools/install.sh" \
256 .if ${MK_CDDL} == "no" || defined(NO_CTF)
259 WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1 DESTDIR=${WORLDTMP}
261 .if ${TARGET_ARCH} == "amd64"
263 LIB32TMP= ${OBJTREE}${.CURDIR}/lib32
265 .if empty(TARGET_CPUTYPE)
266 LIB32CPUFLAGS= -march=i686 -mmmx -msse -msse2
268 LIB32CPUFLAGS= -march=${TARGET_CPUTYPE}
270 LIB32FLAGS= -m32 ${LIB32CPUFLAGS} -mfancy-math-387 -DCOMPAT_32BIT \
271 -iprefix ${LIB32TMP}/usr/ \
272 -L${LIB32TMP}/usr/lib32 \
273 -B${LIB32TMP}/usr/lib32
275 # Yes, the flags are redundant.
276 LIB32WMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \
277 _SHLIBDIRPREFIX=${LIB32TMP} \
278 VERSION="${VERSION}" \
281 INSTALL="sh ${.CURDIR}/tools/install.sh" \
283 CC="${CC} ${LIB32FLAGS}" \
284 CXX="${CXX} ${LIB32FLAGS}" \
285 OBJC="${OBJC} ${LIB32FLAGS}" \
286 LD="${LD} -m elf_i386_fbsd -Y P,${LIB32TMP}/usr/lib32" \
291 LIB32WMAKE= ${LIB32WMAKEENV} ${MAKE} -DNO_CPU_CFLAGS -DCOMPAT_32BIT \
292 -DWITHOUT_BIND -DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_INFO \
293 -DWITHOUT_HTML -DNO_CTF DESTDIR=${LIB32TMP}
294 LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*} -DNO_INCS
298 IMAKEENV= ${CROSSENV}
299 IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1
300 .if empty(.MAKEFLAGS:M-n)
301 IMAKEENV+= PATH=${STRICTTMPPATH}:${INSTALLTMP} \
302 LD_LIBRARY_PATH=${INSTALLTMP} \
303 PATH_LOCALE=${INSTALLTMP}/locale
304 IMAKE+= __MAKE_SHELL=${INSTALLTMP}/sh
306 IMAKEENV+= PATH=${TMPPATH}:${INSTALLTMP}
310 KMAKEENV= ${WMAKEENV}
311 KMAKE= ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME}
316 # Attempt to rebuild the entire system, with reasonable chance of
317 # success, regardless of how old your existing system is.
320 .if ${.CURDIR:C/[^,]//g} != ""
321 # The m4 build of sendmail files doesn't like it if ',' is used
322 # anywhere in the path of it's files.
324 @echo "*** Error: path to source tree contains a comma ','"
329 @echo "--------------------------------------------------------------"
330 @echo ">>> Rebuilding the temporary build tree"
331 @echo "--------------------------------------------------------------"
332 .if !defined(NO_CLEAN)
334 .if ${TARGET_ARCH} == "amd64"
338 rm -rf ${WORLDTMP}/legacy/usr/include
339 # XXX - These three can depend on any header file.
340 rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c
341 rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/kdump_subr.c
342 rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c
345 usr/bin usr/games usr/include/sys usr/lib \
346 usr/libexec usr/sbin usr/share/dict \
347 usr/share/groff_font/devX100 \
348 usr/share/groff_font/devX100-12 \
349 usr/share/groff_font/devX75 \
350 usr/share/groff_font/devX75-12 \
351 usr/share/groff_font/devascii \
352 usr/share/groff_font/devcp1047 \
353 usr/share/groff_font/devdvi \
354 usr/share/groff_font/devhtml \
355 usr/share/groff_font/devkoi8-r \
356 usr/share/groff_font/devlatin1 \
357 usr/share/groff_font/devlbp \
358 usr/share/groff_font/devlj4 \
359 usr/share/groff_font/devps \
360 usr/share/groff_font/devutf8 \
361 usr/share/tmac/mdoc usr/share/tmac/mm
362 mkdir -p ${WORLDTMP}/legacy/${_dir}
365 lib usr/bin usr/include usr/lib/compat/aout usr/libdata/ldscripts \
366 usr/libexec usr/sbin usr/share/misc
367 mkdir -p ${WORLDTMP}/${_dir}
369 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
370 -p ${WORLDTMP}/usr/include >/dev/null
371 ln -sf ${.CURDIR}/sys ${WORLDTMP}
372 .if ${MK_BIND_LIBS} != "no"
373 mtree -deU -f ${.CURDIR}/etc/mtree/BIND.include.dist \
374 -p ${WORLDTMP}/usr/include >/dev/null
378 @echo "--------------------------------------------------------------"
379 @echo ">>> stage 1.1: legacy release compatibility shims"
380 @echo "--------------------------------------------------------------"
381 ${_+_}cd ${.CURDIR}; ${BMAKE} legacy
384 @echo "--------------------------------------------------------------"
385 @echo ">>> stage 1.2: bootstrap tools"
386 @echo "--------------------------------------------------------------"
387 ${_+_}cd ${.CURDIR}; ${BMAKE} bootstrap-tools
389 .if !defined(NO_CLEAN)
391 @echo "--------------------------------------------------------------"
392 @echo ">>> stage 2.1: cleaning up the object tree"
393 @echo "--------------------------------------------------------------"
394 ${_+_}cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/}
395 .if ${TARGET_ARCH} == "amd64"
396 ${_+_}cd ${.CURDIR}; ${LIB32WMAKE} -f Makefile.inc1 ${CLEANDIR:S/^/par-/}
401 @echo "--------------------------------------------------------------"
402 @echo ">>> stage 2.2: rebuilding the object tree"
403 @echo "--------------------------------------------------------------"
404 ${_+_}cd ${.CURDIR}; ${WMAKE} par-obj
407 @echo "--------------------------------------------------------------"
408 @echo ">>> stage 2.3: build tools"
409 @echo "--------------------------------------------------------------"
410 ${_+_}cd ${.CURDIR}; ${TMAKE} build-tools
413 @echo "--------------------------------------------------------------"
414 @echo ">>> stage 3: cross tools"
415 @echo "--------------------------------------------------------------"
416 ${_+_}cd ${.CURDIR}; ${XMAKE} cross-tools
419 @echo "--------------------------------------------------------------"
420 @echo ">>> stage 4.1: building includes"
421 @echo "--------------------------------------------------------------"
422 ${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes
425 @echo "--------------------------------------------------------------"
426 @echo ">>> stage 4.2: building libraries"
427 @echo "--------------------------------------------------------------"
428 ${_+_}cd ${.CURDIR}; \
429 ${WMAKE} -DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT \
430 -DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_PROFILE libraries
433 @echo "--------------------------------------------------------------"
434 @echo ">>> stage 4.3: make dependencies"
435 @echo "--------------------------------------------------------------"
436 ${_+_}cd ${.CURDIR}; ${WMAKE} par-depend
439 @echo "--------------------------------------------------------------"
440 @echo ">>> stage 4.4: building everything"
441 @echo "--------------------------------------------------------------"
442 ${_+_}cd ${.CURDIR}; ${WMAKE} par-all
443 .if ${TARGET_ARCH} == "amd64"
446 @echo "--------------------------------------------------------------"
447 @echo ">>> stage 5.1: building 32 bit shim libraries"
448 @echo "--------------------------------------------------------------"
450 usr/include usr/lib32 usr/share/misc
451 mkdir -p ${LIB32TMP}/${_dir}
453 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
454 -p ${LIB32TMP}/usr/include >/dev/null
456 ln -sf ${.CURDIR}/sys ${WORLDTMP}
457 .if ${MK_KERBEROS} != "no"
458 .for _t in obj depend all
459 cd ${.CURDIR}/kerberos5/tools; \
460 MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} -DWITHOUT_SSP DESTDIR= \
464 .for _t in obj includes
465 cd ${.CURDIR}/include; ${LIB32WMAKE} ${_t}
466 cd ${.CURDIR}/lib; ${LIB32WMAKE} ${_t}
467 .if ${MK_CDDL} != "no"
468 cd ${.CURDIR}/cddl/lib; ${LIB32WMAKE} ${_t}
470 cd ${.CURDIR}/gnu/lib; ${LIB32WMAKE} ${_t}
471 .if ${MK_CRYPT} != "no"
472 cd ${.CURDIR}/secure/lib; ${LIB32WMAKE} ${_t}
474 .if ${MK_KERBEROS} != "no"
475 cd ${.CURDIR}/kerberos5/lib; ${LIB32WMAKE} ${_t}
478 .for _dir in usr.bin/lex/lib
479 cd ${.CURDIR}/${_dir}; ${LIB32WMAKE} obj
481 .for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw lib/libmagic
482 cd ${.CURDIR}/${_dir}; \
483 MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} -DWITHOUT_SSP DESTDIR= \
487 ${LIB32WMAKE} -f Makefile.inc1 libraries
488 .for _t in obj depend all
489 cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32WMAKE} ${_t}
490 cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32WMAKE} ${_t}
493 distribute32 install32:
494 .if make(distribute32)
495 mkdir -p ${DISTDIR}/${DISTRIBUTION}/usr/lib32 # XXX add to mtree
496 mkdir -p ${DISTDIR}/${DISTRIBUTION}/usr/lib32/dtrace # XXX add to mtree
498 mkdir -p ${DESTDIR}/usr/lib32 # XXX add to mtree
499 mkdir -p ${DESTDIR}/usr/lib32/dtrace # XXX add to mtree
501 cd ${.CURDIR}/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
502 .if ${MK_CDDL} != "no"
503 cd ${.CURDIR}/cddl/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
505 cd ${.CURDIR}/gnu/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
506 .if ${MK_CRYPT} != "no"
507 cd ${.CURDIR}/secure/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
509 .if ${MK_KERBEROS} != "no"
510 cd ${.CURDIR}/kerberos5/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
512 cd ${.CURDIR}/libexec/rtld-elf; \
513 PROG=ld-elf32.so.1 ${LIB32IMAKE} ${.TARGET:S/32$//}
514 cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32IMAKE} ${.TARGET:S/32$//}
518 .if !defined(SUBDIR_OVERRIDE)
519 WMAKE_TGTS+= _worldtmp _legacy _bootstrap-tools
521 WMAKE_TGTS+= _cleanobj _obj _build-tools
522 .if !defined(SUBDIR_OVERRIDE)
523 WMAKE_TGTS+= _cross-tools
525 WMAKE_TGTS+= _includes _libraries _depend everything
526 .if ${TARGET_ARCH} == "amd64" && ${MK_LIB32} != "no"
530 buildworld: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue
531 .ORDER: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue
534 @echo "--------------------------------------------------------------"
535 @echo ">>> World build started on `LC_ALL=C date`"
536 @echo "--------------------------------------------------------------"
540 @echo "--------------------------------------------------------------"
541 @echo ">>> World build completed on `LC_ALL=C date`"
542 @echo "--------------------------------------------------------------"
545 # We need to have this as a target because the indirection between Makefile
546 # and Makefile.inc1 causes the correct PATH to be used, rather than a
547 # modification of the current environment's PATH. In addition, we need
548 # to quote multiword values.
554 @echo Entering world for ${TARGET_ARCH}:${TARGET}
555 @cd ${.CURDIR} && env ${WMAKEENV} sh || true
557 TOOLCHAIN_TGTS= ${WMAKE_TGTS:N_depend:Neverything:Nbuild32}
558 toolchain: ${TOOLCHAIN_TGTS}
559 kernel-toolchain: ${TOOLCHAIN_TGTS:N_includes:N_libraries}
564 # Checks to be sure system is ready for installworld/installkernel.
569 # Require DESTDIR to be set if installing for a different architecture.
571 .if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${TARGET} != ${MACHINE}
572 .if !make(distributeworld)
573 installcheck: installcheck_DESTDIR
574 installcheck_DESTDIR:
575 .if !defined(DESTDIR) || empty(DESTDIR)
576 @echo "ERROR: Please set DESTDIR!"; \
583 # Check for missing UIDs/GIDs.
587 .if ${MK_SENDMAIL} != "no"
593 CHECK_GIDS+= proxy authpf
595 installcheck: installcheck_UGID
597 .for uid in ${CHECK_UIDS}
598 @if ! `id -u ${uid} >/dev/null 2>&1`; then \
599 echo "ERROR: Required ${uid} user is missing, see /usr/src/UPDATING."; \
603 .for gid in ${CHECK_GIDS}
604 @if ! `find / -prune -group ${gid} >/dev/null 2>&1`; then \
605 echo "ERROR: Required ${gid} group is missing, see /usr/src/UPDATING."; \
611 # Required install tools to be saved in a scratch dir for safety.
613 ITOOLS= [ awk cap_mkdb cat chflags chmod chown \
614 date echo egrep find grep install-info \
615 ln lockf make mkdir mtree mv pwd_mkdb rm sed sh sysctl \
616 test true uname wc zic
621 # Distributes everything compiled by a `buildworld'.
625 # Installs everything compiled by a 'buildworld'.
627 distributeworld installworld: installcheck
628 mkdir -p ${INSTALLTMP}
629 progs=$$(for prog in ${ITOOLS}; do \
630 if progpath=`which $$prog`; then \
633 echo "Required tool $$prog not found in PATH." >&2; \
637 libs=$$(ldd -f "%o %p\n" -f "%o %p\n" $$progs 2>/dev/null | sort -u | \
638 while read line; do \
640 if [ "$$2 $$3" != "not found" ]; then \
643 echo "Required library $$1 not found." >&2; \
647 cp $$libs $$progs ${INSTALLTMP}
648 cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale
649 ${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}; \
650 ${IMAKEENV} rm -rf ${INSTALLTMP}
655 # If you have a build server, you can NFS mount the source and obj directories
656 # and do a 'make reinstall' on the *client* to install new binaries from the
657 # most recent server build.
660 @echo "--------------------------------------------------------------"
661 @echo ">>> Making hierarchy"
662 @echo "--------------------------------------------------------------"
663 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy
665 @echo "--------------------------------------------------------------"
666 @echo ">>> Installing everything"
667 @echo "--------------------------------------------------------------"
668 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
669 .if ${TARGET_ARCH} == "amd64" && ${MK_LIB32} != "no"
670 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install32
674 @echo "--------------------------------------------------------------"
675 @echo ">>> Distributing everything"
676 @echo "--------------------------------------------------------------"
677 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute
678 .if ${TARGET_ARCH} == "amd64" && ${MK_LIB32} != "no"
679 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute32 \
683 distrib-dirs distribution:
684 cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} ${.TARGET}
687 # buildkernel and installkernel
689 # Which kernels to build and/or install is specified by setting
690 # KERNCONF. If not defined a GENERIC kernel is built/installed.
691 # Only the existing (depending TARGET) config files are used
692 # for building kernels and only the first of these is designated
693 # as the one being installed.
695 # Note that we have to use TARGET instead of TARGET_ARCH when
696 # we're in kernel-land. Since only TARGET_ARCH is (expected) to
697 # be set to cross-build, we have to make sure TARGET is set
700 .if !defined(KERNCONF) && defined(KERNEL)
706 INSTKERNNAME?= kernel
708 KERNSRCDIR?= ${.CURDIR}/sys
709 KRNLCONFDIR= ${KERNSRCDIR}/${TARGET}/conf
710 KRNLOBJDIR= ${OBJTREE}${KERNSRCDIR}
711 KERNCONFDIR?= ${KRNLCONFDIR}
715 .for _kernel in ${KERNCONF}
716 .if exists(${KERNCONFDIR}/${_kernel})
717 BUILDKERNELS+= ${_kernel}
718 .if empty(INSTALLKERNEL)
719 INSTALLKERNEL= ${_kernel}
727 # Builds all kernels defined by BUILDKERNELS.
730 .if empty(BUILDKERNELS)
731 @echo "ERROR: Missing kernel configuration file(s) (${KERNCONF})."; \
734 .if defined(KERNWARN)
735 @echo "--------------------------------------------------------------"
736 @echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF="
737 @echo "--------------------------------------------------------------"
741 .for _kernel in ${BUILDKERNELS}
742 @echo "--------------------------------------------------------------"
743 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
744 @echo "--------------------------------------------------------------"
745 @echo "===> ${_kernel}"
746 mkdir -p ${KRNLOBJDIR}
747 .if !defined(NO_KERNELCONFIG)
749 @echo "--------------------------------------------------------------"
750 @echo ">>> stage 1: configuring the kernel"
751 @echo "--------------------------------------------------------------"
754 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
755 ${KERNCONFDIR}/${_kernel}
757 .if !defined(NO_CLEAN) && !defined(NO_KERNELCLEAN)
759 @echo "--------------------------------------------------------------"
760 @echo ">>> stage 2.1: cleaning up the object tree"
761 @echo "--------------------------------------------------------------"
762 cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} ${CLEANDIR}
765 @echo "--------------------------------------------------------------"
766 @echo ">>> stage 2.2: rebuilding the object tree"
767 @echo "--------------------------------------------------------------"
768 cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} obj
770 @echo "--------------------------------------------------------------"
771 @echo ">>> stage 2.3: build tools"
772 @echo "--------------------------------------------------------------"
773 cd ${KRNLOBJDIR}/${_kernel}; \
774 MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \
775 ${MAKE} -DWITHOUT_SSP -DNO_CPU_CFLAGS -DNO_CTF \
776 -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile
777 # XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case.
778 .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules)
779 .for target in obj depend all
780 cd ${KERNSRCDIR}/modules/aic7xxx/aicasm; \
781 MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \
782 ${MAKE} -DWITHOUT_SSP -DNO_CPU_CFLAGS -DNO_CTF ${target}
785 .if !defined(NO_KERNELDEPEND)
787 @echo "--------------------------------------------------------------"
788 @echo ">>> stage 3.1: making dependencies"
789 @echo "--------------------------------------------------------------"
790 cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} depend -DNO_MODULES_OBJ
793 @echo "--------------------------------------------------------------"
794 @echo ">>> stage 3.2: building everything"
795 @echo "--------------------------------------------------------------"
796 cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ
797 @echo "--------------------------------------------------------------"
798 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
799 @echo "--------------------------------------------------------------"
803 # installkernel, etc.
805 # Install the kernel defined by INSTALLKERNEL
807 installkernel installkernel.debug \
808 reinstallkernel reinstallkernel.debug: installcheck
809 .if empty(INSTALLKERNEL)
810 @echo "ERROR: No kernel \"${KERNCONF}\" to install."; \
813 @echo "--------------------------------------------------------------"
814 @echo ">>> Installing kernel"
815 @echo "--------------------------------------------------------------"
816 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
817 ${CROSSENV} PATH=${TMPPATH} \
818 ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//}
823 # Build the API documentation with doxygen
826 @if [ ! -x `/usr/bin/which doxygen` ]; then \
827 echo "You need doxygen (devel/doxygen) to generate the API documentation of the kernel." | /usr/bin/fmt; \
830 cd ${.CURDIR}/tools/kerneldoc/subsys && ${MAKE} obj all
835 # Update the source tree, by running cvsup and/or running cvs to update to the
839 .if defined(SUP_UPDATE)
840 @echo "--------------------------------------------------------------"
841 @echo ">>> Running ${SUP}"
842 @echo "--------------------------------------------------------------"
844 @${SUP} ${SUPFLAGS} ${SUPFILE}
846 .if defined(SUPFILE1)
847 @${SUP} ${SUPFLAGS} ${SUPFILE1}
849 .if defined(SUPFILE2)
850 @${SUP} ${SUPFLAGS} ${SUPFILE2}
852 .if defined(PORTSSUPFILE) && !defined(NO_PORTSUPDATE)
853 @${SUP} ${SUPFLAGS} ${PORTSSUPFILE}
855 .if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE)
856 @${SUP} ${SUPFLAGS} ${DOCSUPFILE}
859 .if defined(CVS_UPDATE)
860 @echo "--------------------------------------------------------------"
861 @echo ">>> Updating ${.CURDIR} from CVS repository" ${CVSROOT}
862 @echo "--------------------------------------------------------------"
863 cd ${.CURDIR}; ${CVS} -R -q update ${CVSFLAGS}
867 # ------------------------------------------------------------------------
869 # From here onwards are utility targets used by the 'make world' and
870 # related targets. If your 'world' breaks, you may like to try to fix
871 # the problem and manually run the following targets to attempt to
872 # complete the build. Beware, this is *not* guaranteed to work, you
873 # need to have a pretty good grip on the current state of the system
874 # to attempt to manually finish it. If in doubt, 'make world' again.
878 # legacy: Build compatibility shims for the next three targets
881 .if ${BOOTSTRAPPING} < 600034 && ${BOOTSTRAPPING} != 0
882 @echo "ERROR: Source upgrades from versions prior to 6.0 not supported."; \
885 .for _tool in tools/build
886 ${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,depend,all,install)"; \
887 cd ${.CURDIR}/${_tool}; \
888 ${MAKE} DIRPRFX=${_tool}/ obj; \
889 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes; \
890 ${MAKE} DIRPRFX=${_tool}/ depend; \
891 ${MAKE} DIRPRFX=${_tool}/ all; \
892 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install
896 # bootstrap-tools: Build tools needed for compatibility
898 .if ${MK_GAMES} != "no"
899 _strfile= games/fortune/strfile
902 .if ${MK_CXX} != "no"
903 _gperf= gnu/usr.bin/gperf
904 .if ${BOOTSTRAPPING} < 700004
905 _groff= gnu/usr.bin/groff
907 _groff= gnu/usr.bin/groff/tmac
911 .if ${BOOTSTRAPPING} >= 700044 && ${BOOTSTRAPPING} < 800022
915 .if ${BOOTSTRAPPING} < 800013
916 _mklocale= usr.bin/mklocale
919 .if ${BOOTSTRAPPING} < 700018
920 _gensnmptree= usr.sbin/bsnmpd/gensnmptree
923 .if ${MK_RESCUE} != "no" && \
924 ${BOOTSTRAPPING} < 700026
925 _crunchgen= usr.sbin/crunch/crunchgen
928 .if ${MK_CDDL} != "no"
929 _dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \
930 lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge
948 ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
949 cd ${.CURDIR}/${_tool}; \
950 ${MAKE} DIRPRFX=${_tool}/ obj; \
951 ${MAKE} DIRPRFX=${_tool}/ depend; \
952 ${MAKE} DIRPRFX=${_tool}/ all; \
953 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install
957 # build-tools: Build special purpose build tools
959 .if defined(MODULES_WITH_WORLD) && exists(${KERNSRCDIR}/modules)
960 _aicasm= sys/modules/aic7xxx/aicasm
963 .if !defined(NO_SHARE)
964 _share= share/syscons/scrnmaps
967 .if ${MK_KERBEROS} != "no"
968 _kerberos5_tools= kerberos5/tools
971 .if ${MK_RESCUE} != "no"
972 _rescue= rescue/rescue
980 lib/ncurses/ncurses \
981 lib/ncurses/ncursesw \
987 ${_+_}@${ECHODIR} "===> ${_tool} (obj,build-tools)"; \
988 cd ${.CURDIR}/${_tool}; \
989 ${MAKE} DIRPRFX=${_tool}/ obj; \
990 ${MAKE} DIRPRFX=${_tool}/ build-tools
993 gnu/usr.bin/cc/cc_tools \
995 ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all)"; \
996 cd ${.CURDIR}/${_tool}; \
997 ${MAKE} DIRPRFX=${_tool}/ obj; \
998 ${MAKE} DIRPRFX=${_tool}/ depend; \
999 ${MAKE} DIRPRFX=${_tool}/ all
1003 # cross-tools: Build cross-building tools
1005 .if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${BOOTSTRAPPING} < 800035
1006 .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386"
1007 _btxld= usr.sbin/btxld
1010 .if ${TARGET_ARCH} != ${MACHINE_ARCH}
1011 .if ${MK_RESCUE} != "no" || defined(RELEASEDIR)
1012 _crunchide= usr.sbin/crunch/crunchide
1014 .if ${TARGET_ARCH} == "i386" && defined(RELEASEDIR)
1015 _kgzip= usr.sbin/kgzip
1021 gnu/usr.bin/binutils \
1024 usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \
1028 ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
1029 cd ${.CURDIR}/${_tool}; \
1030 ${MAKE} DIRPRFX=${_tool}/ obj; \
1031 ${MAKE} DIRPRFX=${_tool}/ depend; \
1032 ${MAKE} DIRPRFX=${_tool}/ all; \
1033 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
1037 # hierarchy - ensure that all the needed directories are present
1040 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs
1043 # libraries - build all libraries, and install them under ${DESTDIR}.
1045 # The list of libraries with dependents (${_prebuild_libs}) and their
1046 # interdependencies (__L) are built automatically by the
1047 # ${.CURDIR}/tools/make_libdeps.sh script.
1051 ${MAKE} -f Makefile.inc1 _prereq_libs; \
1052 ${MAKE} -f Makefile.inc1 _startup_libs; \
1053 ${MAKE} -f Makefile.inc1 _prebuild_libs; \
1054 ${MAKE} -f Makefile.inc1 _generic_libs;
1057 # static libgcc.a prerequisite for shared libc
1059 _prereq_libs= gnu/lib/libgcc
1061 # These dependencies are not automatically generated:
1063 # gnu/lib/csu, gnu/lib/libgcc, lib/csu and lib/libc must be built before
1064 # all shared libraries for ELF.
1066 _startup_libs= gnu/lib/csu
1067 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf)
1068 _startup_libs+= lib/csu/${MACHINE_ARCH}-elf
1070 _startup_libs+= lib/csu/${MACHINE_ARCH}
1072 _startup_libs+= gnu/lib/libgcc
1073 _startup_libs+= lib/libc
1075 gnu/lib/libgcc__L: lib/libc__L
1077 _prebuild_libs= ${_kerberos5_lib_libasn1} ${_kerberos5_lib_libkrb5} \
1078 ${_kerberos5_lib_libhx509} ${_kerberos5_lib_libroken} \
1079 ${_kerberos5_lib_libheimntlm} ${_kerberos5_lib_libgssapi_krb5} \
1080 lib/libbz2 lib/libcom_err lib/libcrypt lib/libelf \
1082 ${_lib_cddl} ${_lib_libgssapi} ${_lib_libipx} \
1083 lib/libkiconv lib/libkvm lib/libmd \
1084 lib/ncurses/ncurses lib/ncurses/ncursesw \
1085 lib/libopie lib/libpam ${_lib_libthr} \
1086 lib/libradius lib/libsbuf lib/libtacplus lib/libutil \
1087 ${_lib_libypclnt} lib/libz lib/msun \
1088 ${_secure_lib_libcrypto} ${_secure_lib_libssh} \
1089 ${_secure_lib_libssl} lib/libdwarf lib/libproc
1091 .if ${MK_LIBTHR} != "no"
1092 _lib_libthr= lib/libthr
1095 _generic_libs= ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} usr.bin/lex/lib
1097 lib/libopie__L lib/libtacplus__L: lib/libmd__L
1099 .if ${MK_CDDL} != "no"
1103 .if ${MK_CRYPT} != "no"
1104 .if ${MK_OPENSSL} != "no"
1105 _secure_lib_libcrypto= secure/lib/libcrypto
1106 _secure_lib_libssl= secure/lib/libssl
1107 lib/libradius__L secure/lib/libssl__L: secure/lib/libcrypto__L
1108 .if ${MK_OPENSSH} != "no"
1109 _secure_lib_libssh= secure/lib/libssh
1110 secure/lib/libssh__L: lib/libz__L secure/lib/libcrypto__L lib/libcrypt__L
1111 .if ${MK_KERBEROS} != "no"
1112 kerberos5/lib/libgssapi_krb5__L: kerberos5/lib/libkrb5__L \
1113 kerberos5/lib/libhx509__L kerberos5/lib/libasn1__L lib/libcom_err__L \
1114 lib/libmd__L kerberos5/lib/libroken__L secure/lib/libcrypto__L \
1116 secure/lib/libssh__L: lib/libgssapi__L kerberos5/lib/libgssapi_krb5__L
1120 _secure_lib= secure/lib
1123 .if ${MK_IPX} != "no"
1124 _lib_libipx= lib/libipx
1127 .if ${MK_KERBEROS} != "no"
1128 _kerberos5_lib= kerberos5/lib
1129 _kerberos5_lib_libasn1= kerberos5/lib/libasn1
1130 _kerberos5_lib_libkrb5= kerberos5/lib/libkrb5
1131 _kerberos5_lib_libhx509= kerberos5/lib/libhx509
1132 _kerberos5_lib_libroken= kerberos5/lib/libroken
1133 _kerberos5_lib_libheimntlm= kerberos5/lib/libheimntlm
1134 _kerberos5_lib_libgssapi_krb5= kerberos5/lib/libgssapi_krb5
1135 _lib_libgssapi= lib/libgssapi
1138 .if ${MK_NIS} != "no"
1139 _lib_libypclnt= lib/libypclnt
1142 .if ${MK_OPENSSL} == "no"
1143 lib/libradius__L: lib/libmd__L
1146 .for _lib in ${_prereq_libs}
1148 .if exists(${.CURDIR}/${_lib})
1149 ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \
1150 cd ${.CURDIR}/${_lib}; \
1151 ${MAKE} DIRPRFX=${_lib}/ obj; \
1152 ${MAKE} DIRPRFX=${_lib}/ depend; \
1153 ${MAKE} -DWITHOUT_PROFILE -DNO_PIC DIRPRFX=${_lib}/ all; \
1154 ${MAKE} -DWITHOUT_PROFILE -DNO_PIC DIRPRFX=${_lib}/ install
1158 .for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs}
1160 .if exists(${.CURDIR}/${_lib})
1161 ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \
1162 cd ${.CURDIR}/${_lib}; \
1163 ${MAKE} DIRPRFX=${_lib}/ obj; \
1164 ${MAKE} DIRPRFX=${_lib}/ depend; \
1165 ${MAKE} DIRPRFX=${_lib}/ all; \
1166 ${MAKE} DIRPRFX=${_lib}/ install
1170 # libpam is special: we need to build static PAM modules before
1171 # static PAM library, and dynamic PAM library before dynamic PAM
1173 lib/libpam__L: .PHONY
1174 ${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \
1175 cd ${.CURDIR}/lib/libpam; \
1176 ${MAKE} DIRPRFX=lib/libpam/ obj; \
1177 ${MAKE} DIRPRFX=lib/libpam/ depend; \
1178 ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET all; \
1179 ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET install
1181 _prereq_libs: ${_prereq_libs:S/$/__PL/}
1182 _startup_libs: ${_startup_libs:S/$/__L/}
1183 _prebuild_libs: ${_prebuild_libs:S/$/__L/}
1184 _generic_libs: ${_generic_libs:S/$/__L/}
1186 .for __target in all clean cleandepend cleandir depend includes obj
1187 .for entry in ${SUBDIR}
1188 ${entry}.${__target}__D: .PHONY
1189 ${_+_}@if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
1190 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH} (${__target})"; \
1191 edir=${entry}.${MACHINE_ARCH}; \
1192 cd ${.CURDIR}/$${edir}; \
1194 ${ECHODIR} "===> ${DIRPRFX}${entry} (${__target})"; \
1196 cd ${.CURDIR}/$${edir}; \
1198 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
1200 par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
1203 .include <bsd.subdir.mk>
1205 .if make(check-old) || make(check-old-dirs) || \
1206 make(check-old-files) || make(check-old-libs) || \
1207 make(delete-old) || make(delete-old-dirs) || \
1208 make(delete-old-files) || make(delete-old-libs)
1211 # check for / delete old files section
1214 .include "ObsoleteFiles.inc"
1216 OLD_LIBS_MESSAGE="Please be sure no application still uses those libraries, \
1217 else you can not start such an application. Consult UPDATING for more \
1218 information regarding how to cope with the removal/revision bump of a \
1221 .if !defined(BATCH_DELETE_OLD_FILES)
1228 @echo ">>> Removing old files (only deletes safe to delete libs)"
1229 # Ask for every old file if the user really wants to remove it.
1230 # It's annoying, but better safe than sorry.
1231 @for file in ${OLD_FILES}; do \
1232 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
1233 chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \
1234 rm ${RM_I} "${DESTDIR}/$${file}"; \
1237 # Remove catpages without corresponding manpages.
1239 find ${DESTDIR}/usr/share/man/cat* ! -type d | \
1240 sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \
1241 while read catpage; do \
1243 if [ ! -e "$${manpage}" ]; then \
1244 rm ${RM_I} $${catpage} <&3 ; \
1247 @echo ">>> Old files removed"
1250 @echo ">>> Checking for old files"
1251 @for file in ${OLD_FILES}; do \
1252 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
1253 echo "${DESTDIR}/$${file}"; \
1256 # Check for catpages without corresponding manpages.
1257 @find ${DESTDIR}/usr/share/man/cat* ! -type d | \
1258 sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \
1259 while read catpage; do \
1261 if [ ! -e "$${manpage}" ]; then \
1262 echo $${catpage} ; \
1267 @echo ">>> Removing old libraries"
1268 @echo "${OLD_LIBS_MESSAGE}" | fmt
1269 @for file in ${OLD_LIBS}; do \
1270 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
1271 chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \
1272 rm ${RM_I} "${DESTDIR}/$${file}"; \
1275 @echo ">>> Old libraries removed"
1278 @echo ">>> Checking for old libraries"
1279 @for file in ${OLD_LIBS}; do \
1280 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
1281 echo "${DESTDIR}/$${file}"; \
1286 @echo ">>> Removing old directories"
1287 @for dir in ${OLD_DIRS}; do \
1288 if [ -d "${DESTDIR}/$${dir}" ]; then \
1289 rmdir -v "${DESTDIR}/$${dir}" || true; \
1290 elif [ -L "${DESTDIR}/$${dir}" ]; then \
1291 echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \
1294 @echo ">>> Old directories removed"
1297 @echo ">>> Checking for old directories"
1298 @for dir in ${OLD_DIRS}; do \
1299 if [ -d "${DESTDIR}/$${dir}" ]; then \
1300 echo "${DESTDIR}/$${dir}"; \
1301 elif [ -L "${DESTDIR}/$${dir}" ]; then \
1302 echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \
1306 delete-old: delete-old-files delete-old-dirs
1307 @echo "To remove old libraries run '${MAKE} delete-old-libs'."
1309 check-old: check-old-files check-old-libs check-old-dirs
1310 @echo "To remove old files and directories run '${MAKE} delete-old'."
1311 @echo "To remove old libraries run '${MAKE} delete-old-libs'."
1316 # showconfig - show build configuration.
1319 @${MAKE} -n -f bsd.own.mk -V dummy -dg1 | grep ^MK_ | sort