1# 2# $FreeBSD$ 3# 4# Make command line options: 5# -DNO_DYNAMICROOT do not link /bin and /sbin dynamically 6# -DNO_KERBEROS Do not build Heimdal (Kerberos 5) 7# -DNO_RESCUE do not build rescue binaries 8# -DNO_CLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir 9# -DNO_CLEAN do not clean at all 10# -DNO_CRYPT will prevent building of crypt versions 11# -DNO_MAN do not build the manual pages 12# -DNO_NLS do not build Native Language Support files 13# -DNO_PROFILE do not build profiled libraries 14# -DNO_GAMES do not go into games subdir 15# -DNO_SHARE do not go into share subdir 16# -DNO_INFO do not make or install info files 17# -DNO_LIBC_R do not build libc_r. 18# -DNO_FORTRAN do not build g77 and related libraries. 19# -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel 20# -DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel 21# -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel 22# -DNO_PORTSUPDATE do not update ports in ${MAKE} update 23# -DNO_DOCUPDATE do not update doc in ${MAKE} update 24# LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list 25# TARGET_ARCH="arch" to crossbuild world to a different arch 26 27# 28# The intended user-driven targets are: 29# buildworld - rebuild *everything*, including glue to help do upgrades 30# installworld- install everything built by "buildworld" 31# update - convenient way to update your source tree (eg: cvsup/cvs) 32# 33# Standard targets (not defined here) are documented in the makefiles in 34# /usr/share/mk. These include: 35# obj depend all install clean cleandepend cleanobj 36 37# We must do share/info early so that installation of info `dir' 38# entries works correctly. Do it first since it is less likely to 39# grow dependencies on include and lib than vice versa. 40# 41# We must do lib and libexec before bin, because if installworld 42# installs a new /bin/sh, the 'make' command will *immediately* 43# use that new version. And the new (dynamically-linked) /bin/sh 44# will expect to find appropriate libraries in /lib and /libexec. 45# 46# We must do etc last for install/distribute to work. 47# 48SUBDIR= share/info include lib libexec bin 49.if !defined(NO_GAMES) 50SUBDIR+=games 51.endif 52SUBDIR+=gnu 53.if !defined(NO_KERBEROS) && !defined(NO_CRYPT) && !defined(NO_OPENSSL) 54SUBDIR+=kerberos5 55.endif 56.if !defined(NO_RESCUE) 57SUBDIR+=rescue 58.endif 59SUBDIR+=sbin 60.if !defined(NO_CRYPT) 61SUBDIR+=secure 62.endif 63.if !defined(NO_SHARE) 64SUBDIR+=share 65.endif 66SUBDIR+=sys usr.bin usr.sbin etc 67 68# These are last, since it is nice to at least get the base system 69# rebuilt before you do them. 70.for _DIR in ${LOCAL_DIRS} 71.if exists(${.CURDIR}/${_DIR}/Makefile) 72SUBDIR+= ${_DIR} 73.endif 74.endfor 75 76.if defined(SUBDIR_OVERRIDE) 77SUBDIR= ${SUBDIR_OVERRIDE} 78.endif 79 80.if defined(NOCLEAN) 81NO_CLEAN= ${NOCLEAN} 82.endif 83.if defined(NO_CLEANDIR) 84CLEANDIR= clean cleandepend 85.else 86CLEANDIR= cleandir 87.endif 88 89CVS?= cvs 90CVSFLAGS?= -A -P -d -I! 91SUP?= /usr/local/bin/cvsup 92SUPFLAGS?= -g -L 2 -P - 93.if defined(SUPHOST) 94SUPFLAGS+= -h ${SUPHOST} 95.endif 96 97MAKEOBJDIRPREFIX?= /usr/obj 98.if !defined(OSRELDATE) 99.if exists(/usr/include/osreldate.h) 100OSRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ 101 /usr/include/osreldate.h 102.else 103OSRELDATE= 0 104.endif 105.endif 106TARGET_ARCH?= ${MACHINE_ARCH} 107.if ${TARGET_ARCH} == ${MACHINE_ARCH} 108TARGET?= ${MACHINE} 109TARGET_CPUTYPE?=${CPUTYPE} 110.else 111TARGET?= ${TARGET_ARCH} 112TARGET_CPUTYPE?= 113.endif 114.if !empty(TARGET_CPUTYPE) 115_TARGET_CPUTYPE=${TARGET_CPUTYPE} 116.else 117_TARGET_CPUTYPE=dummy 118.endif 119_CPUTYPE!= MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAKE} \ 120 -f /dev/null -m ${.CURDIR}/share/mk -V CPUTYPE 121.if ${_CPUTYPE} != ${_TARGET_CPUTYPE} 122.error CPUTYPE global should be set with ?=. 123.endif 124.if make(buildworld) 125BUILD_ARCH!= uname -p 126.if ${MACHINE_ARCH} != ${BUILD_ARCH} 127.error To cross-build, set TARGET_ARCH. 128.endif 129.endif 130.if ${MACHINE} == ${TARGET} && !defined(CROSS_BUILD_TESTING) 131OBJTREE= ${MAKEOBJDIRPREFIX} 132.else 133OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET} 134.endif 135WORLDTMP= ${OBJTREE}${.CURDIR}/tmp 136# /usr/games added for fortune which depend on strfile 137BPATH= ${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/usr/games 138XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games 139STRICTTMPPATH= ${BPATH}:${XPATH} 140TMPPATH= ${STRICTTMPPATH}:${PATH} 141 142INSTALLTMP!= /usr/bin/mktemp -d -u -t install 143 144# 145# Building a world goes through the following stages 146# 147# 1. legacy stage [BMAKE] 148# This stage is responsible for creating compatibility 149# shims that are needed by the bootstrap-tools, 150# build-tools and cross-tools stages. 151# 1. bootstrap-tools stage [BMAKE] 152# This stage is responsible for creating programs that 153# are needed for backward compatibility reasons. They 154# are not built as cross-tools. 155# 2. build-tools stage [TMAKE] 156# This stage is responsible for creating the object 157# tree and building any tools that are needed during 158# the build process. 159# 3. cross-tools stage [XMAKE] 160# This stage is responsible for creating any tools that 161# are needed for cross-builds. A cross-compiler is one 162# of them. 163# 4. world stage [WMAKE] 164# This stage actually builds the world. 165# 5. install stage (optional) [IMAKE] 166# This stage installs a previously built world. 167# 168 169BOOTSTRAPPING?= 0 170 171# Common environment for world related stages 172CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \ 173 MACHINE_ARCH=${TARGET_ARCH} \ 174 MACHINE=${TARGET} \ 175 CPUTYPE=${TARGET_CPUTYPE} \ 176 GROFF_BIN_PATH=${WORLDTMP}/legacy/usr/bin \ 177 GROFF_FONT_PATH=${WORLDTMP}/legacy/usr/share/groff_font \ 178 GROFF_TMAC_PATH=${WORLDTMP}/legacy/usr/share/tmac 179 180# bootstrap-tools stage 181BMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \ 182 PATH=${BPATH}:${PATH} \ 183 WORLDTMP=${WORLDTMP} \ 184 MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" 185BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \ 186 ${BMAKEENV} ${MAKE} -f Makefile.inc1 \ 187 DESTDIR= \ 188 BOOTSTRAPPING=${OSRELDATE} \ 189 -DNO_HTML -DNO_INFO -DNO_LINT -DNO_MAN -DNO_NLS -DNO_PIC \ 190 -DNO_PROFILE -DNO_SHARED -DNO_CPU_CFLAGS -DNO_WARNS 191 192# build-tools stage 193TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ 194 ${BMAKEENV} ${MAKE} -f Makefile.inc1 \ 195 DESTDIR= \ 196 BOOTSTRAPPING=${OSRELDATE} -DNO_LINT -DNO_CPU_CFLAGS -DNO_WARNS 197 198# cross-tools stage 199XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} -DNO_FORTRAN -DNO_GDB 200 201# world stage 202WMAKEENV= ${CROSSENV} \ 203 _SHLIBDIRPREFIX=${WORLDTMP} \ 204 INSTALL="sh ${.CURDIR}/tools/install.sh" \ 205 PATH=${TMPPATH} 206WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1 DESTDIR=${WORLDTMP} 207 208.if ${TARGET_ARCH} == "amd64" 209# 32 bit world 210LIB32TMP= ${OBJTREE}${.CURDIR}/lib32 211 212.if empty(TARGET_CPUTYPE) 213LIB32CPUTYPE= k8 214.else 215LIB32CPUTYPE= ${TARGET_CPUTYPE} 216.endif 217LIB32PREFLAGS= -m32 -march=${LIB32CPUTYPE} -mfancy-math-387 -DCOMPAT_32BIT 218LIB32POSTFLAGS= -I${LIB32TMP}/usr/include \ 219 -L${LIB32TMP}/usr/lib32 \ 220 -B${LIB32TMP}/usr/lib32 221LIB32CC= ${LIB32PREFLAGS} \ 222 ${LIB32POSTFLAGS} 223LIB32CXX= ${LIB32PREFLAGS} -I${LIB32TMP}/usr/include/c++/3.4 \ 224 ${LIB32POSTFLAGS} 225LIB32OBJC= ${LIB32PREFLAGS} -I${LIB32TMP}/usr/include/objc \ 226 ${LIB32POSTFLAGS} 227 228# Yes, the flags are redundant. 229LIB32MAKEENV= MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \ 230 _SHLIBDIRPREFIX=${LIB32TMP} \ 231 MACHINE=i386 \ 232 MACHINE_ARCH=i386 \ 233 INSTALL="sh ${.CURDIR}/tools/install.sh" \ 234 PATH=${TMPPATH} \ 235 CC="${CC} ${LIB32CC}" \ 236 CXX="${CXX} ${LIB32CXX}" \ 237 OBJC="${OBJC} ${LIB32OBJC}" \ 238 LD="${LD} -m elf_i386_fbsd -Y P,${LIB32TMP}/usr/lib32" \ 239 AS="${AS} --32" \ 240 LIBDIR=/usr/lib32 \ 241 SHLIBDIR=/usr/lib32 242 243LIB32MAKE= ${LIB32MAKEENV} ${MAKE} -DNO_CPU_CFLAGS -DCOMPAT_32BIT \ 244 -DNO_BIND -DNO_MAN -DNO_NLS -DNO_INFO -DNO_HTML 245LIB32IMAKE= ${LIB32MAKE:NINSTALL=*} -DNO_INCS 246.endif 247 248# install stage 249.if empty(.MAKEFLAGS:M-n) 250IMAKEENV= ${CROSSENV} \ 251 PATH=${STRICTTMPPATH}:${INSTALLTMP} 252.else 253IMAKEENV= ${CROSSENV} \ 254 PATH=${TMPPATH}:${INSTALLTMP} 255.endif 256IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 257 258# kernel stage 259KMAKEENV= ${WMAKEENV} 260KMAKE= ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} 261 262# 263# buildworld 264# 265# Attempt to rebuild the entire system, with reasonable chance of 266# success, regardless of how old your existing system is. 267# 268_worldtmp: 269.if ${.CURDIR:C/[^,]//g} != "" 270# The m4 build of sendmail files doesn't like it if ',' is used 271# anywhere in the path of it's files. 272 @echo 273 @echo "*** Error: path to source tree contains a comma ','" 274 @echo 275 false 276.endif 277 @echo 278 @echo "--------------------------------------------------------------" 279 @echo ">>> Rebuilding the temporary build tree" 280 @echo "--------------------------------------------------------------" 281.if !defined(NO_CLEAN) 282 rm -rf ${WORLDTMP} 283.if ${TARGET_ARCH} == "amd64" 284 rm -rf ${LIB32TMP} 285.endif 286.else 287 rm -rf ${WORLDTMP}/legacy/usr/include 288# XXX - These two can depend on any header file. 289 rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c 290 rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c 291.endif 292.for _dir in \ 293 usr/bin usr/games usr/include/c++/3.4 usr/include/sys usr/lib \ 294 usr/libexec usr/sbin usr/share/dict \ 295 usr/share/groff_font/devX100 \ 296 usr/share/groff_font/devX100-12 \ 297 usr/share/groff_font/devX75 \ 298 usr/share/groff_font/devX75-12 \ 299 usr/share/groff_font/devascii \ 300 usr/share/groff_font/devcp1047 \ 301 usr/share/groff_font/devdvi \ 302 usr/share/groff_font/devhtml \ 303 usr/share/groff_font/devkoi8-r \ 304 usr/share/groff_font/devlatin1 \ 305 usr/share/groff_font/devlbp \ 306 usr/share/groff_font/devlj4 \ 307 usr/share/groff_font/devps \ 308 usr/share/groff_font/devutf8 \ 309 usr/share/tmac/mdoc usr/share/tmac/mm 310 mkdir -p ${WORLDTMP}/legacy/${_dir} 311.endfor 312.for _dir in \ 313 lib usr/bin usr/include usr/lib/compat/aout usr/libdata/ldscripts \ 314 usr/libexec usr/sbin usr/share/misc \ 315 usr/share/snmp/defs usr/share/snmp/mibs 316 mkdir -p ${WORLDTMP}/${_dir} 317.endfor 318 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ 319 -p ${WORLDTMP}/usr/include >/dev/null 320 ln -sf ${.CURDIR}/sys ${WORLDTMP} 321.if defined(WITH_BIND_LIBS) && !defined(NO_BIND) 322 mtree -deU -f ${.CURDIR}/etc/mtree/BIND.include.dist \ 323 -p ${WORLDTMP}/usr/include >/dev/null 324.endif 325_legacy: 326 @echo 327 @echo "--------------------------------------------------------------" 328 @echo ">>> stage 1.1: legacy release compatibility shims" 329 @echo "--------------------------------------------------------------" 330 ${_+_}cd ${.CURDIR}; ${BMAKE} legacy 331_bootstrap-tools: 332 @echo 333 @echo "--------------------------------------------------------------" 334 @echo ">>> stage 1.2: bootstrap tools" 335 @echo "--------------------------------------------------------------" 336 ${_+_}cd ${.CURDIR}; ${BMAKE} bootstrap-tools 337_cleanobj: 338.if !defined(NO_CLEAN) 339 @echo 340 @echo "--------------------------------------------------------------" 341 @echo ">>> stage 2.1: cleaning up the object tree" 342 @echo "--------------------------------------------------------------" 343 ${_+_}cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/} 344.if ${TARGET_ARCH} == "amd64" 345 rm -rf ${OBJTREE}/lib32 346.endif 347.endif 348_obj: 349 @echo 350 @echo "--------------------------------------------------------------" 351 @echo ">>> stage 2.2: rebuilding the object tree" 352 @echo "--------------------------------------------------------------" 353 ${_+_}cd ${.CURDIR}; ${WMAKE} par-obj 354_build-tools: 355 @echo 356 @echo "--------------------------------------------------------------" 357 @echo ">>> stage 2.3: build tools" 358 @echo "--------------------------------------------------------------" 359 ${_+_}cd ${.CURDIR}; ${TMAKE} build-tools 360_cross-tools: 361 @echo 362 @echo "--------------------------------------------------------------" 363 @echo ">>> stage 3: cross tools" 364 @echo "--------------------------------------------------------------" 365 ${_+_}cd ${.CURDIR}; ${XMAKE} cross-tools 366_includes: 367 @echo 368 @echo "--------------------------------------------------------------" 369 @echo ">>> stage 4.1: building includes" 370 @echo "--------------------------------------------------------------" 371 ${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes 372_libraries: 373 @echo 374 @echo "--------------------------------------------------------------" 375 @echo ">>> stage 4.2: building libraries" 376 @echo "--------------------------------------------------------------" 377 ${_+_}cd ${.CURDIR}; \ 378 ${WMAKE} -DNO_FSCHG -DNO_HTML -DNO_INFO -DNO_LINT -DNO_MAN \ 379 -DNO_NLS -DNO_PROFILE libraries 380_depend: 381 @echo 382 @echo "--------------------------------------------------------------" 383 @echo ">>> stage 4.3: make dependencies" 384 @echo "--------------------------------------------------------------" 385 ${_+_}cd ${.CURDIR}; ${WMAKE} par-depend 386everything: 387 @echo 388 @echo "--------------------------------------------------------------" 389 @echo ">>> stage 4.4: building everything" 390 @echo "--------------------------------------------------------------" 391 ${_+_}cd ${.CURDIR}; ${WMAKE} par-all 392.if ${TARGET_ARCH} == "amd64" 393build32: 394 @echo 395 @echo "--------------------------------------------------------------" 396 @echo ">>> stage 5.1: building 32 bit shim libraries" 397 @echo "--------------------------------------------------------------" 398.for _dir in \ 399 lib lib32 usr/bin usr/include usr/lib32 usr/libdata/ldscripts \ 400 usr/libexec usr/sbin usr/share/misc \ 401 usr/share/snmp/defs usr/share/snmp/mibs 402 mkdir -p ${LIB32TMP}/${_dir} 403.endfor 404 mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ 405 -p ${LIB32TMP}/usr/include >/dev/null 406 mkdir -p ${WORLDTMP} 407 ln -sf ${.CURDIR}/sys ${WORLDTMP} 408.if !defined(NO_KERBEROS) && !defined(NO_CRYPT) && !defined(NO_OPENSSL) 409.for _t in obj depend all 410 cd ${.CURDIR}/kerberos5/tools; \ 411 MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} DESTDIR= ${_t} 412.endfor 413.endif 414.for _t in obj includes 415 cd ${.CURDIR}/include; \ 416 ${LIB32MAKE} DESTDIR=${LIB32TMP} ${_t} 417 cd ${.CURDIR}/lib; \ 418 ${LIB32MAKE} DESTDIR=${LIB32TMP} ${_t} 419 cd ${.CURDIR}/gnu/lib; \ 420 ${LIB32MAKE} DESTDIR=${LIB32TMP} ${_t} 421.if !defined(NO_CRYPT) 422 cd ${.CURDIR}/secure/lib; \ 423 ${LIB32MAKE} DESTDIR=${LIB32TMP} ${_t} 424.endif 425.if !defined(NO_KERBEROS) && !defined(NO_CRYPT) && !defined(NO_OPENSSL) 426 cd ${.CURDIR}/kerberos5/lib; \ 427 ${LIB32MAKE} DESTDIR=${LIB32TMP} ${_t} 428.endif 429.endfor 430.for _dir in usr.sbin/pcvt/keycap usr.bin/lex/lib 431 cd ${.CURDIR}/${_dir}; \ 432 ${LIB32MAKE} DESTDIR=${LIB32TMP} obj 433.endfor 434.for _dir in lib/libncurses lib/libmagic 435 cd ${.CURDIR}/${_dir}; \ 436 MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} DESTDIR= build-tools 437.endfor 438 cd ${.CURDIR}; \ 439 ${LIB32MAKE} -f Makefile.inc1 DESTDIR=${LIB32TMP} libraries 440.for _t in obj depend all 441 cd ${.CURDIR}/libexec/rtld-elf; \ 442 PROG=ld-elf32.so.1 ${LIB32MAKE} DESTDIR=${LIB32TMP} ${_t} 443.endfor 444 445distribute32 install32: 446.if make(distribute32) 447 mkdir -p ${DISTDIR}/${DISTRIBUTION}/usr/lib32 # XXX add to mtree 448.else 449 mkdir -p ${DESTDIR}/usr/lib32 # XXX add to mtree 450.endif 451 cd ${.CURDIR}/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} 452 cd ${.CURDIR}/gnu/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} 453.if !defined(NO_CRYPT) 454 cd ${.CURDIR}/secure/lib; ${LIB32IMAKE} ${.TARGET:S/32$//} 455.endif 456 cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32IMAKE} ${.TARGET:S/32$//} 457.endif 458 459 460WMAKE_TGTS= 461.if !defined(SUBDIR_OVERRIDE) 462WMAKE_TGTS+= _worldtmp _legacy _bootstrap-tools 463.endif 464WMAKE_TGTS+= _cleanobj _obj _build-tools 465.if !defined(SUBDIR_OVERRIDE) 466WMAKE_TGTS+= _cross-tools 467.endif 468WMAKE_TGTS+= _includes _libraries _depend everything 469.if ${TARGET_ARCH} == "amd64" && !defined(NO_LIB32) 470WMAKE_TGTS+= build32 471.endif 472 473buildworld: ${WMAKE_TGTS} 474.ORDER: ${WMAKE_TGTS} 475 476buildenv: 477 @echo Entering world for ${TARGET_ARCH}:${TARGET} 478 @cd ${.CURDIR} && env ${WMAKEENV} sh || true 479 480TOOLCHAIN_TGTS= ${WMAKE_TGTS:N_depend:Neverything:Nbuild32} 481toolchain: ${TOOLCHAIN_TGTS} 482kernel-toolchain: ${TOOLCHAIN_TGTS:N_includes:N_libraries} 483 484# 485# installcheck 486# 487# Checks to be sure system is ready for installworld/installkernel. 488# 489installcheck: 490 491# 492# Require DESTDIR to be set if installing for a different architecture. 493# 494.if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${TARGET} != ${MACHINE} 495.if !make(distributeworld) 496installcheck: installcheck_DESTDIR 497installcheck_DESTDIR: 498.if !defined(DESTDIR) || empty(DESTDIR) 499 @echo "ERROR: Please set DESTDIR!"; \ 500 false 501.endif 502.endif 503.endif 504 505# 506# Check for missing UIDs/GIDs. 507# 508CHECK_UIDS= 509CHECK_GIDS= 510.if !defined(NO_SENDMAIL) 511CHECK_UIDS+= smmsp 512CHECK_GIDS+= smmsp 513.endif 514.if !defined(NO_PF) 515CHECK_UIDS+= proxy 516CHECK_GIDS+= proxy authpf 517.endif 518installcheck: installcheck_UGID 519installcheck_UGID: 520.for uid in ${CHECK_UIDS} 521 @if ! `id -u ${uid} >/dev/null 2>&1`; then \ 522 echo "ERROR: Required ${uid} user is missing, see /usr/src/UPDATING."; \ 523 false; \ 524 fi 525.endfor 526.for gid in ${CHECK_GIDS} 527 @if ! `find / -prune -group ${gid} >/dev/null 2>&1`; then \ 528 echo "ERROR: Required ${gid} group is missing, see /usr/src/UPDATING."; \ 529 false; \ 530 fi 531.endfor 532 533# 534# distributeworld 535# 536# Distributes everything compiled by a `buildworld'. 537# 538# installworld 539# 540# Installs everything compiled by a 'buildworld'. 541# 542distributeworld installworld: installcheck 543 mkdir -p ${INSTALLTMP} 544 for prog in [ awk cap_mkdb cat chflags chmod chown \ 545 date echo egrep find grep install-info \ 546 ln lockf make mkdir mtree mv pwd_mkdb rm sed sh sysctl \ 547 test true uname wc zic; do \ 548 cp `which $$prog` ${INSTALLTMP}; \ 549 done 550 ${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//} 551 rm -rf ${INSTALLTMP} 552 553# 554# reinstall 555# 556# If you have a build server, you can NFS mount the source and obj directories 557# and do a 'make reinstall' on the *client* to install new binaries from the 558# most recent server build. 559# 560reinstall: 561 @echo "--------------------------------------------------------------" 562 @echo ">>> Making hierarchy" 563 @echo "--------------------------------------------------------------" 564 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy 565 @echo 566 @echo "--------------------------------------------------------------" 567 @echo ">>> Installing everything" 568 @echo "--------------------------------------------------------------" 569 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install 570.if ${TARGET_ARCH} == "amd64" && !defined(NO_LIB32) 571 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install32 572.endif 573 574redistribute: 575 @echo "--------------------------------------------------------------" 576 @echo ">>> Distributing everything" 577 @echo "--------------------------------------------------------------" 578 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute 579.if ${TARGET_ARCH} == "amd64" && !defined(NO_LIB32) 580 ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute32 DISTRIBUTION=lib32 581.endif 582 583distrib-dirs distribution: 584 cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} ${.TARGET} 585 586# 587# buildkernel and installkernel 588# 589# Which kernels to build and/or install is specified by setting 590# KERNCONF. If not defined a GENERIC kernel is built/installed. 591# Only the existing (depending TARGET) config files are used 592# for building kernels and only the first of these is designated 593# as the one being installed. 594# 595# Note that we have to use TARGET instead of TARGET_ARCH when 596# we're in kernel-land. Since only TARGET_ARCH is (expected) to 597# be set to cross-build, we have to make sure TARGET is set 598# properly. 599 600.if !defined(KERNCONF) && defined(KERNEL) 601KERNCONF= ${KERNEL} 602KERNWARN= 603.else 604KERNCONF?= GENERIC 605.endif 606INSTKERNNAME?= kernel 607 608KERNSRCDIR?= ${.CURDIR}/sys 609KRNLCONFDIR= ${KERNSRCDIR}/${TARGET}/conf 610KRNLOBJDIR= ${OBJTREE}${KERNSRCDIR} 611KERNCONFDIR?= ${KRNLCONFDIR} 612 613BUILDKERNELS= 614INSTALLKERNEL= 615.for _kernel in ${KERNCONF} 616.if exists(${KERNCONFDIR}/${_kernel}) 617BUILDKERNELS+= ${_kernel} 618.if empty(INSTALLKERNEL) 619INSTALLKERNEL= ${_kernel} 620.endif 621.endif 622.endfor 623 624# 625# buildkernel 626# 627# Builds all kernels defined by BUILDKERNELS. 628# 629buildkernel: 630.if empty(BUILDKERNELS) 631 @echo "ERROR: Missing kernel configuration file(s) (${KERNCONF})."; \ 632 false 633.endif 634.if defined(KERNWARN) 635 @echo "--------------------------------------------------------------" 636 @echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF=" 637 @echo "--------------------------------------------------------------" 638 @sleep 3 639.endif 640 @echo 641.for _kernel in ${BUILDKERNELS} 642 @echo "--------------------------------------------------------------" 643 @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`" 644 @echo "--------------------------------------------------------------" 645 @echo "===> ${_kernel}" 646 mkdir -p ${KRNLOBJDIR} 647.if !defined(NO_KERNELCONFIG) 648 @echo 649 @echo "--------------------------------------------------------------" 650 @echo ">>> stage 1: configuring the kernel" 651 @echo "--------------------------------------------------------------" 652 cd ${KRNLCONFDIR}; \ 653 PATH=${TMPPATH} \ 654 config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \ 655 ${KERNCONFDIR}/${_kernel} 656.endif 657.if !defined(NO_CLEAN) && !defined(NO_KERNELCLEAN) 658 @echo 659 @echo "--------------------------------------------------------------" 660 @echo ">>> stage 2.1: cleaning up the object tree" 661 @echo "--------------------------------------------------------------" 662 cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} ${CLEANDIR} 663.endif 664 @echo 665 @echo "--------------------------------------------------------------" 666 @echo ">>> stage 2.2: rebuilding the object tree" 667 @echo "--------------------------------------------------------------" 668 cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} obj 669 @echo 670 @echo "--------------------------------------------------------------" 671 @echo ">>> stage 2.3: build tools" 672 @echo "--------------------------------------------------------------" 673 cd ${KRNLOBJDIR}/${_kernel}; \ 674 MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \ 675 ${MAKE} -DNO_CPU_CFLAGS -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile 676# XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case. 677.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules) 678.for target in obj depend all 679 cd ${KERNSRCDIR}/modules/aic7xxx/aicasm; \ 680 MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \ 681 ${MAKE} -DNO_CPU_CFLAGS ${target} 682.endfor 683.endif 684.if !defined(NO_KERNELDEPEND) 685 @echo 686 @echo "--------------------------------------------------------------" 687 @echo ">>> stage 3.1: making dependencies" 688 @echo "--------------------------------------------------------------" 689 cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} depend -DNO_MODULES_OBJ 690.endif 691 @echo 692 @echo "--------------------------------------------------------------" 693 @echo ">>> stage 3.2: building everything" 694 @echo "--------------------------------------------------------------" 695 cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ 696 @echo "--------------------------------------------------------------" 697 @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`" 698 @echo "--------------------------------------------------------------" 699.endfor 700 701# 702# installkernel, etc. 703# 704# Install the kernel defined by INSTALLKERNEL 705# 706installkernel installkernel.debug \ 707reinstallkernel reinstallkernel.debug: installcheck 708.if empty(INSTALLKERNEL) 709 @echo "ERROR: No kernel \"${KERNCONF}\" to install."; \ 710 false 711.endif 712 @echo "--------------------------------------------------------------" 713 @echo ">>> Installing kernel" 714 @echo "--------------------------------------------------------------" 715 cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ 716 ${CROSSENV} PATH=${TMPPATH} \ 717 ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//} 718 719# 720# update 721# 722# Update the source tree, by running cvsup and/or running cvs to update to the 723# latest copy. 724# 725update: 726.if defined(SUP_UPDATE) 727 @echo "--------------------------------------------------------------" 728 @echo ">>> Running ${SUP}" 729 @echo "--------------------------------------------------------------" 730.if defined(SUPFILE) 731 @${SUP} ${SUPFLAGS} ${SUPFILE} 732.endif 733.if defined(SUPFILE1) 734 @${SUP} ${SUPFLAGS} ${SUPFILE1} 735.endif 736.if defined(SUPFILE2) 737 @${SUP} ${SUPFLAGS} ${SUPFILE2} 738.endif 739.if defined(PORTSSUPFILE) && !defined(NO_PORTSUPDATE) 740 @${SUP} ${SUPFLAGS} ${PORTSSUPFILE} 741.endif 742.if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE) 743 @${SUP} ${SUPFLAGS} ${DOCSUPFILE} 744.endif 745.endif 746.if defined(CVS_UPDATE) 747 @echo "--------------------------------------------------------------" 748 @echo ">>> Updating ${.CURDIR} from CVS repository" ${CVSROOT} 749 @echo "--------------------------------------------------------------" 750 cd ${.CURDIR}; ${CVS} -R -q update ${CVSFLAGS} 751.endif 752 753# 754# ------------------------------------------------------------------------ 755# 756# From here onwards are utility targets used by the 'make world' and 757# related targets. If your 'world' breaks, you may like to try to fix 758# the problem and manually run the following targets to attempt to 759# complete the build. Beware, this is *not* guaranteed to work, you 760# need to have a pretty good grip on the current state of the system 761# to attempt to manually finish it. If in doubt, 'make world' again. 762# 763 764# 765# legacy: Build compatibility shims for the next three targets 766# 767legacy: 768.if ${BOOTSTRAPPING} < 503000 769 @echo "ERROR: Source upgrades from versions prior to 5.3 not supported."; \ 770 false 771.endif 772.for _tool in tools/build 773 ${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,depend,all,install)"; \ 774 cd ${.CURDIR}/${_tool}; \ 775 ${MAKE} DIRPRFX=${_tool}/ obj; \ 776 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes; \ 777 ${MAKE} DIRPRFX=${_tool}/ depend; \ 778 ${MAKE} DIRPRFX=${_tool}/ all; \ 779 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install 780.endfor 781 782# 783# bootstrap-tools: Build tools needed for compatibility 784# 785.if !defined(NO_GAMES) 786_strfile= games/fortune/strfile 787.endif 788 789.if !defined(NO_CXX) 790_gperf= gnu/usr.bin/gperf 791.if ${BOOTSTRAPPING} < 700004 792_groff= gnu/usr.bin/groff 793.else 794_groff= gnu/usr.bin/groff/tmac 795.endif 796.endif 797 798.if ${BOOTSTRAPPING} < 600029 799_texinfo= gnu/usr.bin/texinfo 800.endif 801 802.if ${BOOTSTRAPPING} < 600015 803_cap_mkdb= usr.bin/cap_mkdb 804.endif 805 806.if ${BOOTSTRAPPING} < 600018 807_colldef= usr.bin/colldef 808.endif 809 810.if ${BOOTSTRAPPING} < 600017 811_gencat= usr.bin/gencat 812.endif 813 814.if ${BOOTSTRAPPING} < 600016 815_mklocale= usr.bin/mklocale 816.endif 817 818.if !defined(NO_RESCUE) && \ 819 ${BOOTSTRAPPING} < 600008 820_crunchgen= usr.sbin/crunch/crunchgen 821.endif 822 823.if ${BOOTSTRAPPING} < 600020 824_pwd_mkdb= usr.sbin/pwd_mkdb 825.endif 826 827bootstrap-tools: 828.for _tool in \ 829 ${_strfile} \ 830 ${_gperf} \ 831 ${_groff} \ 832 ${_texinfo} \ 833 ${_cap_mkdb} \ 834 ${_colldef} \ 835 ${_gencat} \ 836 usr.bin/lorder \ 837 usr.bin/makewhatis \ 838 ${_mklocale} \ 839 usr.bin/rpcgen \ 840 usr.bin/xinstall \ 841 usr.sbin/config \ 842 ${_crunchgen} \ 843 ${_pwd_mkdb} 844 ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ 845 cd ${.CURDIR}/${_tool}; \ 846 ${MAKE} DIRPRFX=${_tool}/ obj; \ 847 ${MAKE} DIRPRFX=${_tool}/ depend; \ 848 ${MAKE} DIRPRFX=${_tool}/ all; \ 849 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install 850.endfor 851 852# 853# build-tools: Build special purpose build tools 854# 855.if defined(MODULES_WITH_WORLD) && exists(${KERNSRCDIR}/modules) 856_aicasm= sys/modules/aic7xxx/aicasm 857.endif 858 859.if !defined(NO_SHARE) 860_share= share/syscons/scrnmaps 861.endif 862 863.if !defined(NO_KERBEROS) && !defined(NO_CRYPT) && !defined(NO_OPENSSL) 864_kerberos5_tools= kerberos5/tools 865.endif 866 867.if !defined(NO_RESCUE) 868_rescue= rescue/rescue 869.endif 870 871build-tools: 872.for _tool in \ 873 bin/csh \ 874 bin/sh \ 875 ${_rescue} \ 876 lib/libncurses \ 877 ${_share} \ 878 ${_aicasm} \ 879 usr.bin/awk \ 880 lib/libmagic \ 881 usr.sbin/sysinstall 882 ${_+_}@${ECHODIR} "===> ${_tool} (obj,build-tools)"; \ 883 cd ${.CURDIR}/${_tool}; \ 884 ${MAKE} DIRPRFX=${_tool}/ obj; \ 885 ${MAKE} DIRPRFX=${_tool}/ build-tools 886.endfor 887.for _tool in \ 888 gnu/usr.bin/cc/cc_tools \ 889 ${_kerberos5_tools} 890 ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all)"; \ 891 cd ${.CURDIR}/${_tool}; \ 892 ${MAKE} DIRPRFX=${_tool}/ obj; \ 893 ${MAKE} DIRPRFX=${_tool}/ depend; \ 894 ${MAKE} DIRPRFX=${_tool}/ all 895.endfor 896 897# 898# cross-tools: Build cross-building tools 899# 900.if ${TARGET_ARCH} != ${MACHINE_ARCH} 901.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" 902_btxld= usr.sbin/btxld 903.endif 904.if !defined(NO_RESCUE) || defined(RELEASEDIR) 905_crunchide= usr.sbin/crunch/crunchide 906.endif 907.if ${TARGET_ARCH} == "alpha" 908_elf2exe= usr.sbin/elf2exe 909.endif 910.if ${TARGET_ARCH} == "i386" && defined(RELEASEDIR) 911_kgzip= usr.sbin/kgzip 912.endif 913.endif 914 915cross-tools: 916.for _tool in \ 917 gnu/usr.bin/binutils \ 918 gnu/usr.bin/cc \ 919 usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \ 920 ${_btxld} \ 921 ${_crunchide} \ 922 ${_elf2exe} \ 923 ${_kgzip} 924 ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ 925 cd ${.CURDIR}/${_tool}; \ 926 ${MAKE} DIRPRFX=${_tool}/ obj; \ 927 ${MAKE} DIRPRFX=${_tool}/ depend; \ 928 ${MAKE} DIRPRFX=${_tool}/ all; \ 929 ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install 930.endfor 931 932# 933# hierarchy - ensure that all the needed directories are present 934# 935hierarchy: 936 cd ${.CURDIR}/etc; ${MAKE} distrib-dirs 937 938# 939# libraries - build all libraries, and install them under ${DESTDIR}. 940# 941# The list of libraries with dependents (${_prebuild_libs}) and their 942# interdependencies (__L) are built automatically by the 943# ${.CURDIR}/tools/make_libdeps.sh script. 944# 945libraries: 946 cd ${.CURDIR}; \ 947 ${MAKE} -f Makefile.inc1 _startup_libs; \ 948 ${MAKE} -f Makefile.inc1 _prebuild_libs; \ 949 ${MAKE} -f Makefile.inc1 _generic_libs; 950 951# These dependencies are not automatically generated: 952# 953# gnu/lib/csu, gnu/lib/libgcc and lib/csu must be built before all 954# shared libraries for ELF. 955# 956_startup_libs= gnu/lib/csu gnu/lib/libgcc 957.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf) 958_startup_libs+= lib/csu/${MACHINE_ARCH}-elf 959.else 960_startup_libs+= lib/csu/${MACHINE_ARCH} 961.endif 962 963_prebuild_libs= 964 965_generic_libs= gnu/lib 966 967.if !defined(NO_KERBEROS) && !defined(NO_CRYPT) && !defined(NO_OPENSSL) 968_prebuild_libs+= kerberos5/lib/libasn1 969_prebuild_libs+= kerberos5/lib/libgssapi 970_prebuild_libs+= kerberos5/lib/libkrb5 971_prebuild_libs+= kerberos5/lib/libroken 972_generic_libs+= kerberos5/lib 973.endif 974 975_prebuild_libs+= lib/libbz2 lib/libcom_err lib/libcrypt lib/libexpat \ 976 lib/libipx lib/libkiconv lib/libkvm lib/libmd \ 977 lib/libncurses lib/libnetgraph lib/libopie lib/libpam \ 978 lib/libradius \ 979 lib/libsbuf lib/libtacplus lib/libutil \ 980 lib/libz lib/msun 981 982lib/libopie__L lib/libtacplus__L: lib/libmd__L 983 984_generic_libs+= lib 985 986.if !defined(NO_CRYPT) 987.if !defined(NO_OPENSSL) 988_prebuild_libs+= secure/lib/libcrypto secure/lib/libssl 989lib/libradius__L secure/lib/libssl__L: secure/lib/libcrypto__L 990.if !defined(NO_OPENSSH) 991_prebuild_libs+= secure/lib/libssh 992secure/lib/libssh__L: lib/libz__L secure/lib/libcrypto__L lib/libcrypt__L 993.if !defined(NO_KERBEROS) 994secure/lib/libssh__L: kerberos5/lib/libgssapi__L kerberos5/lib/libkrb5__L \ 995 kerberos5/lib/libasn1__L lib/libcom_err__L lib/libmd__L \ 996 kerberos5/lib/libroken__L 997.endif 998.endif 999.endif 1000_generic_libs+= secure/lib 1001.endif 1002 1003.if defined(NO_CRYPT) || defined(NO_OPENSSL) 1004lib/libradius__L: lib/libmd__L 1005.endif 1006 1007.if !defined(NO_NIS) 1008_prebuild_libs+= lib/libypclnt 1009.endif 1010 1011_generic_libs+= usr.bin/lex/lib 1012 1013.if ${MACHINE_ARCH} == "i386" 1014_generic_libs+= usr.sbin/pcvt/keycap 1015.endif 1016 1017.for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs} 1018${_lib}__L: .PHONY 1019.if exists(${.CURDIR}/${_lib}) 1020 ${_+_}@${ECHODIR} "===> ${_lib} (depend,all,install)"; \ 1021 cd ${.CURDIR}/${_lib}; \ 1022 ${MAKE} DIRPRFX=${_lib}/ depend; \ 1023 ${MAKE} DIRPRFX=${_lib}/ all; \ 1024 ${MAKE} DIRPRFX=${_lib}/ install 1025.endif 1026.endfor 1027 1028# libpam is special: we need to build static PAM modules before 1029# static PAM library, and dynamic PAM library before dynamic PAM 1030# modules. 1031lib/libpam__L: .PHONY 1032 ${_+_}@${ECHODIR} "===> lib/libpam (depend,all,install)"; \ 1033 cd ${.CURDIR}/lib/libpam; \ 1034 ${MAKE} DIRPRFX=lib/libpam/ depend; \ 1035 ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET all; \ 1036 ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET install 1037 1038_startup_libs: ${_startup_libs:S/$/__L/} 1039_prebuild_libs: ${_prebuild_libs:S/$/__L/} 1040_generic_libs: ${_generic_libs:S/$/__L/} 1041 1042.for __target in all clean cleandepend cleandir depend includes obj 1043.for entry in ${SUBDIR} 1044${entry}.${__target}__D: .PHONY 1045 ${_+_}@if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \ 1046 ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH} (${__target})"; \ 1047 edir=${entry}.${MACHINE_ARCH}; \ 1048 cd ${.CURDIR}/$${edir}; \ 1049 else \ 1050 ${ECHODIR} "===> ${DIRPRFX}${entry} (${__target})"; \ 1051 edir=${entry}; \ 1052 cd ${.CURDIR}/$${edir}; \ 1053 fi; \ 1054 ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/ 1055.endfor 1056par-${__target}: ${SUBDIR:S/$/.${__target}__D/} 1057.endfor 1058 1059.include <bsd.subdir.mk> 1060 1061.if make(delete-old) || make(delete-old-libs) || make(check-old) 1062 1063# 1064# check for / delete old files section 1065# 1066 1067.include "ObsoleteFiles.inc" 1068 1069OLD_LIBS_MESSAGE="Please be sure no application still uses those libraries, \ 1070else you can not start such an application. Consult UPDATING for more \ 1071information regarding how to cope with the removal/revision bump of a \ 1072specific library." 1073 1074.if !defined(BATCH_DELETE_OLD_FILES) 1075RM_I=-i 1076.else 1077RM_I=-v 1078.endif 1079 1080delete-old-files: 1081 @echo ">>> Removing old files (only deletes safe to delete libs)" 1082.for file in ${OLD_FILES} 1083# Ask for every old file if the user really wants to remove it. 1084# It's annoying, but better safe than sorry. 1085 @[ ! -f "${DESTDIR}/${file}" ] || (rm ${RM_I} "${DESTDIR}/${file}" \ 1086 || ([ -f "${DESTDIR}/${file}" ] \ 1087 && echo "Removing schg flag on ${DESTDIR}/${file}" \ 1088 && chflags noschg "${DESTDIR}/${file}" \ 1089 && rm ${RM_I} "${DESTDIR}/${file}")) 1090.endfor 1091# Remove catpages without corresponding manpages. 1092 @3<&0; \ 1093 find ${DESTDIR}/usr/share/man/cat* ! -type d | \ 1094 sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \ 1095 while read catpage; do \ 1096 read manpage; \ 1097 if [ ! -e "$${manpage}" ]; then \ 1098 rm ${RM_I} $${catpage} <&3 ; \ 1099 fi; \ 1100 done 1101 @echo ">>> Old files removed" 1102 1103check-old-files: 1104 @echo ">>> Checking for old files" 1105.for file in ${OLD_FILES} 1106 @[ ! -f "${DESTDIR}/${file}" ] || echo "${DESTDIR}/${file}" 1107.endfor 1108# Check for catpages without corresponding manpages. 1109 @find ${DESTDIR}/usr/share/man/cat* ! -type d | \ 1110 sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \ 1111 while read catpage; do \ 1112 read manpage; \ 1113 if [ ! -e "$${manpage}" ]; then \ 1114 echo $${catpage} ; \ 1115 fi; \ 1116 done 1117 1118delete-old-libs: 1119 @echo ">>> Removing old libraries" 1120 @echo "${OLD_LIBS_MESSAGE}" | fmt 1121.for file in ${OLD_LIBS} 1122 @[ ! -f "${DESTDIR}/${file}" ] || (rm ${RM_I} "${DESTDIR}/${file}" \ 1123 || ([ -f "${DESTDIR}/${file}" ] \ 1124 && echo "Removing schg flag on ${DESTDIR}/${file}" \ 1125 && chflags noschg "${DESTDIR}/${file}" \ 1126 && rm ${RM_I} "${DESTDIR}/${file}")) 1127.endfor 1128 @echo ">>> Old libraries removed" 1129 1130check-old-libs: 1131 @echo ">>> Checking for old libraries" 1132.for file in ${OLD_LIBS} 1133 @[ ! -f "${DESTDIR}/${file}" ] || echo "${DESTDIR}/${file}" 1134.endfor 1135 1136delete-old-dirs: 1137 @echo ">>> Removing old directories" 1138.for dir in ${OLD_DIRS} 1139# Don't fail if an old directory isn't empty. 1140 @[ ! -d "${DESTDIR}/${dir}" ] || (rmdir -v "${DESTDIR}/${dir}" || true) 1141.endfor 1142 @echo ">>> Old directories removed" 1143 1144check-old-dirs: 1145 @echo ">>> Checking for old directories" 1146.for dir in ${OLD_DIRS} 1147 @[ ! -d "${DESTDIR}/${dir}" ] || echo "${DESTDIR}/${dir}" 1148.endfor 1149 1150delete-old: delete-old-files delete-old-dirs 1151 @echo "To remove old libraries run '${MAKE} delete-old-libs'." 1152 1153check-old: check-old-files check-old-libs check-old-dirs 1154 @echo "To remove old files and directories run '${MAKE} delete-old'." 1155 @echo "To remove old libraries run '${MAKE} delete-old-libs'." 1156 1157.endif 1158 1159