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 # -DKERNFAST define NO_KERNELCONFIG, NO_KERNELCLEAN and NO_KERNELCONFIG
9 # -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel
10 # -DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel
11 # -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel
12 # -DNO_PORTSUPDATE do not update ports in ${MAKE} update
13 # -DNO_DOCUPDATE do not update doc in ${MAKE} update
14 # -DNO_CTF do not run the DTrace CTF conversion tools on built objects
15 # LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
16 # TARGET="machine" to crossbuild world for a different machine type
19 # The intended user-driven targets are:
20 # buildworld - rebuild *everything*, including glue to help do upgrades
21 # installworld- install everything built by "buildworld"
22 # doxygen - build API documentation of the kernel
23 # update - convenient way to update your source tree (eg: cvsup/cvs)
25 # Standard targets (not defined here) are documented in the makefiles in
26 # /usr/share/mk. These include:
27 # obj depend all install clean cleandepend cleanobj
31 .if ${MACHINE_ARCH} == "mips"
32 MK_RESCUE=no # not yet
35 # We must do share/info early so that installation of info `dir'
36 # entries works correctly. Do it first since it is less likely to
37 # grow dependencies on include and lib than vice versa.
39 # We must do lib/ and libexec/ before bin/, because if installworld
40 # installs a new /bin/sh, the 'make' command will *immediately*
41 # use that new version. And the new (dynamically-linked) /bin/sh
42 # will expect to find appropriate libraries in /lib and /libexec.
44 SUBDIR= share/info lib libexec
46 .if ${MK_GAMES} != "no"
49 .if ${MK_CDDL} != "no"
55 .if ${MK_KERBEROS} != "no"
58 .if ${MK_RESCUE} != "no"
62 .if ${MK_CRYPT} != "no"
65 .if !defined(NO_SHARE)
68 SUBDIR+=sys usr.bin usr.sbin
70 # We must do etc/ last for install/distribute to work.
74 # These are last, since it is nice to at least get the base system
75 # rebuilt before you do them.
76 .for _DIR in ${LOCAL_DIRS}
77 .if exists(${.CURDIR}/${_DIR}/Makefile)
82 .if defined(SUBDIR_OVERRIDE)
83 SUBDIR= ${SUBDIR_OVERRIDE}
89 .if defined(NO_CLEANDIR)
90 CLEANDIR= clean cleandepend
96 CVSFLAGS?= -A -P -d -I!
100 SUPFLAGS+= -h ${SUPHOST}
103 MAKEOBJDIRPREFIX?= /usr/obj
104 .if !defined(OSRELDATE)
105 .if exists(/usr/include/osreldate.h)
106 OSRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \
107 /usr/include/osreldate.h
113 .if !defined(VERSION)
115 VERSION+= ${OSRELDATE}
118 # Guess machine architecture from machine type, and vice versa.
119 .if !defined(TARGET_ARCH) && defined(TARGET)
120 TARGET_ARCH= ${TARGET:S/pc98/i386/:S/sun4v/sparc64/}
121 .elif !defined(TARGET) && defined(TARGET_ARCH) && \
122 ${TARGET_ARCH} != ${MACHINE_ARCH}
123 TARGET= ${TARGET_ARCH}
125 # Otherwise, default to current machine type and architecture.
127 TARGET_ARCH?= ${MACHINE_ARCH}
129 KNOWN_ARCHES?= amd64 arm i386 i386/pc98 ia64 mips powerpc sparc64 sparc64/sun4v
130 .if ${TARGET} == ${TARGET_ARCH}
133 _t= ${TARGET_ARCH}/${TARGET}
136 .if empty(KNOWN_ARCHES:M${_t})
137 .error Unknown target ${TARGET_ARCH}:${TARGET}.
141 .if ${TARGET} == ${MACHINE}
142 TARGET_CPUTYPE?=${CPUTYPE}
147 .if !empty(TARGET_CPUTYPE)
148 _TARGET_CPUTYPE=${TARGET_CPUTYPE}
150 _TARGET_CPUTYPE=dummy
152 _CPUTYPE!= MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAKE} \
153 -f /dev/null -m ${.CURDIR}/share/mk -V CPUTYPE
154 .if ${_CPUTYPE} != ${_TARGET_CPUTYPE}
155 .error CPUTYPE global should be set with ?=.
158 BUILD_ARCH!= uname -p
159 .if ${MACHINE_ARCH} != ${BUILD_ARCH}
160 .error To cross-build, set TARGET_ARCH.
163 .if ${MACHINE} == ${TARGET} && !defined(CROSS_BUILD_TESTING)
164 OBJTREE= ${MAKEOBJDIRPREFIX}
166 OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}
168 WORLDTMP= ${OBJTREE}${.CURDIR}/tmp
169 # /usr/games added for fortune which depend on strfile
170 BPATH= ${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/usr/games
171 XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games
172 STRICTTMPPATH= ${BPATH}:${XPATH}
173 TMPPATH= ${STRICTTMPPATH}:${PATH}
176 # Avoid running mktemp(1) unless actually needed.
177 # It may not be functional, e.g., due to new ABI
178 # when in the middle of installing over this system.
180 .if make(distributeworld) || make(installworld)
181 INSTALLTMP!= /usr/bin/mktemp -d -u -t install
185 # Building a world goes through the following stages
187 # 1. legacy stage [BMAKE]
188 # This stage is responsible for creating compatibility
189 # shims that are needed by the bootstrap-tools,
190 # build-tools and cross-tools stages.
191 # 1. bootstrap-tools stage [BMAKE]
192 # This stage is responsible for creating programs that
193 # are needed for backward compatibility reasons. They
194 # are not built as cross-tools.
195 # 2. build-tools stage [TMAKE]
196 # This stage is responsible for creating the object
197 # tree and building any tools that are needed during
199 # 3. cross-tools stage [XMAKE]
200 # This stage is responsible for creating any tools that
201 # are needed for cross-builds. A cross-compiler is one
203 # 4. world stage [WMAKE]
204 # This stage actually builds the world.
205 # 5. install stage (optional) [IMAKE]
206 # This stage installs a previously built world.
211 # Common environment for world related stages
212 CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \
213 MACHINE_ARCH=${TARGET_ARCH} \
215 CPUTYPE=${TARGET_CPUTYPE} \
216 GROFF_BIN_PATH=${WORLDTMP}/legacy/usr/bin \
217 GROFF_FONT_PATH=${WORLDTMP}/legacy/usr/share/groff_font \
218 GROFF_TMAC_PATH=${WORLDTMP}/legacy/usr/share/tmac
219 .if ${OSRELDATE} < 700044
220 CROSSENV+= AR=gnu-ar RANLIB=gnu-ranlib
223 # bootstrap-tools stage
224 BMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \
225 PATH=${BPATH}:${PATH} \
226 WORLDTMP=${WORLDTMP} \
227 VERSION="${VERSION}" \
228 MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}"
229 BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \
230 ${BMAKEENV} ${MAKE} -f Makefile.inc1 \
232 BOOTSTRAPPING=${OSRELDATE} \
234 -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \
235 -DWITHOUT_NLS -DNO_PIC -DWITHOUT_PROFILE -DNO_SHARED \
236 -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF
239 TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \
240 ${BMAKEENV} ${MAKE} -f Makefile.inc1 \
241 TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
243 BOOTSTRAPPING=${OSRELDATE} -DNO_LINT -DNO_CPU_CFLAGS \
244 -DNO_WARNS -DNO_CTF -DWITHOUT_SSP
247 XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \
248 TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
252 WMAKEENV= ${CROSSENV} \
253 _SHLIBDIRPREFIX=${WORLDTMP} \
254 VERSION="${VERSION}" \
255 INSTALL="sh ${.CURDIR}/tools/install.sh" \
257 .if ${MK_CDDL} == "no" || defined(NO_CTF)
260 WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1 DESTDIR=${WORLDTMP}
262 .if ${TARGET_ARCH} == "amd64"
264 LIB32TMP= ${OBJTREE}${.CURDIR}/lib32
266 .if empty(TARGET_CPUTYPE)
267 LIB32CPUFLAGS= -march=i686 -mmmx -msse -msse2
269 LIB32CPUFLAGS= -march=${TARGET_CPUTYPE}
271 LIB32FLAGS= -m32 ${LIB32CPUFLAGS} -mfancy-math-387 -DCOMPAT_32BIT \
272 -iprefix ${LIB32TMP}/usr/ \
273 -L${LIB32TMP}/usr/lib32 \
274 -B${LIB32TMP}/usr/lib32
276 # Yes, the flags are redundant.
277 LIB32WMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \
278 _SHLIBDIRPREFIX=${LIB32TMP} \
279 VERSION="${VERSION}" \
282 INSTALL="sh ${.CURDIR}/tools/install.sh" \
284 CC="${CC} ${LIB32FLAGS}" \
285 CXX="${CXX} ${LIB32FLAGS}" \
286 OBJC="${OBJC} ${LIB32FLAGS}" \
287 LD="${LD} -m elf_i386_fbsd -Y P,${LIB32TMP}/usr/lib32" \
292 LIB32WMAKE= ${LIB32WMAKEENV} ${MAKE} -DNO_CPU_CFLAGS -DCOMPAT_32BIT \
293 -DWITHOUT_BIND -DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_INFO \
294 -DWITHOUT_HTML -DNO_CTF DESTDIR=${LIB32TMP}
295 LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*} -DNO_INCS
299 IMAKEENV= ${CROSSENV}
300 IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1
301 .if empty(.MAKEFLAGS:M-n)
302 IMAKEENV+= PATH=${STRICTTMPPATH}:${INSTALLTMP} \
303 LD_LIBRARY_PATH=${INSTALLTMP} \
304 PATH_LOCALE=${INSTALLTMP}/locale
305 IMAKE+= __MAKE_SHELL=${INSTALLTMP}/sh
307 IMAKEENV+= PATH=${TMPPATH}:${INSTALLTMP}
311 KMAKEENV= ${WMAKEENV}
312 KMAKE= ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME}
317 # Attempt to rebuild the entire system, with reasonable chance of
318 # success, regardless of how old your existing system is.
321 .if ${.CURDIR:C/[^,]//g} != ""
322 # The m4 build of sendmail files doesn't like it if ',' is used
323 # anywhere in the path of it's files.
325 @echo "*** Error: path to source tree contains a comma ','"
330 @echo "--------------------------------------------------------------"
331 @echo ">>> Rebuilding the temporary build tree"
332 @echo "--------------------------------------------------------------"
333 .if !defined(NO_CLEAN)
335 .if ${TARGET_ARCH} == "amd64"
339 rm -rf ${WORLDTMP}/legacy/usr/include
340 # XXX - These three can depend on any header file.
341 rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c
342 rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/kdump_subr.c
343 rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c
346 usr/bin usr/games usr/include/sys usr/lib \
347 usr/libexec usr/sbin usr/share/dict \
348 usr/share/groff_font/devX100 \
349 usr/share/groff_font/devX100-12 \
350 usr/share/groff_font/devX75 \
351 usr/share/groff_font/devX75-12 \
352 usr/share/groff_font/devascii \
353 usr/share/groff_font/devcp1047 \
354 usr/share/groff_font/devdvi \
355 usr/share/groff_font/devhtml \
356 usr/share/groff_font/devkoi8-r \
357 usr/share/groff_font/devlatin1 \
358 usr/share/groff_font/devlbp \
359 usr/share/groff_font/devlj4 \
360 usr/share/groff_font/devps \
361 usr/share/groff_font/devutf8 \
362 usr/share/tmac/mdoc usr/share/tmac/mm
363 mkdir -p ${WORLDTMP}/legacy/${_dir}
366 lib usr/bin usr/include usr/lib/compat/aout usr/libdata/ldscripts \
367 usr/libexec usr/sbin usr/share/misc
368 mkdir -p ${WORLDTMP}/${_dir}
370 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
371 -p ${WORLDTMP}/usr/include >/dev/null
372 ln -sf ${.CURDIR}/sys ${WORLDTMP}
373 .if ${MK_BIND_LIBS} != "no"
374 mtree -deU -f ${.CURDIR}/etc/mtree/BIND.include.dist \
375 -p ${WORLDTMP}/usr/include >/dev/null
379 @echo "--------------------------------------------------------------"
380 @echo ">>> stage 1.1: legacy release compatibility shims"
381 @echo "--------------------------------------------------------------"
382 ${_+_}cd ${.CURDIR}; ${BMAKE} legacy
385 @echo "--------------------------------------------------------------"
386 @echo ">>> stage 1.2: bootstrap tools"
387 @echo "--------------------------------------------------------------"
388 ${_+_}cd ${.CURDIR}; ${BMAKE} bootstrap-tools
390 .if !defined(NO_CLEAN)
392 @echo "--------------------------------------------------------------"
393 @echo ">>> stage 2.1: cleaning up the object tree"
394 @echo "--------------------------------------------------------------"
395 ${_+_}cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/}
396 .if ${TARGET_ARCH} == "amd64"
397 ${_+_}cd ${.CURDIR}; ${LIB32WMAKE} -f Makefile.inc1 ${CLEANDIR:S/^/par-/}
402 @echo "--------------------------------------------------------------"
403 @echo ">>> stage 2.2: rebuilding the object tree"
404 @echo "--------------------------------------------------------------"
405 ${_+_}cd ${.CURDIR}; ${WMAKE} par-obj
408 @echo "--------------------------------------------------------------"
409 @echo ">>> stage 2.3: build tools"
410 @echo "--------------------------------------------------------------"
411 ${_+_}cd ${.CURDIR}; ${TMAKE} build-tools
414 @echo "--------------------------------------------------------------"
415 @echo ">>> stage 3: cross tools"
416 @echo "--------------------------------------------------------------"
417 ${_+_}cd ${.CURDIR}; ${XMAKE} cross-tools
420 @echo "--------------------------------------------------------------"
421 @echo ">>> stage 4.1: building includes"
422 @echo "--------------------------------------------------------------"
423 ${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes
426 @echo "--------------------------------------------------------------"
427 @echo ">>> stage 4.2: building libraries"
428 @echo "--------------------------------------------------------------"
429 ${_+_}cd ${.CURDIR}; \
430 ${WMAKE} -DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT \
431 -DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_PROFILE libraries
434 @echo "--------------------------------------------------------------"
435 @echo ">>> stage 4.3: make dependencies"
436 @echo "--------------------------------------------------------------"
437 ${_+_}cd ${.CURDIR}; ${WMAKE} par-depend
440 @echo "--------------------------------------------------------------"
441 @echo ">>> stage 4.4: building everything"
442 @echo "--------------------------------------------------------------"
443 ${_+_}cd ${.CURDIR}; ${WMAKE} par-all
444 .if ${TARGET_ARCH} == "amd64"
447 @echo "--------------------------------------------------------------"
448 @echo ">>> stage 5.1: building 32 bit shim libraries"
449 @echo "--------------------------------------------------------------"
451 usr/include usr/lib32 usr/share/misc
452 mkdir -p ${LIB32TMP}/${_dir}
454 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
455 -p ${LIB32TMP}/usr/include >/dev/null
457 ln -sf ${.CURDIR}/sys ${WORLDTMP}
458 .if ${MK_KERBEROS} != "no"
459 .for _t in obj depend all
460 cd ${.CURDIR}/kerberos5/tools; \
461 MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} -DWITHOUT_SSP DESTDIR= \
465 .for _t in obj includes
466 cd ${.CURDIR}/include; ${LIB32WMAKE} ${_t}
467 cd ${.CURDIR}/lib; ${LIB32WMAKE} ${_t}
468 .if ${MK_CDDL} != "no"
469 cd ${.CURDIR}/cddl/lib; ${LIB32WMAKE} ${_t}
471 cd ${.CURDIR}/gnu/lib; ${LIB32WMAKE} ${_t}
472 .if ${MK_CRYPT} != "no"
473 cd ${.CURDIR}/secure/lib; ${LIB32WMAKE} ${_t}
475 .if ${MK_KERBEROS} != "no"
476 cd ${.CURDIR}/kerberos5/lib; ${LIB32WMAKE} ${_t}
479 .for _dir in usr.bin/lex/lib
480 cd ${.CURDIR}/${_dir}; ${LIB32WMAKE} obj
482 .for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw lib/libmagic
483 cd ${.CURDIR}/${_dir}; \
484 MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} -DWITHOUT_SSP DESTDIR= \
488 ${LIB32WMAKE} -f Makefile.inc1 libraries
489 .for _t in obj depend all
490 cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32WMAKE} ${_t}
491 cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32WMAKE} ${_t}
494 distribute32 install32:
495 .if make(distribute32)
496 mkdir -p ${DISTDIR}/${DISTRIBUTION}/usr/lib32 # XXX add to mtree
497 mkdir -p ${DISTDIR}/${DISTRIBUTION}/usr/lib32/dtrace # XXX add to mtree
499 mkdir -p ${DESTDIR}/usr/lib32 # XXX add to mtree
500 mkdir -p ${DESTDIR}/usr/lib32/dtrace # XXX add to mtree
502 cd ${.CURDIR}/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
503 .if ${MK_CDDL} != "no"
504 cd ${.CURDIR}/cddl/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
506 cd ${.CURDIR}/gnu/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
507 .if ${MK_CRYPT} != "no"
508 cd ${.CURDIR}/secure/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
510 .if ${MK_KERBEROS} != "no"
511 cd ${.CURDIR}/kerberos5/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
513 cd ${.CURDIR}/libexec/rtld-elf; \
514 PROG=ld-elf32.so.1 ${LIB32IMAKE} ${.TARGET:S/32$//}
515 cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32IMAKE} ${.TARGET:S/32$//}
519 .if !defined(SUBDIR_OVERRIDE)
520 WMAKE_TGTS+= _worldtmp _legacy _bootstrap-tools
522 WMAKE_TGTS+= _cleanobj _obj _build-tools
523 .if !defined(SUBDIR_OVERRIDE)
524 WMAKE_TGTS+= _cross-tools
526 WMAKE_TGTS+= _includes _libraries _depend everything
527 .if ${TARGET_ARCH} == "amd64" && ${MK_LIB32} != "no"
531 buildworld: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue
532 .ORDER: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue
535 @echo "--------------------------------------------------------------"
536 @echo ">>> World build started on `LC_ALL=C date`"
537 @echo "--------------------------------------------------------------"
541 @echo "--------------------------------------------------------------"
542 @echo ">>> World build completed on `LC_ALL=C date`"
543 @echo "--------------------------------------------------------------"
546 # We need to have this as a target because the indirection between Makefile
547 # and Makefile.inc1 causes the correct PATH to be used, rather than a
548 # modification of the current environment's PATH. In addition, we need
549 # to quote multiword values.
555 @echo Entering world for ${TARGET_ARCH}:${TARGET}
556 @cd ${.CURDIR} && env ${WMAKEENV} sh || true
558 TOOLCHAIN_TGTS= ${WMAKE_TGTS:N_depend:Neverything:Nbuild32}
559 toolchain: ${TOOLCHAIN_TGTS}
560 kernel-toolchain: ${TOOLCHAIN_TGTS:N_includes:N_libraries}
565 # Checks to be sure system is ready for installworld/installkernel.
570 # Require DESTDIR to be set if installing for a different architecture.
572 .if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${TARGET} != ${MACHINE}
573 .if !make(distributeworld)
574 installcheck: installcheck_DESTDIR
575 installcheck_DESTDIR:
576 .if !defined(DESTDIR) || empty(DESTDIR)
577 @echo "ERROR: Please set DESTDIR!"; \
584 # Check for missing UIDs/GIDs.
588 .if ${MK_SENDMAIL} != "no"
594 CHECK_GIDS+= proxy authpf
596 installcheck: installcheck_UGID
598 .for uid in ${CHECK_UIDS}
599 @if ! `id -u ${uid} >/dev/null 2>&1`; then \
600 echo "ERROR: Required ${uid} user is missing, see /usr/src/UPDATING."; \
604 .for gid in ${CHECK_GIDS}
605 @if ! `find / -prune -group ${gid} >/dev/null 2>&1`; then \
606 echo "ERROR: Required ${gid} group is missing, see /usr/src/UPDATING."; \
612 # Required install tools to be saved in a scratch dir for safety.
614 ITOOLS= [ awk cap_mkdb cat chflags chmod chown \
615 date echo egrep find grep install-info \
616 ln lockf make mkdir mtree mv pwd_mkdb rm sed sh sysctl \
617 test true uname wc zic
622 # Distributes everything compiled by a `buildworld'.
626 # Installs everything compiled by a 'buildworld'.
628 distributeworld installworld: installcheck
629 mkdir -p ${INSTALLTMP}
630 progs=$$(for prog in ${ITOOLS}; do \
631 if progpath=`which $$prog`; then \
634 echo "Required tool $$prog not found in PATH." >&2; \
638 libs=$$(ldd -f "%o %p\n" -f "%o %p\n" $$progs 2>/dev/null | sort -u | \
639 while read line; do \
641 if [ "$$2 $$3" != "not found" ]; then \
644 echo "Required library $$1 not found." >&2; \
648 cp $$libs $$progs ${INSTALLTMP}
649 cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale
650 ${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}; \
651 ${IMAKEENV} rm -rf ${INSTALLTMP}
656 # If you have a build server, you can NFS mount the source and obj directories
657 # and do a 'make reinstall' on the *client* to install new binaries from the
658 # most recent server build.
661 @echo "--------------------------------------------------------------"
662 @echo ">>> Making hierarchy"
663 @echo "--------------------------------------------------------------"
664 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy
666 @echo "--------------------------------------------------------------"
667 @echo ">>> Installing everything"
668 @echo "--------------------------------------------------------------"
669 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
670 .if ${TARGET_ARCH} == "amd64" && ${MK_LIB32} != "no"
671 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install32
675 @echo "--------------------------------------------------------------"
676 @echo ">>> Distributing everything"
677 @echo "--------------------------------------------------------------"
678 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute
679 .if ${TARGET_ARCH} == "amd64" && ${MK_LIB32} != "no"
680 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute32 \
684 distrib-dirs distribution:
685 cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} ${.TARGET}
688 # buildkernel and installkernel
690 # Which kernels to build and/or install is specified by setting
691 # KERNCONF. If not defined a GENERIC kernel is built/installed.
692 # Only the existing (depending TARGET) config files are used
693 # for building kernels and only the first of these is designated
694 # as the one being installed.
696 # Note that we have to use TARGET instead of TARGET_ARCH when
697 # we're in kernel-land. Since only TARGET_ARCH is (expected) to
698 # be set to cross-build, we have to make sure TARGET is set
701 .if defined(KERNFAST)
706 .if !defined(KERNCONF) && defined(KERNEL)
712 INSTKERNNAME?= kernel
714 KERNSRCDIR?= ${.CURDIR}/sys
715 KRNLCONFDIR= ${KERNSRCDIR}/${TARGET}/conf
716 KRNLOBJDIR= ${OBJTREE}${KERNSRCDIR}
717 KERNCONFDIR?= ${KRNLCONFDIR}
721 .for _kernel in ${KERNCONF}
722 .if exists(${KERNCONFDIR}/${_kernel})
723 BUILDKERNELS+= ${_kernel}
724 .if empty(INSTALLKERNEL)
725 INSTALLKERNEL= ${_kernel}
733 # Builds all kernels defined by BUILDKERNELS.
736 .if empty(BUILDKERNELS)
737 @echo "ERROR: Missing kernel configuration file(s) (${KERNCONF})."; \
740 .if defined(KERNWARN)
741 @echo "--------------------------------------------------------------"
742 @echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF="
743 @echo "--------------------------------------------------------------"
747 .for _kernel in ${BUILDKERNELS}
748 @echo "--------------------------------------------------------------"
749 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
750 @echo "--------------------------------------------------------------"
751 @echo "===> ${_kernel}"
752 mkdir -p ${KRNLOBJDIR}
753 .if !defined(NO_KERNELCONFIG)
755 @echo "--------------------------------------------------------------"
756 @echo ">>> stage 1: configuring the kernel"
757 @echo "--------------------------------------------------------------"
760 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
761 ${KERNCONFDIR}/${_kernel}
763 .if !defined(NO_CLEAN) && !defined(NO_KERNELCLEAN)
765 @echo "--------------------------------------------------------------"
766 @echo ">>> stage 2.1: cleaning up the object tree"
767 @echo "--------------------------------------------------------------"
768 cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} ${CLEANDIR}
771 @echo "--------------------------------------------------------------"
772 @echo ">>> stage 2.2: rebuilding the object tree"
773 @echo "--------------------------------------------------------------"
774 cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} obj
776 @echo "--------------------------------------------------------------"
777 @echo ">>> stage 2.3: build tools"
778 @echo "--------------------------------------------------------------"
779 cd ${KRNLOBJDIR}/${_kernel}; \
780 MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \
781 ${MAKE} -DWITHOUT_SSP -DNO_CPU_CFLAGS -DNO_CTF \
782 -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile
783 # XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case.
784 .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules)
785 .for target in obj depend all
786 cd ${KERNSRCDIR}/modules/aic7xxx/aicasm; \
787 MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \
788 ${MAKE} -DWITHOUT_SSP -DNO_CPU_CFLAGS -DNO_CTF ${target}
791 .if !defined(NO_KERNELDEPEND)
793 @echo "--------------------------------------------------------------"
794 @echo ">>> stage 3.1: making dependencies"
795 @echo "--------------------------------------------------------------"
796 cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} depend -DNO_MODULES_OBJ
799 @echo "--------------------------------------------------------------"
800 @echo ">>> stage 3.2: building everything"
801 @echo "--------------------------------------------------------------"
802 cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ
803 @echo "--------------------------------------------------------------"
804 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
805 @echo "--------------------------------------------------------------"
809 # installkernel, etc.
811 # Install the kernel defined by INSTALLKERNEL
813 installkernel installkernel.debug \
814 reinstallkernel reinstallkernel.debug: installcheck
815 .if empty(INSTALLKERNEL)
816 @echo "ERROR: No kernel \"${KERNCONF}\" to install."; \
819 @echo "--------------------------------------------------------------"
820 @echo ">>> Installing kernel"
821 @echo "--------------------------------------------------------------"
822 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
823 ${CROSSENV} PATH=${TMPPATH} \
824 ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//}
829 # Build the API documentation with doxygen
832 @if [ ! -x `/usr/bin/which doxygen` ]; then \
833 echo "You need doxygen (devel/doxygen) to generate the API documentation of the kernel." | /usr/bin/fmt; \
836 cd ${.CURDIR}/tools/kerneldoc/subsys && ${MAKE} obj all
841 # Update the source tree, by running cvsup and/or running cvs to update to the
845 .if defined(SUP_UPDATE)
846 @echo "--------------------------------------------------------------"
847 @echo ">>> Running ${SUP}"
848 @echo "--------------------------------------------------------------"
850 @${SUP} ${SUPFLAGS} ${SUPFILE}
852 .if defined(SUPFILE1)
853 @${SUP} ${SUPFLAGS} ${SUPFILE1}
855 .if defined(SUPFILE2)
856 @${SUP} ${SUPFLAGS} ${SUPFILE2}
858 .if defined(PORTSSUPFILE) && !defined(NO_PORTSUPDATE)
859 @${SUP} ${SUPFLAGS} ${PORTSSUPFILE}
861 .if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE)
862 @${SUP} ${SUPFLAGS} ${DOCSUPFILE}
865 .if defined(CVS_UPDATE)
866 @echo "--------------------------------------------------------------"
867 @echo ">>> Updating ${.CURDIR} from CVS repository" ${CVSROOT}
868 @echo "--------------------------------------------------------------"
869 cd ${.CURDIR}; ${CVS} -R -q update ${CVSFLAGS}
873 # ------------------------------------------------------------------------
875 # From here onwards are utility targets used by the 'make world' and
876 # related targets. If your 'world' breaks, you may like to try to fix
877 # the problem and manually run the following targets to attempt to
878 # complete the build. Beware, this is *not* guaranteed to work, you
879 # need to have a pretty good grip on the current state of the system
880 # to attempt to manually finish it. If in doubt, 'make world' again.
884 # legacy: Build compatibility shims for the next three targets
887 .if ${BOOTSTRAPPING} < 600034 && ${BOOTSTRAPPING} != 0
888 @echo "ERROR: Source upgrades from versions prior to 6.0 not supported."; \
891 .for _tool in tools/build
892 ${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,depend,all,install)"; \
893 cd ${.CURDIR}/${_tool}; \
894 ${MAKE} DIRPRFX=${_tool}/ obj; \
895 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes; \
896 ${MAKE} DIRPRFX=${_tool}/ depend; \
897 ${MAKE} DIRPRFX=${_tool}/ all; \
898 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install
902 # bootstrap-tools: Build tools needed for compatibility
904 .if ${MK_GAMES} != "no"
905 _strfile= games/fortune/strfile
908 .if ${MK_CXX} != "no"
909 _gperf= gnu/usr.bin/gperf
910 .if ${BOOTSTRAPPING} < 700004
911 _groff= gnu/usr.bin/groff
913 _groff= gnu/usr.bin/groff/tmac
917 .if ${BOOTSTRAPPING} >= 700044 && ${BOOTSTRAPPING} < 800022
921 .if ${BOOTSTRAPPING} < 800013
922 _mklocale= usr.bin/mklocale
925 .if ${BOOTSTRAPPING} < 700018
926 _gensnmptree= usr.sbin/bsnmpd/gensnmptree
929 .if ${MK_RESCUE} != "no" && \
930 ${BOOTSTRAPPING} < 700026
931 _crunchgen= usr.sbin/crunch/crunchgen
934 .if ${MK_CDDL} != "no"
935 _dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \
936 lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge
954 ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
955 cd ${.CURDIR}/${_tool}; \
956 ${MAKE} DIRPRFX=${_tool}/ obj; \
957 ${MAKE} DIRPRFX=${_tool}/ depend; \
958 ${MAKE} DIRPRFX=${_tool}/ all; \
959 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install
963 # build-tools: Build special purpose build tools
965 .if defined(MODULES_WITH_WORLD) && exists(${KERNSRCDIR}/modules)
966 _aicasm= sys/modules/aic7xxx/aicasm
969 .if !defined(NO_SHARE)
970 _share= share/syscons/scrnmaps
973 .if ${MK_KERBEROS} != "no"
974 _kerberos5_tools= kerberos5/tools
977 .if ${MK_RESCUE} != "no"
978 _rescue= rescue/rescue
986 lib/ncurses/ncurses \
987 lib/ncurses/ncursesw \
993 ${_+_}@${ECHODIR} "===> ${_tool} (obj,build-tools)"; \
994 cd ${.CURDIR}/${_tool}; \
995 ${MAKE} DIRPRFX=${_tool}/ obj; \
996 ${MAKE} DIRPRFX=${_tool}/ build-tools
999 gnu/usr.bin/cc/cc_tools \
1001 ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all)"; \
1002 cd ${.CURDIR}/${_tool}; \
1003 ${MAKE} DIRPRFX=${_tool}/ obj; \
1004 ${MAKE} DIRPRFX=${_tool}/ depend; \
1005 ${MAKE} DIRPRFX=${_tool}/ all
1009 # cross-tools: Build cross-building tools
1011 .if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${BOOTSTRAPPING} < 800035
1012 .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386"
1013 _btxld= usr.sbin/btxld
1016 .if ${TARGET_ARCH} != ${MACHINE_ARCH}
1017 .if ${MK_RESCUE} != "no" || defined(RELEASEDIR)
1018 _crunchide= usr.sbin/crunch/crunchide
1020 .if ${TARGET_ARCH} == "i386" && defined(RELEASEDIR)
1021 _kgzip= usr.sbin/kgzip
1027 gnu/usr.bin/binutils \
1030 usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \
1034 ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
1035 cd ${.CURDIR}/${_tool}; \
1036 ${MAKE} DIRPRFX=${_tool}/ obj; \
1037 ${MAKE} DIRPRFX=${_tool}/ depend; \
1038 ${MAKE} DIRPRFX=${_tool}/ all; \
1039 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
1043 # hierarchy - ensure that all the needed directories are present
1046 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs
1049 # libraries - build all libraries, and install them under ${DESTDIR}.
1051 # The list of libraries with dependents (${_prebuild_libs}) and their
1052 # interdependencies (__L) are built automatically by the
1053 # ${.CURDIR}/tools/make_libdeps.sh script.
1057 ${MAKE} -f Makefile.inc1 _prereq_libs; \
1058 ${MAKE} -f Makefile.inc1 _startup_libs; \
1059 ${MAKE} -f Makefile.inc1 _prebuild_libs; \
1060 ${MAKE} -f Makefile.inc1 _generic_libs;
1063 # static libgcc.a prerequisite for shared libc
1065 _prereq_libs= gnu/lib/libgcc
1067 # These dependencies are not automatically generated:
1069 # gnu/lib/csu, gnu/lib/libgcc, lib/csu and lib/libc must be built before
1070 # all shared libraries for ELF.
1072 _startup_libs= gnu/lib/csu
1073 .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf)
1074 _startup_libs+= lib/csu/${MACHINE_ARCH}-elf
1076 _startup_libs+= lib/csu/${MACHINE_ARCH}
1078 _startup_libs+= gnu/lib/libgcc
1079 _startup_libs+= lib/libc
1081 gnu/lib/libgcc__L: lib/libc__L
1083 _prebuild_libs= ${_kerberos5_lib_libasn1} ${_kerberos5_lib_libkrb5} \
1084 ${_kerberos5_lib_libhx509} ${_kerberos5_lib_libroken} \
1085 ${_kerberos5_lib_libheimntlm} ${_kerberos5_lib_libgssapi_krb5} \
1086 lib/libbz2 lib/libcom_err lib/libcrypt lib/libelf \
1088 ${_lib_cddl} ${_lib_libgssapi} ${_lib_libipx} \
1089 lib/libkiconv lib/libkvm lib/libmd \
1090 lib/ncurses/ncurses lib/ncurses/ncursesw \
1091 lib/libopie lib/libpam ${_lib_libthr} \
1092 lib/libradius lib/libsbuf lib/libtacplus lib/libutil \
1093 ${_lib_libypclnt} lib/libz lib/msun \
1094 ${_secure_lib_libcrypto} ${_secure_lib_libssh} \
1095 ${_secure_lib_libssl} lib/libdwarf lib/libproc
1097 .if ${MK_LIBTHR} != "no"
1098 _lib_libthr= lib/libthr
1101 _generic_libs= ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} usr.bin/lex/lib
1103 lib/libopie__L lib/libtacplus__L: lib/libmd__L
1105 .if ${MK_CDDL} != "no"
1109 .if ${MK_CRYPT} != "no"
1110 .if ${MK_OPENSSL} != "no"
1111 _secure_lib_libcrypto= secure/lib/libcrypto
1112 _secure_lib_libssl= secure/lib/libssl
1113 lib/libradius__L secure/lib/libssl__L: secure/lib/libcrypto__L
1114 .if ${MK_OPENSSH} != "no"
1115 _secure_lib_libssh= secure/lib/libssh
1116 secure/lib/libssh__L: lib/libz__L secure/lib/libcrypto__L lib/libcrypt__L
1117 .if ${MK_KERBEROS} != "no"
1118 kerberos5/lib/libgssapi_krb5__L: kerberos5/lib/libkrb5__L \
1119 kerberos5/lib/libhx509__L kerberos5/lib/libasn1__L lib/libcom_err__L \
1120 lib/libmd__L kerberos5/lib/libroken__L secure/lib/libcrypto__L \
1122 secure/lib/libssh__L: lib/libgssapi__L kerberos5/lib/libgssapi_krb5__L
1126 _secure_lib= secure/lib
1129 .if ${MK_IPX} != "no"
1130 _lib_libipx= lib/libipx
1133 .if ${MK_KERBEROS} != "no"
1134 _kerberos5_lib= kerberos5/lib
1135 _kerberos5_lib_libasn1= kerberos5/lib/libasn1
1136 _kerberos5_lib_libkrb5= kerberos5/lib/libkrb5
1137 _kerberos5_lib_libhx509= kerberos5/lib/libhx509
1138 _kerberos5_lib_libroken= kerberos5/lib/libroken
1139 _kerberos5_lib_libheimntlm= kerberos5/lib/libheimntlm
1140 _kerberos5_lib_libgssapi_krb5= kerberos5/lib/libgssapi_krb5
1141 _lib_libgssapi= lib/libgssapi
1144 .if ${MK_NIS} != "no"
1145 _lib_libypclnt= lib/libypclnt
1148 .if ${MK_OPENSSL} == "no"
1149 lib/libradius__L: lib/libmd__L
1152 .for _lib in ${_prereq_libs}
1154 .if exists(${.CURDIR}/${_lib})
1155 ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \
1156 cd ${.CURDIR}/${_lib}; \
1157 ${MAKE} DIRPRFX=${_lib}/ obj; \
1158 ${MAKE} DIRPRFX=${_lib}/ depend; \
1159 ${MAKE} -DWITHOUT_PROFILE -DNO_PIC DIRPRFX=${_lib}/ all; \
1160 ${MAKE} -DWITHOUT_PROFILE -DNO_PIC DIRPRFX=${_lib}/ install
1164 .for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs}
1166 .if exists(${.CURDIR}/${_lib})
1167 ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \
1168 cd ${.CURDIR}/${_lib}; \
1169 ${MAKE} DIRPRFX=${_lib}/ obj; \
1170 ${MAKE} DIRPRFX=${_lib}/ depend; \
1171 ${MAKE} DIRPRFX=${_lib}/ all; \
1172 ${MAKE} DIRPRFX=${_lib}/ install
1176 # libpam is special: we need to build static PAM modules before
1177 # static PAM library, and dynamic PAM library before dynamic PAM
1179 lib/libpam__L: .PHONY
1180 ${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \
1181 cd ${.CURDIR}/lib/libpam; \
1182 ${MAKE} DIRPRFX=lib/libpam/ obj; \
1183 ${MAKE} DIRPRFX=lib/libpam/ depend; \
1184 ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET all; \
1185 ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET install
1187 _prereq_libs: ${_prereq_libs:S/$/__PL/}
1188 _startup_libs: ${_startup_libs:S/$/__L/}
1189 _prebuild_libs: ${_prebuild_libs:S/$/__L/}
1190 _generic_libs: ${_generic_libs:S/$/__L/}
1192 .for __target in all clean cleandepend cleandir depend includes obj
1193 .for entry in ${SUBDIR}
1194 ${entry}.${__target}__D: .PHONY
1195 ${_+_}@if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
1196 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH} (${__target})"; \
1197 edir=${entry}.${MACHINE_ARCH}; \
1198 cd ${.CURDIR}/$${edir}; \
1200 ${ECHODIR} "===> ${DIRPRFX}${entry} (${__target})"; \
1202 cd ${.CURDIR}/$${edir}; \
1204 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
1206 par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
1209 .include <bsd.subdir.mk>
1211 .if make(check-old) || make(check-old-dirs) || \
1212 make(check-old-files) || make(check-old-libs) || \
1213 make(delete-old) || make(delete-old-dirs) || \
1214 make(delete-old-files) || make(delete-old-libs)
1217 # check for / delete old files section
1220 .include "ObsoleteFiles.inc"
1222 OLD_LIBS_MESSAGE="Please be sure no application still uses those libraries, \
1223 else you can not start such an application. Consult UPDATING for more \
1224 information regarding how to cope with the removal/revision bump of a \
1227 .if !defined(BATCH_DELETE_OLD_FILES)
1234 @echo ">>> Removing old files (only deletes safe to delete libs)"
1235 # Ask for every old file if the user really wants to remove it.
1236 # It's annoying, but better safe than sorry.
1237 @for file in ${OLD_FILES}; do \
1238 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
1239 chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \
1240 rm ${RM_I} "${DESTDIR}/$${file}"; \
1243 # Remove catpages without corresponding manpages.
1245 find ${DESTDIR}/usr/share/man/cat* ! -type d | \
1246 sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \
1247 while read catpage; do \
1249 if [ ! -e "$${manpage}" ]; then \
1250 rm ${RM_I} $${catpage} <&3 ; \
1253 @echo ">>> Old files removed"
1256 @echo ">>> Checking for old files"
1257 @for file in ${OLD_FILES}; do \
1258 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
1259 echo "${DESTDIR}/$${file}"; \
1262 # Check for catpages without corresponding manpages.
1263 @find ${DESTDIR}/usr/share/man/cat* ! -type d | \
1264 sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \
1265 while read catpage; do \
1267 if [ ! -e "$${manpage}" ]; then \
1268 echo $${catpage} ; \
1273 @echo ">>> Removing old libraries"
1274 @echo "${OLD_LIBS_MESSAGE}" | fmt
1275 @for file in ${OLD_LIBS}; do \
1276 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
1277 chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \
1278 rm ${RM_I} "${DESTDIR}/$${file}"; \
1281 @echo ">>> Old libraries removed"
1284 @echo ">>> Checking for old libraries"
1285 @for file in ${OLD_LIBS}; do \
1286 if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
1287 echo "${DESTDIR}/$${file}"; \
1292 @echo ">>> Removing old directories"
1293 @for dir in ${OLD_DIRS}; do \
1294 if [ -d "${DESTDIR}/$${dir}" ]; then \
1295 rmdir -v "${DESTDIR}/$${dir}" || true; \
1296 elif [ -L "${DESTDIR}/$${dir}" ]; then \
1297 echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \
1300 @echo ">>> Old directories removed"
1303 @echo ">>> Checking for old directories"
1304 @for dir in ${OLD_DIRS}; do \
1305 if [ -d "${DESTDIR}/$${dir}" ]; then \
1306 echo "${DESTDIR}/$${dir}"; \
1307 elif [ -L "${DESTDIR}/$${dir}" ]; then \
1308 echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \
1312 delete-old: delete-old-files delete-old-dirs
1313 @echo "To remove old libraries run '${MAKE} delete-old-libs'."
1315 check-old: check-old-files check-old-libs check-old-dirs
1316 @echo "To remove old files and directories run '${MAKE} delete-old'."
1317 @echo "To remove old libraries run '${MAKE} delete-old-libs'."
1322 # showconfig - show build configuration.
1325 @${MAKE} -n -f bsd.own.mk -V dummy -dg1 | grep ^MK_ | sort