ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/src/trunk/Makefile.inc1
(Generate patch)

Comparing trunk/Makefile.inc1 (file contents):
Revision 4656 by laffer1, Sun Feb 19 23:04:03 2012 UTC vs.
Revision 11174 by laffer1, Sat Jun 30 23:22:56 2018 UTC

# Line 1 | Line 1
1 + # $MidnightBSD$
2 + # $FreeBSD: stable/10/Makefile.inc1 331031 2018-03-15 22:42:28Z marius $
3   #
2 # $FreeBSD: src/Makefile.inc1,v 1.499.2.7 2006/01/07 19:40:08 netchild Exp $
3 # $MidnightBSD: src/Makefile.inc1,v 1.36 2012/02/19 22:59:20 laffer1 Exp $
4 #
4   # Make command line options:
5   #       -DNO_CLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
6   #       -DNO_CLEAN do not clean at all
7 + #       -DDB_FROM_SRC use the user/group databases in src/etc instead of
8 + #           the system database when installing.
9   #       -DNO_SHARE do not go into share subdir
10 + #       -DKERNFAST define NO_KERNEL{CONFIG,CLEAN,DEPEND,OBJ}
11   #       -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel
12   #       -DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel
13   #       -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel
14 + #       -DNO_KERNELOBJ do not run ${MAKE} obj in ${MAKE} buildkernel
15   #       -DNO_PORTSUPDATE do not update ports in ${MAKE} update
16 + #       -DNO_ROOT install without using root privilege
17   #       -DNO_DOCUPDATE do not update doc in ${MAKE} update
18 + #       -DNO_CTF do not run the DTrace CTF conversion tools on built objects
19   #       LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
20 < #       LOCAL_TOOL_DIRS="list of dirs" to add additional dirs to the build-tools#           list
20 > #       LOCAL_ITOOLS="list of tools" to add additional tools to the ITOOLS list
21 > #       LOCAL_LIB_DIRS="list of dirs" to add additional dirs to libraries target
22 > #       LOCAL_MTREE="list of mtree files" to process to allow local directories
23 > #           to be created before files are installed
24 > #       LOCAL_TOOL_DIRS="list of dirs" to add additional dirs to the build-tools
25 > #           list
26 > #       METALOG="path to metadata log" to write permission and ownership
27 > #           when NO_ROOT is set.  (default: ${DESTDIR}/METALOG)
28   #       TARGET="machine" to crossbuild world for a different machine type
29 + #       TARGET_ARCH= may be required when a TARGET supports multiple endians
30 + #       BUILDENV_SHELL= shell to launch for the buildenv target (def:/bin/sh)
31 + #       WORLD_FLAGS= additional flags to pass to make(1) during buildworld
32 + #       KERNEL_FLAGS= additional flags to pass to make(1) during buildkernel
33  
34   #
35   # The intended user-driven targets are:
36   # buildworld  - rebuild *everything*, including glue to help do upgrades
37   # installworld- install everything built by "buildworld"
38 + # checkworld  - run test suite on installed world
39   # doxygen     - build API documentation of the kernel
40 < # update      - convenient way to update your source tree (eg: cvsup/cvs)
40 > # update      - convenient way to update your source tree (eg: svn/svnup)
41   #
42   # Standard targets (not defined here) are documented in the makefiles in
43   # /usr/share/mk.  These include:
44   #               obj depend all install clean cleandepend cleanobj
45  
29 # You are supposed to define both of these when calling Makefile.inc1
30 # directly.  However, some old scripts don't.  Cope for the moment, but
31 # issue a new warning for a transition period.
32 .if defined(TARGET) && !defined(TARGET_ARCH)
33 .warning "You must pass both TARGET and TARGET_ARCH to Makefile.inc1.  Setting TARGET_ARCH=${TARGET}."
34 TARGET_ARCH=${TARGET}
35 .endif
46   .if !defined(TARGET) || !defined(TARGET_ARCH)
47   .error "Both TARGET and TARGET_ARCH must be defined."
48   .endif
49  
50   .include <bsd.own.mk>
51 + .include <bsd.arch.inc.mk>
52 + .include <bsd.compiler.mk>
53  
54 + LOCALBASE?=     /usr/local
55 +
56   # We must do share/info early so that installation of info `dir'
57   # entries works correctly.  Do it first since it is less likely to
58   # grow dependencies on include and lib than vice versa.
# Line 48 | Line 62 | TARGET_ARCH=${TARGET}
62   # use that new version.  And the new (dynamically-linked) /bin/sh
63   # will expect to find appropriate libraries in /lib and /libexec.
64   #
65 + SRCDIR?=        ${.CURDIR}
66 + .if defined(SUBDIR_OVERRIDE)
67 + SUBDIR= ${SUBDIR_OVERRIDE}
68 + .else
69   SUBDIR= share/info lib libexec
70   SUBDIR+=bin
53 .if ${MK_APACHE} != "no"
54 SUBDIR+=apache
55 .endif
71   .if ${MK_GAMES} != "no"
72   SUBDIR+=games
73   .endif
# Line 74 | Line 89 | SUBDIR+=secure
89   SUBDIR+=share
90   .endif
91   SUBDIR+=sys usr.bin usr.sbin
92 + .if ${MK_TESTS} != "no"
93 + SUBDIR+=        tests
94 + .endif
95 + .if ${MK_OFED} != "no"
96 + SUBDIR+=contrib/ofed
97 + .endif
98   #
99   # We must do etc/ last for install/distribute to work.
100   #
# Line 81 | Line 102 | SUBDIR+=etc
102  
103   # These are last, since it is nice to at least get the base system
104   # rebuilt before you do them.
105 < .for _DIR in ${LOCAL_DIRS}
105 > .for _DIR in ${LOCAL_LIB_DIRS} ${LOCAL_DIRS}
106   .if exists(${.CURDIR}/${_DIR}/Makefile)
107   SUBDIR+= ${_DIR}
108   .endif
109   .endfor
89
90 .if defined(SUBDIR_OVERRIDE)
91 SUBDIR=         ${SUBDIR_OVERRIDE}
110   .endif
111  
112   .if defined(NOCLEAN)
# Line 100 | Line 118 | CLEANDIR=      clean cleandepend
118   CLEANDIR=       cleandir
119   .endif
120  
103 BUILDENV_SHELL?=/bin/sh
121   LOCAL_TOOL_DIRS?=
122 + PACKAGEDIR?=    ${DESTDIR}/${DISTDIR}
123  
124 < CVS?=           cvs
107 < CVSFLAGS?=      -r . -P -d -I!
108 < SUP?=           /usr/local/bin/cvsup
109 < SUPFLAGS?=      -g -L 2
110 < .if defined(SUPHOST)
111 < SUPFLAGS+=      -h ${SUPHOST}
112 < .endif
124 > BUILDENV_SHELL?=/bin/sh
125  
126 + SVN?=           /usr/local/bin/svn
127 + SVNFLAGS?=      -r HEAD
128 +
129   MAKEOBJDIRPREFIX?=      /usr/obj
130   .if !defined(OSRELDATE)
131   .if exists(/usr/include/osreldate.h)
# Line 121 | Line 136 | OSRELDATE=     0
136   .endif
137   .endif
138  
139 < # Guess machine architecture from machine type, and vice versa.
140 < .if !defined(TARGET_ARCH) && defined(TARGET)
141 < TARGET_ARCH=    ${TARGET}
142 < .elif !defined(TARGET) && defined(TARGET_ARCH) && \
143 <    ${TARGET_ARCH} != ${MACHINE_ARCH}
144 < TARGET=         ${TARGET_ARCH}
139 > .if !defined(VERSION)
140 > REVISION!=      ${MAKE} -C ${SRCDIR}/release -V REVISION
141 > BRANCH!=        ${MAKE} -C ${SRCDIR}/release -V BRANCH
142 > SRCRELDATE!=    awk '/^\#define[[:space:]]*__MidnightBSD_version/ { print $$3 }' \
143 >                ${SRCDIR}/sys/sys/param.h
144 > VERSION=        MidnightBSD ${REVISION} ${TARGET_ARCH} ${SRCRELDATE}
145   .endif
131 # Otherwise, default to current machine type and architecture.
132 TARGET?=        ${MACHINE}
133 TARGET_ARCH?=   ${MACHINE_ARCH}
146  
147 < KNOWN_ARCHES?=  amd64 i386 sparc64
147 > KNOWN_ARCHES?=  amd64 arm armeb/arm armv6/arm i386 i386/pc98 ia64 mips mipsel/mips mips64el/mips mips64/mips mipsn32el/mips mipsn32/mips powerpc powerpc64/powerpc sparc64
148   .if ${TARGET} == ${TARGET_ARCH}
149   _t=             ${TARGET}
150   .else
# Line 173 | Line 185 | OBJTREE=       ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH}
185   .endif
186   WORLDTMP=       ${OBJTREE}${.CURDIR}/tmp
187   # /usr/games added for fortune which depend on strfile
188 < BPATH=          ${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/usr/games
188 > BPATH=          ${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/usr/games:${WORLDTMP}/legacy/bin
189   XPATH=          ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games
190   STRICTTMPPATH=  ${BPATH}:${XPATH}
191   TMPPATH=        ${STRICTTMPPATH}:${PATH}
# Line 218 | Line 230 | BOOTSTRAPPING?=        0
230   CROSSENV=       MAKEOBJDIRPREFIX=${OBJTREE} \
231                  MACHINE_ARCH=${TARGET_ARCH} \
232                  MACHINE=${TARGET} \
233 <                CPUTYPE=${TARGET_CPUTYPE} \
222 <                GROFF_BIN_PATH=${WORLDTMP}/legacy/usr/bin \
223 <                GROFF_FONT_PATH=${WORLDTMP}/legacy/usr/share/groff_font \
224 <                GROFF_TMAC_PATH=${WORLDTMP}/legacy/usr/share/tmac
233 >                CPUTYPE=${TARGET_CPUTYPE}
234  
235 + _BOOTSTRAP_MAKEINFO?=   ${MK_INFO}
236   # bootstrap-tools stage
237   BMAKEENV=       INSTALL="sh ${.CURDIR}/tools/install.sh" \
238                  PATH=${BPATH}:${PATH} \
239                  WORLDTMP=${WORLDTMP} \
240 <                MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}"
240 >                VERSION="${VERSION}" \
241 >                MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \
242 >                COMPILER_TYPE=${COMPILER_TYPE}
243   BMAKE=          MAKEOBJDIRPREFIX=${WORLDTMP} \
244 <                ${BMAKEENV} ${MAKE} -f Makefile.inc1 \
244 >                ${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
245                  DESTDIR= \
246                  BOOTSTRAPPING=${OSRELDATE} \
247 +                SSP_CFLAGS= \
248                  -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \
249 <                -DWITHOUT_NLS -DNO_PIC -DWITHOUT_PROFILE -DNO_SHARED \
250 <                -DNO_CPU_CFLAGS -DNO_WARNS
249 >                -DNO_PIC -DNO_PROFILE -DNO_SHARED \
250 >                _BOOTSTRAP_MAKEINFO=${_BOOTSTRAP_MAKEINFO} \
251 >                -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD -DNO_TESTS
252  
253   # build-tools stage
254   TMAKE=          MAKEOBJDIRPREFIX=${OBJTREE} \
255 <                ${BMAKEENV} ${MAKE} -f Makefile.inc1 \
255 >                ${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
256                  TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
257                  DESTDIR= \
258 <                BOOTSTRAPPING=${OSRELDATE} -DNO_LINT -DNO_CPU_CFLAGS -DNO_WARNS
258 >                BOOTSTRAPPING=${OSRELDATE} \
259 >                SSP_CFLAGS= \
260 >                -DNO_LINT \
261 >                -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD -DNO_TESTS
262  
263   # cross-tools stage
264   XMAKE=          TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \
265                  TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
266 <                -DWITHOUT_GDB
266 >                -DWITHOUT_GDB -DNO_TESTS
267  
268 + # kernel-tools stage
269 + KTMAKEENV=      INSTALL="sh ${.CURDIR}/tools/install.sh" \
270 +                PATH=${BPATH}:${PATH} \
271 +                WORLDTMP=${WORLDTMP} \
272 +                VERSION="${VERSION}" \
273 +                COMPILER_TYPE=${COMPILER_TYPE}
274 + KTMAKE=         TOOLS_PREFIX=${WORLDTMP} MAKEOBJDIRPREFIX=${WORLDTMP} \
275 +                ${KTMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
276 +                DESTDIR= \
277 +                BOOTSTRAPPING=${OSRELDATE} \
278 +                SSP_CFLAGS= \
279 +                -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \
280 +                -DNO_PIC -DNO_PROFILE -DNO_SHARED \
281 +                -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD
282 +
283   # world stage
284   WMAKEENV=       ${CROSSENV} \
285                  _SHLIBDIRPREFIX=${WORLDTMP} \
286 +                _LDSCRIPTROOT= \
287 +                VERSION="${VERSION}" \
288                  INSTALL="sh ${.CURDIR}/tools/install.sh" \
289                  PATH=${TMPPATH}
256 WMAKE=          ${WMAKEENV} ${MAKE} -f Makefile.inc1 DESTDIR=${WORLDTMP}
290  
291 < .if ${TARGET_ARCH} == "amd64"
291 > # make hierarchy
292 > HMAKE=          PATH=${TMPPATH} ${MAKE} LOCAL_MTREE=${LOCAL_MTREE:Q}
293 > .if defined(NO_ROOT)
294 > HMAKE+=         PATH=${TMPPATH} METALOG=${METALOG} -DNO_ROOT
295 > .endif
296 >
297 > .if ${MK_CDDL} == "no"
298 > WMAKEENV+=      NO_CTF=1
299 > .endif
300 >
301 > .if defined(CROSS_TOOLCHAIN_PREFIX)
302 > CROSS_COMPILER_PREFIX?=${CROSS_TOOLCHAIN_PREFIX}
303 > CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX}
304 > .endif
305 > XCOMPILERS=     CC CXX CPP
306 > .for COMPILER in ${XCOMPILERS}
307 > .if defined(CROSS_COMPILER_PREFIX)
308 > X${COMPILER}?=  ${CROSS_COMPILER_PREFIX}${${COMPILER}}
309 > .else
310 > X${COMPILER}?=  ${${COMPILER}}
311 > .endif
312 > .endfor
313 > XBINUTILS=      AS AR LD NM OBJCOPY OBJDUMP RANLIB STRINGS
314 > .for BINUTIL in ${XBINUTILS}
315 > .if defined(CROSS_BINUTILS_PREFIX)
316 > X${BINUTIL}?=   ${CROSS_BINUTILS_PREFIX}${${BINUTIL}}
317 > .else
318 > X${BINUTIL}?=   ${${BINUTIL}}
319 > .endif
320 > .endfor
321 > WMAKEENV+=      CC="${XCC} ${XFLAGS}" CXX="${XCXX} ${XFLAGS}" \
322 >                CPP="${XCPP} ${XFLAGS}" \
323 >                AS="${XAS}" AR="${XAR}" LD="${XLD}" NM=${XNM} \
324 >                OBJDUMP=${XOBJDUMP} OBJCOPY="${XOBJCOPY}" \
325 >                RANLIB=${XRANLIB} STRINGS=${XSTRINGS}
326 >
327 > .if ${XCC:T:Mgcc} == "gcc"
328 > WMAKE_COMPILER_TYPE=    gcc
329 > .elif ${XCC:T:Mclang} == "clang"
330 > WMAKE_COMPILER_TYPE=    clang
331 > .elif ${MK_CLANG_IS_CC} == "no"
332 > WMAKE_COMPILER_TYPE=    gcc
333 > .else
334 > WMAKE_COMPILER_TYPE=    clang
335 > .endif
336 > IMAKE_COMPILER_TYPE=    COMPILER_TYPE=${WMAKE_COMPILER_TYPE}
337 >
338 > .if ${XCC:M/*}
339 > XFLAGS=         --sysroot=${WORLDTMP}
340 > .if defined(CROSS_BINUTILS_PREFIX)
341 > # In the case of xdev-build tools, CROSS_BINUTILS_PREFIX won't be a
342 > # directory, but the compiler will look in the right place for it's
343 > # tools so we don't need to tell it where to look.
344 > .if exists(${CROSS_BINUTILS_PREFIX})
345 > XFLAGS+=        -B${CROSS_BINUTILS_PREFIX}
346 > .endif
347 > .else
348 > XFLAGS+=        -B${WORLDTMP}/usr/bin
349 > .endif
350 > .if ${TARGET_ARCH} != ${MACHINE_ARCH} && ${WMAKE_COMPILER_TYPE} == "clang"
351 > .if (${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "armv6") && \
352 > ${MK_ARM_EABI} != "no"
353 > TARGET_ABI=     gnueabi
354 > .else
355 > TARGET_ABI=     unknown
356 > .endif
357 > TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd10.4
358 > XFLAGS+=        -target ${TARGET_TRIPLE}
359 > .endif
360 > .endif
361 >
362 > WMAKEENV+=      COMPILER_TYPE=${WMAKE_COMPILER_TYPE}
363 > WMAKE=          ${WMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 DESTDIR=${WORLDTMP}
364 >
365 > .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64"
366   # 32 bit world
367   LIB32TMP=       ${OBJTREE}${.CURDIR}/lib32
368  
369 + .if ${TARGET_ARCH} == "amd64"
370   .if empty(TARGET_CPUTYPE)
371 < LIB32CPUTYPE=   k8
371 > LIB32CPUFLAGS=  -march=i686 -mmmx -msse -msse2
372   .else
373 < LIB32CPUTYPE=   ${TARGET_CPUTYPE}
373 > LIB32CPUFLAGS=  -march=${TARGET_CPUTYPE}
374   .endif
375 < LIB32FLAGS=     -m32 -march=${LIB32CPUTYPE} -DCOMPAT_32BIT \
376 <                -iprefix ${LIB32TMP}/usr/ \
375 > LIB32WMAKEENV=  MACHINE=i386 MACHINE_ARCH=i386 \
376 >                MACHINE_CPU="i686 mmx sse sse2"
377 > LIB32WMAKEFLAGS=        \
378 >                AS="${XAS} --32" \
379 >                LD="${XLD} -m elf_i386_fbsd -Y P,${LIB32TMP}/usr/lib32" \
380 >                OBJCOPY="${XOBJCOPY}"
381 >
382 > .elif ${TARGET_ARCH} == "powerpc64"
383 > .if empty(TARGET_CPUTYPE)
384 > LIB32CPUFLAGS=  -mcpu=powerpc
385 > .else
386 > LIB32CPUFLAGS=  -mcpu=${TARGET_CPUTYPE}
387 > .endif
388 > LIB32WMAKEENV=  MACHINE=powerpc MACHINE_ARCH=powerpc
389 > LIB32WMAKEFLAGS=        \
390 >                LD="${XLD} -m elf32ppc_fbsd" \
391 >                OBJCOPY="${XOBJCOPY}"
392 > .endif
393 >
394 >
395 > LIB32FLAGS=     -m32 ${LIB32CPUFLAGS} -DCOMPAT_32BIT \
396 >                -isystem ${LIB32TMP}/usr/include/ \
397                  -L${LIB32TMP}/usr/lib32 \
398                  -B${LIB32TMP}/usr/lib32
399 + .if ${XCC:M/*}
400 + LIB32FLAGS+=            --sysroot=${WORLDTMP}
401 + .endif
402  
403   # Yes, the flags are redundant.
404 < LIB32WMAKEENV=  MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \
404 > LIB32WMAKEENV+= MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \
405                  _SHLIBDIRPREFIX=${LIB32TMP} \
406 <                MACHINE=i386 \
407 <                MACHINE_ARCH=i386 \
406 >                _LDSCRIPTROOT=${LIB32TMP} \
407 >                VERSION="${VERSION}" \
408                  INSTALL="sh ${.CURDIR}/tools/install.sh" \
409                  PATH=${TMPPATH} \
279                CC="${CC} ${LIB32FLAGS}" \
280                CXX="${CXX} ${LIB32FLAGS}" \
281                OBJC="${OBJC} ${LIB32FLAGS}" \
282                LD="${LD} -m elf_i386_fbsd -Y P,${LIB32TMP}/usr/lib32" \
283                AS="${AS} --32" \
410                  LIBDIR=/usr/lib32 \
411 <                SHLIBDIR=/usr/lib32
411 >                SHLIBDIR=/usr/lib32 \
412 >                LIBPRIVATEDIR=/usr/lib32/private \
413 >                COMPILER_TYPE=${WMAKE_COMPILER_TYPE} \
414 >                DTRACE="${DTRACE} -32"
415 > LIB32WMAKEFLAGS+=       \
416 >                CC="${XCC} ${LIB32FLAGS}" \
417 >                CXX="${XCXX} ${LIB32FLAGS}" \
418 >                DESTDIR=${LIB32TMP} \
419 >                -DCOMPAT_32BIT \
420 >                -DLIBRARIES_ONLY \
421 >                -DNO_CPU_CFLAGS \
422 >                -DNO_CTF \
423 >                -DNO_LINT \
424 >                -DNO_TESTS
425  
426 < LIB32WMAKE=     ${LIB32WMAKEENV} ${MAKE} -DNO_CPU_CFLAGS -DCOMPAT_32BIT \
427 <                -DWITHOUT_BIND -DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_INFO \
428 <                -DWITHOUT_HTML -DNO_LINT -ECC -ECXX -EAS -ELD \
429 <                -DESTDIR=${LIB32TMP}
291 < LIB32IMAKE=     ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*} -DNO_INCS
426 > LIB32WMAKE=     ${LIB32WMAKEENV} ${MAKE} ${LIB32WMAKEFLAGS} \
427 >                -DWITHOUT_MAN -DWITHOUT_INFO -DWITHOUT_HTML
428 > LIB32IMAKE=     ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*:N_LDSCRIPTROOT=*} -DNO_INCS \
429 >                ${IMAKE_INSTALL}
430   .endif
431  
432 < # install stage
433 < IMAKEENV=       ${CROSSENV}
434 < IMAKE=          ${IMAKEENV} ${MAKE} -f Makefile.inc1
432 > IMAKEENV=       ${CROSSENV:N_LDSCRIPTROOT=*}
433 > IMAKE=          ${IMAKEENV} ${MAKE} -f Makefile.inc1 \
434 >                ${IMAKE_INSTALL} ${IMAKE_MTREE} ${IMAKE_COMPILER_TYPE}
435   .if empty(.MAKEFLAGS:M-n)
436   IMAKEENV+=      PATH=${STRICTTMPPATH}:${INSTALLTMP} \
437                  LD_LIBRARY_PATH=${INSTALLTMP} \
# Line 302 | Line 440 | IMAKE+=                __MAKE_SHELL=${INSTALLTMP}/sh
440   .else
441   IMAKEENV+=      PATH=${TMPPATH}:${INSTALLTMP}
442   .endif
443 + .if defined(DB_FROM_SRC)
444 + INSTALLFLAGS+=  -N ${.CURDIR}/etc
445 + MTREEFLAGS+=    -N ${.CURDIR}/etc
446 + .endif
447 + _INSTALL_DDIR=  ${DESTDIR}/${DISTDIR}
448 + INSTALL_DDIR=   ${_INSTALL_DDIR:S://:/:g:C:/$::}
449 + .if defined(NO_ROOT)
450 + METALOG?=       ${DESTDIR}/${DISTDIR}/METALOG
451 + IMAKE+=         -DNO_ROOT METALOG=${METALOG}
452 + INSTALLFLAGS+=  -U -M ${METALOG} -D ${INSTALL_DDIR}
453 + MTREEFLAGS+=    -W
454 + .endif
455 + .if defined(DB_FROM_SRC) || defined(NO_ROOT)
456 + IMAKE_INSTALL=  INSTALL="install ${INSTALLFLAGS}"
457 + IMAKE_MTREE=    MTREE_CMD="nmtree ${MTREEFLAGS}"
458 + .endif
459  
460   # kernel stage
461   KMAKEENV=       ${WMAKEENV}
462 < KMAKE=          ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME}
462 > KMAKE=          ${KMAKEENV} ${MAKE} ${.MAKEFLAGS} ${KERNEL_FLAGS} KERNEL=${INSTKERNNAME}
463  
464   #
465   # buildworld
# Line 313 | Line 467 | KMAKE=         ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME}
467   # Attempt to rebuild the entire system, with reasonable chance of
468   # success, regardless of how old your existing system is.
469   #
470 < _worldtmp:
470 > _worldtmp: .PHONY
471   .if ${.CURDIR:C/[^,]//g} != ""
472   #       The m4 build of sendmail files doesn't like it if ',' is used
473   #       anywhere in the path of it's files.
# Line 328 | Line 482 | _worldtmp:
482          @echo "--------------------------------------------------------------"
483   .if !defined(NO_CLEAN)
484          rm -rf ${WORLDTMP}
485 < .if ${TARGET_ARCH} == "amd64"
485 > .if defined(LIB32TMP)
486          rm -rf ${LIB32TMP}
487   .endif
488   .else
489          rm -rf ${WORLDTMP}/legacy/usr/include
490 < #       XXX - These two can depend on any header file.
490 > #       XXX - These three can depend on any header file.
491          rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c
492          rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/kdump_subr.c
493          rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c
494   .endif
495   .for _dir in \
496 <    lib usr legacy/usr
496 >    lib usr legacy/bin legacy/usr
497          mkdir -p ${WORLDTMP}/${_dir}
498   .endfor
499          mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
# Line 349 | Line 503 | _worldtmp:
503          mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
504              -p ${WORLDTMP}/usr/include >/dev/null
505          ln -sf ${.CURDIR}/sys ${WORLDTMP}
506 < .if ${MK_BIND_LIBS} != "no"
507 <        mtree -deU -f ${.CURDIR}/etc/mtree/BIND.include.dist \
508 <            -p ${WORLDTMP}/usr/include >/dev/null
506 > .if ${MK_DEBUG_FILES} != "no"
507 >        # We could instead disable debug files for these build stages
508 >        mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
509 >            -p ${WORLDTMP}/legacy/usr/lib >/dev/null
510 >        mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
511 >            -p ${WORLDTMP}/usr/lib >/dev/null
512   .endif
513 + .if ${MK_TESTS} != "no"
514 +        mkdir -p ${WORLDTMP}${TESTSBASE}
515 +        mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
516 +            -p ${WORLDTMP}${TESTSBASE} >/dev/null
517 + .endif
518 + .for _mtree in ${LOCAL_MTREE}
519 +        mtree -deU -f ${.CURDIR}/${_mtree} -p ${WORLDTMP} > /dev/null
520 + .endfor
521   _legacy:
522          @echo
523          @echo "--------------------------------------------------------------"
# Line 372 | Line 537 | _cleanobj:
537          @echo ">>> stage 2.1: cleaning up the object tree"
538          @echo "--------------------------------------------------------------"
539          ${_+_}cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/}
540 < .if ${TARGET_ARCH} == "amd64"
540 > .if defined(LIB32TMP)
541          ${_+_}cd ${.CURDIR}; ${LIB32WMAKE} -f Makefile.inc1 ${CLEANDIR:S/^/par-/}
542   .endif
543   .endif
# Line 394 | Line 559 | _cross-tools:
559          @echo ">>> stage 3: cross tools"
560          @echo "--------------------------------------------------------------"
561          ${_+_}cd ${.CURDIR}; ${XMAKE} cross-tools
562 +        ${_+_}cd ${.CURDIR}; ${XMAKE} kernel-tools
563   _includes:
564          @echo
565          @echo "--------------------------------------------------------------"
# Line 407 | Line 573 | _libraries:
573          @echo "--------------------------------------------------------------"
574          ${_+_}cd ${.CURDIR}; \
575              ${WMAKE} -DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT \
576 <            -DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_PROFILE libraries
576 >            -DWITHOUT_MAN -DNO_PROFILE -DNO_TESTS libraries
577   _depend:
578          @echo
579          @echo "--------------------------------------------------------------"
# Line 420 | Line 586 | everything:
586          @echo ">>> stage 4.4: building everything"
587          @echo "--------------------------------------------------------------"
588          ${_+_}cd ${.CURDIR}; ${WMAKE} par-all
589 < .if ${TARGET_ARCH} == "amd64"
590 < build32:
589 > .if defined(LIB32TMP)
590 > build32: .PHONY
591          @echo
592          @echo "--------------------------------------------------------------"
593          @echo ">>> stage 5.1: building 32 bit shim libraries"
# Line 431 | Line 597 | build32:
597              -p ${LIB32TMP}/usr >/dev/null
598          mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
599              -p ${LIB32TMP}/usr/include >/dev/null
600 + .if ${MK_DEBUG_FILES} != "no"
601 +        mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
602 +            -p ${LIB32TMP}/usr/lib >/dev/null
603 + .endif
604          mkdir -p ${WORLDTMP}
605          ln -sf ${.CURDIR}/sys ${WORLDTMP}
436 .if ${MK_KERBEROS} != "no"
437 .for _t in obj depend all
438        cd ${.CURDIR}/kerberos5/tools; \
439            MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} DESTDIR= ${_t}
440 .endfor
441 .endif
606   .for _t in obj includes
607 <        cd ${.CURDIR}/include; ${LIB32WMAKE} ${_t}
608 <        cd ${.CURDIR}/lib; ${LIB32WMAKE} ${_t}
445 < .if ${MK_APACHE} != "no"
446 <        cd ${.CURDIR}/apache/lib; ${LIB32WMAKE} ${_t}
447 < .endif
607 >        ${_+_}cd ${.CURDIR}/include; ${LIB32WMAKE} DIRPRFX=include/ ${_t}
608 >        ${_+_}cd ${.CURDIR}/lib; ${LIB32WMAKE} DIRPRFX=lib/ ${_t}
609   .if ${MK_CDDL} != "no"
610 <        cd ${.CURDIR}/cddl/lib; ${LIB32WMAKE} DIRPRFX=cddl/lib/ ${_t}
610 >        ${_+_}cd ${.CURDIR}/cddl/lib; ${LIB32WMAKE} DIRPRFX=cddl/lib/ ${_t}
611   .endif
612 <        cd ${.CURDIR}/gnu/lib; ${LIB32WMAKE} DIRPRFX=gnu/lib/ ${_t}
612 >        ${_+_}cd ${.CURDIR}/gnu/lib; ${LIB32WMAKE} DIRPRFX=gnu/lib/ ${_t}
613   .if ${MK_CRYPT} != "no"
614 <        cd ${.CURDIR}/secure/lib; ${LIB32WMAKE} DIRPRFX=secure/lib/ ${_t}
614 >        ${_+_}cd ${.CURDIR}/secure/lib; ${LIB32WMAKE} DIRPRFX=secure/lib/ ${_t}
615   .endif
616   .if ${MK_KERBEROS} != "no"
617 <        cd ${.CURDIR}/kerberos5/lib; ${LIB32WMAKE} DIRPRFX=kerberos5/lib ${_t}
617 >        ${_+_}cd ${.CURDIR}/kerberos5/lib; ${LIB32WMAKE} DIRPRFX=kerberos5/lib ${_t}
618   .endif
619   .endfor
620   .for _dir in usr.bin/lex/lib
621 <        cd ${.CURDIR}/${_dir}; ${LIB32WMAKE} DIRPRFX=${_dir}/ obj
621 >        ${_+_}cd ${.CURDIR}/${_dir}; ${LIB32WMAKE} DIRPRFX=${_dir}/ obj
622   .endfor
623   .for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw lib/libmagic
624 <        cd ${.CURDIR}/${_dir}; \
624 >        ${_+_}cd ${.CURDIR}/${_dir}; \
625 >            WORLDTMP=${WORLDTMP} \
626 >            MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \
627              MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} SSP_CFLAGS= DESTDIR= \
628 <            DIRPRFX=${_dir}/ build-tools
628 >            DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF \
629 >            -DEARLY_BUILD build-tools
630   .endfor
631 <        cd ${.CURDIR}; \
632 <            ${LIB32WMAKE} -f Makefile.inc1 libraries
631 >        ${_+_}cd ${.CURDIR}; \
632 >            ${LIB32WMAKE} -f Makefile.inc1 -DNO_FSCHG libraries
633   .for _t in obj depend all
634 <        cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32WMAKE} \
635 <            DIRPRFX=libexec/rtld-elf/ ${_t}
636 <        cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32WMAKE} \
634 > .if !defined(NO_RTLD)
635 >        ${_+_}cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32WMAKE} \
636 >            -DNO_FSCHG DIRPRFX=libexec/rtld-elf/ ${_t}
637 > .endif
638 >        ${_+_}cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32WMAKE} \
639              DIRPRFX=usr.bin/ldd ${_t}
640   .endfor
641  
642 < distribute32 install32:
643 < .if make(distribute32)
478 <        mkdir -p ${DISTDIR}/${DISTRIBUTION}/usr/lib32   # XXX add to mtree
479 < .else
480 <        mkdir -p ${DESTDIR}/usr/lib32                   # XXX add to mtree
481 < .endif
482 <        cd ${.CURDIR}/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
642 > distribute32 install32: .MAKE .PHONY
643 >        ${_+_}cd ${.CURDIR}/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
644   .if ${MK_CDDL} != "no"
645 <        cd ${.CURDIR}/cddl/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
645 >        ${_+_}cd ${.CURDIR}/cddl/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
646   .endif
647 <        cd ${.CURDIR}/gnu/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
647 >        ${_+_}cd ${.CURDIR}/gnu/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
648   .if ${MK_CRYPT} != "no"
649 <        cd ${.CURDIR}/secure/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
649 >        ${_+_}cd ${.CURDIR}/secure/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
650   .endif
651   .if ${MK_KERBEROS} != "no"
652 <        cd ${.CURDIR}/kerberos5/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
652 >        ${_+_}cd ${.CURDIR}/kerberos5/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
653   .endif
654 <        cd ${.CURDIR}/libexec/rtld-elf; \
654 > .if !defined(NO_RTLD)
655 >        ${_+_}cd ${.CURDIR}/libexec/rtld-elf; \
656              PROG=ld-elf32.so.1 ${LIB32IMAKE} ${.TARGET:S/32$//}
495        cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32IMAKE} ${.TARGET:S/32$//}
657   .endif
658 +        ${_+_}cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32IMAKE} \
659 +            ${.TARGET:S/32$//}
660 + .endif
661  
662   WMAKE_TGTS=
663   .if !defined(SUBDIR_OVERRIDE)
# Line 504 | Line 668 | WMAKE_TGTS+=   _cleanobj _obj _build-tools
668   WMAKE_TGTS+=    _cross-tools
669   .endif
670   WMAKE_TGTS+=    _includes _libraries _depend everything
671 < .if ${TARGET_ARCH} == "amd64" && ${MK_LIB32} != "no"
671 > .if defined(LIB32TMP) && ${MK_LIB32} != "no"
672   WMAKE_TGTS+=    build32
673   .endif
674  
# Line 531 | Line 695 | buildworld_epilogue:
695   buildenvvars:
696          @echo ${WMAKEENV:Q}
697  
698 + .if ${.TARGETS:Mbuildenv}
699 + .if ${.MAKEFLAGS:M-j}
700 + .error The buildenv target is incompatible with -j
701 + .endif
702 + .endif
703   buildenv:
704          @echo Entering world for ${TARGET_ARCH}:${TARGET}
705          @cd ${.CURDIR} && env ${WMAKEENV} ${BUILDENV_SHELL} || true
# Line 544 | Line 713 | kernel-toolchain: ${TOOLCHAIN_TGTS:N_includes:N_librar
713   #
714   # Checks to be sure system is ready for installworld/installkernel.
715   #
716 < installcheck:
716 > installcheck: _installcheck_world _installcheck_kernel
717 > _installcheck_world:
718 > _installcheck_kernel:
719  
720   #
721 < # Require DESTDIR to be set if installing for a different architecture.
721 > # Require DESTDIR to be set if installing for a different architecture or
722 > # using the user/group database in the source tree.
723   #
724 < .if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${TARGET} != ${MACHINE}
724 > .if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${TARGET} != ${MACHINE} || \
725 >    defined(DB_FROM_SRC)
726   .if !make(distributeworld)
727 < installcheck: installcheck_DESTDIR
728 < installcheck_DESTDIR:
727 > _installcheck_world: __installcheck_DESTDIR
728 > _installcheck_kernel: __installcheck_DESTDIR
729 > __installcheck_DESTDIR:
730   .if !defined(DESTDIR) || empty(DESTDIR)
731          @echo "ERROR: Please set DESTDIR!"; \
732          false
# Line 560 | Line 734 | installcheck_DESTDIR:
734   .endif
735   .endif
736  
737 + .if !defined(DB_FROM_SRC)
738   #
739   # Check for missing UIDs/GIDs.
740   #
741 < CHECK_UIDS=
741 > CHECK_UIDS=     auditdistd
742   CHECK_GIDS=     audit
743   .if ${MK_SENDMAIL} != "no"
744   CHECK_UIDS+=    smmsp
# Line 573 | Line 748 | CHECK_GIDS+=   smmsp
748   CHECK_UIDS+=    proxy
749   CHECK_GIDS+=    proxy authpf
750   .endif
751 < installcheck: installcheck_UGID
752 < installcheck_UGID:
751 > .if ${MK_UNBOUND} != "no"
752 > CHECK_UIDS+=    unbound
753 > CHECK_GIDS+=    unbound
754 > .endif
755 > _installcheck_world: __installcheck_UGID
756 > __installcheck_UGID:
757   .for uid in ${CHECK_UIDS}
758          @if ! `id -u ${uid} >/dev/null 2>&1`; then \
759                  echo "ERROR: Required ${uid} user is missing, see /usr/src/UPDATING."; \
# Line 587 | Line 766 | installcheck_UGID:
766                  false; \
767          fi
768   .endfor
769 + .endif
770  
771   #
772   # Required install tools to be saved in a scratch dir for safety.
# Line 598 | Line 778 | _install-info= install-info
778   _zoneinfo=      zic tzsetup
779   .endif
780  
781 < ITOOLS= [ awk cap_mkdb cat chflags chmod chown \
782 <        date echo egrep find grep ${_install-info} \
783 <        ln lockf make mkdir mtree mv pwd_mkdb rm sed sh sysctl \
604 <        test true uname wc ${_zoneinfo}
781 > .if exists(/usr/sbin/nmtree)
782 > _nmtree_itools= nmtree
783 > .endif
784  
785 + ITOOLS= [ awk cap_mkdb cat chflags chmod chown cmp cp \
786 +        date echo egrep find grep id install ${_install-info} \
787 +        ln lockf make mkdir mtree ${_nmtree_itools} mv pwd_mkdb \
788 +        rm sed sh strip sysctl test true uname wc ${_zoneinfo} \
789 +        ${LOCAL_ITOOLS}
790 +
791 + # Needed for share/man
792 + .if ${MK_MAN} != "no"
793 + ITOOLS+=makewhatis
794 + .endif
795 +
796   #
797   # distributeworld
798   #
# Line 614 | Line 804 | ITOOLS=        [ awk cap_mkdb cat chflags chmod chown \
804   #
805  
806   # Non-base distributions produced by the base system
807 < EXTRA_DISTRIBUTIONS=    doc games
807 > EXTRA_DISTRIBUTIONS=    doc
808 > .if ${MK_GAMES} != "no"
809 > EXTRA_DISTRIBUTIONS+=   games
810 > .endif
811   .if defined(LIB32TMP) && ${MK_LIB32} != "no"
812   EXTRA_DISTRIBUTIONS+=   lib32
813   .endif
814 + .if ${MK_TESTS} != "no"
815 + EXTRA_DISTRIBUTIONS+=   tests
816 + .endif
817  
818 < distributeworld installworld: installcheck
818 > MTREE_MAGIC?=   mtree 2.0
819 >
820 > distributeworld installworld: _installcheck_world
821          mkdir -p ${INSTALLTMP}
822 +        export PATH=${BPATH}:${PATH} ; \
823          progs=$$(for prog in ${ITOOLS}; do \
824                  if progpath=`which $$prog`; then \
825                          echo $$progpath; \
# Line 641 | Line 840 | distributeworld installworld: installcheck
840              done); \
841          cp $$libs $$progs ${INSTALLTMP}
842          cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale
843 + .if defined(NO_ROOT)
844 +        echo "#${MTREE_MAGIC}" > ${METALOG}
845 + .endif
846   .if make(distributeworld)
847   .for dist in ${EXTRA_DISTRIBUTIONS}
848          -mkdir ${DESTDIR}/${DISTDIR}/${dist}
# Line 650 | Line 852 | distributeworld installworld: installcheck
852              -p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null
853          mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
854              -p ${DESTDIR}/${DISTDIR}/${dist}/usr/include >/dev/null
855 + .if ${MK_DEBUG_FILES} != "no"
856 +        mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
857 +            -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib >/dev/null
858 + .endif
859 + .if ${MK_TESTS} != "no" && ${dist} == "tests"
860 +        -mkdir -p ${DESTDIR}/${DISTDIR}/${dist}${TESTSBASE}
861 +        mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
862 +            -p ${DESTDIR}/${DISTDIR}/${dist}${TESTSBASE} >/dev/null
863 + .endif
864 + .if defined(NO_ROOT)
865 +        ${IMAKEENV} nmtree -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \
866 +            sed -e 's#^\./#./${dist}/#' >> ${METALOG}
867 +        ${IMAKEENV} nmtree -C -f ${.CURDIR}/etc/mtree/BSD.usr.dist | \
868 +            sed -e 's#^\./#./${dist}/usr/#' >> ${METALOG}
869 +        ${IMAKEENV} nmtree -C -f ${.CURDIR}/etc/mtree/BSD.include.dist | \
870 +            sed -e 's#^\./#./${dist}/usr/include/#' >> ${METALOG}
871 + .endif
872   .endfor
873          -mkdir ${DESTDIR}/${DISTDIR}/base
874 <        ${_+_}cd ${.CURDIR}; ${IMAKE} distrib-dirs \
875 <            DESTDIR=${DESTDIR}/${DISTDIR}/base
874 >        ${_+_}cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} \
875 >            METALOG=${METALOG} ${IMAKE_INSTALL} ${IMAKE_MTREE} \
876 >            DISTBASE=/base DESTDIR=${DESTDIR}/${DISTDIR}/base \
877 >            LOCAL_MTREE=${LOCAL_MTREE:Q} distrib-dirs
878   .endif
879          ${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}; \
880              ${IMAKEENV} rm -rf ${INSTALLTMP}
881   .if make(distributeworld)
882   .for dist in ${EXTRA_DISTRIBUTIONS}
883 <        find ${DESTDIR}/${DISTDIR}/${dist} -empty -delete
883 >        find ${DESTDIR}/${DISTDIR}/${dist} -mindepth 1 -type d -empty -delete
884   .endfor
885 + .if defined(NO_ROOT)
886 + .for dist in base ${EXTRA_DISTRIBUTIONS}
887 +        @# For each file that exists in this dist, print the corresponding
888 +        @# line from the METALOG.  This relies on the fact that
889 +        @# a line containing only the filename will sort immediatly before
890 +        @# the relevant mtree line.
891 +        cd ${DESTDIR}/${DISTDIR}; \
892 +        find ./${dist} | sort -u ${METALOG} - | \
893 +        awk 'BEGIN { print "#${MTREE_MAGIC}" } !/ type=/ { file = $$1 } / type=/ { if ($$1 == file) { sub(/^\.\/${dist}\//, "./"); print } }' > \
894 +        ${DESTDIR}/${DISTDIR}/${dist}.meta
895 + .endfor
896 + .if ${MK_DEBUG_FILES} != "no"
897 + . for dist in base ${EXTRA_DISTRIBUTIONS}
898 +        @# For each file that exists in this dist, print the corresponding
899 +        @# line from the METALOG.  This relies on the fact that
900 +        @# a line containing only the filename will sort immediatly before
901 +        @# the relevant mtree line.
902 +        cd ${DESTDIR}/${DISTDIR}; \
903 +        find ./${dist}/usr/lib/debug | sort -u ${METALOG} - | \
904 +        awk 'BEGIN { print "#${MTREE_MAGIC}" } !/ type=/ { file = $$1 } / type=/ { if ($$1 == file) { sub(/^\.\/${dist}\//, "./"); print } }' > \
905 +        ${DESTDIR}/${DISTDIR}/${dist}.debug.meta
906 + . endfor
907   .endif
908 + .endif
909 + .endif
910  
911   packageworld:
912   .for dist in base ${EXTRA_DISTRIBUTIONS}
913 + .if defined(NO_ROOT)
914          ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
915 <            tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz .
915 >            tar cvf - --exclude usr/lib/debug \
916 >            @${DESTDIR}/${DISTDIR}/${dist}.meta | \
917 >            ${XZ_CMD} > ${PACKAGEDIR}/${dist}.txz
918 > .else
919 >        ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
920 >            tar cvf - --exclude usr/lib/debug . | \
921 >            ${XZ_CMD} > ${PACKAGEDIR}/${dist}.txz
922 > .endif
923   .endfor
924  
925 + .if ${MK_DEBUG_FILES} != "no"
926 + . for dist in base ${EXTRA_DISTRIBUTIONS}
927 + .  if defined(NO_ROOT)
928 +        ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
929 +            tar cvf - @${DESTDIR}/${DISTDIR}/${dist}.debug.meta | \
930 +            ${XZ_CMD} > ${PACKAGEDIR}/${dist}.debug.txz
931 + .  else
932 +        ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
933 +            tar cvLf - usr/lib/debug | \
934 +            ${XZ_CMD} > ${PACKAGEDIR}/${dist}-debug.txz
935 + .  endif
936 + . endfor
937 + .endif
938 +
939   #
940   # reinstall
941   #
# Line 676 | Line 943 | packageworld:
943   # and do a 'make reinstall' on the *client* to install new binaries from the
944   # most recent server build.
945   #
946 < reinstall:
946 > reinstall: .MAKE .PHONY
947          @echo "--------------------------------------------------------------"
948          @echo ">>> Making hierarchy"
949          @echo "--------------------------------------------------------------"
950 <        ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy
950 >        ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 \
951 >            LOCAL_MTREE=${LOCAL_MTREE:Q} hierarchy
952          @echo
953          @echo "--------------------------------------------------------------"
954          @echo ">>> Installing everything"
955          @echo "--------------------------------------------------------------"
956          ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
957 < .if ${TARGET_ARCH} == "amd64" && ${MK_LIB32} != "no"
957 > .if defined(LIB32TMP) && ${MK_LIB32} != "no"
958          ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install32
959   .endif
960  
961 < redistribute:
961 > redistribute: .MAKE .PHONY
962          @echo "--------------------------------------------------------------"
963          @echo ">>> Distributing everything"
964          @echo "--------------------------------------------------------------"
# Line 700 | Line 968 | redistribute:
968              DISTRIBUTION=lib32
969   .endif
970  
971 < distrib-dirs distribution:
972 <        cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} ${.TARGET}
971 > distrib-dirs distribution: .MAKE .PHONY
972 >        cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} \
973 >            ${IMAKE_INSTALL} ${IMAKE_MTREE} METALOG=${METALOG} ${.TARGET}
974  
975   #
976   # buildkernel and installkernel
# Line 727 | Line 996 | NO_KERNELOBJ=          t
996   KERNCONF=${KERNFAST}
997   .endif
998   .endif
999 < .if !defined(KERNCONF) && defined(KERNEL)
1000 < KERNCONF=       ${KERNEL}
732 < KERNWARN=
999 > .if ${TARGET_ARCH} == "powerpc64"
1000 > KERNCONF?=      GENERIC64
1001   .else
1002   KERNCONF?=      GENERIC
1003   .endif
# Line 742 | Line 1010 | KERNCONFDIR?=  ${KRNLCONFDIR}
1010  
1011   BUILDKERNELS=
1012   INSTALLKERNEL=
1013 + NO_INSTALLEXTRAKERNELS?= yes
1014 + .if defined(NO_INSTALLKERNEL)
1015 + # All of the BUILDKERNELS loops start at index 1.
1016 + BUILDKERNELS+= dummy
1017 + .endif
1018   .for _kernel in ${KERNCONF}
1019   .if exists(${KERNCONFDIR}/${_kernel})
1020   BUILDKERNELS+=  ${_kernel}
1021 < .if empty(INSTALLKERNEL)
1021 > .if empty(INSTALLKERNEL) && !defined(NO_INSTALLKERNEL)
1022   INSTALLKERNEL= ${_kernel}
1023   .endif
1024 + .else
1025 + .if make(buildkernel)
1026 + .error Missing KERNCONF ${KERNCONFDIR}/${_kernel}
1027   .endif
1028 + .endif
1029   .endfor
1030  
1031 + ${WMAKE_TGTS:N_worldtmp:Nbuild32} ${.ALLTARGETS:M_*:N_worldtmp}: .MAKE .PHONY
1032 +
1033   #
1034   # buildkernel
1035   #
1036   # Builds all kernels defined by BUILDKERNELS.
1037   #
1038 < buildkernel:
1039 < .if empty(BUILDKERNELS)
1038 > buildkernel: .MAKE .PHONY
1039 > .if empty(BUILDKERNELS:Ndummy)
1040          @echo "ERROR: Missing kernel configuration file(s) (${KERNCONF})."; \
1041          false
1042   .endif
764 .if defined(KERNWARN)
765        @echo "--------------------------------------------------------------"
766        @echo ">>> WARNING: KERNEL= setting should be changed to KERNCONF="
767        @echo "--------------------------------------------------------------"
768        @sleep 3
769 .endif
1043          @echo
1044 < .for _kernel in ${BUILDKERNELS}
1044 > .for _kernel in ${BUILDKERNELS:Ndummy}
1045          @echo "--------------------------------------------------------------"
1046          @echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
1047          @echo "--------------------------------------------------------------"
# Line 782 | Line 1055 | buildkernel:
1055          cd ${KRNLCONFDIR}; \
1056                  PATH=${TMPPATH} \
1057                      config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
1058 <                        ${KERNCONFDIR}/${_kernel}
1058 >                        -I '${KERNCONFDIR}' '${KERNCONFDIR}/${_kernel}'
1059   .endif
1060   .if !defined(NO_CLEAN) && !defined(NO_KERNELCLEAN)
1061          @echo
1062          @echo "--------------------------------------------------------------"
1063          @echo ">>> stage 2.1: cleaning up the object tree"
1064          @echo "--------------------------------------------------------------"
1065 <        cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} ${CLEANDIR}
1065 >        ${_+_}cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} ${CLEANDIR}
1066   .endif
1067   .if !defined(NO_KERNELOBJ)
1068          @echo
1069          @echo "--------------------------------------------------------------"
1070          @echo ">>> stage 2.2: rebuilding the object tree"
1071          @echo "--------------------------------------------------------------"
1072 <        cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} obj
1072 >        ${_+_}cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} obj
1073   .endif
1074          @echo
1075          @echo "--------------------------------------------------------------"
1076          @echo ">>> stage 2.3: build tools"
1077          @echo "--------------------------------------------------------------"
1078 <        cd ${KRNLOBJDIR}/${_kernel}; \
806 <            PATH=${BPATH}:${PATH} \
807 <            MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \
808 <            ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF \
809 <            -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile
810 < # XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case.
811 < .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules)
812 < .for target in obj depend all
813 <        cd ${KERNSRCDIR}/modules/aic7xxx/aicasm; \
814 <            PATH=${BPATH}:${PATH} \
815 <            MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \
816 <            ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF ${target}
817 < .endfor
818 < .endif
1078 >        ${_+_}cd ${.CURDIR}; ${KTMAKE} kernel-tools
1079   .if !defined(NO_KERNELDEPEND)
1080          @echo
1081          @echo "--------------------------------------------------------------"
1082          @echo ">>> stage 3.1: making dependencies"
1083          @echo "--------------------------------------------------------------"
1084 <        cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} depend -DNO_MODULES_OBJ
1084 >        ${_+_}cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} depend -DNO_MODULES_OBJ
1085   .endif
1086          @echo
1087          @echo "--------------------------------------------------------------"
1088          @echo ">>> stage 3.2: building everything"
1089          @echo "--------------------------------------------------------------"
1090 <        cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ
1090 >        ${_+_}cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ
1091          @echo "--------------------------------------------------------------"
1092          @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
1093          @echo "--------------------------------------------------------------"
# Line 839 | Line 1099 | buildkernel:
1099   # Install the kernel defined by INSTALLKERNEL
1100   #
1101   installkernel installkernel.debug \
1102 < reinstallkernel reinstallkernel.debug: installcheck
1102 > reinstallkernel reinstallkernel.debug: _installcheck_kernel
1103 > .if !defined(NO_INSTALLKERNEL)
1104   .if empty(INSTALLKERNEL)
1105          @echo "ERROR: No kernel \"${KERNCONF}\" to install."; \
1106          false
# Line 849 | Line 1110 | reinstallkernel reinstallkernel.debug: installcheck
1110          @echo "--------------------------------------------------------------"
1111          cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
1112              ${CROSSENV} PATH=${TMPPATH} \
1113 <            ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//}
1113 >            ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//}
1114 > .endif
1115 > .if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes"
1116 > .for _kernel in ${BUILDKERNELS:[2..-1]}
1117 >        @echo "--------------------------------------------------------------"
1118 >        @echo ">>> Installing kernel ${_kernel}"
1119 >        @echo "--------------------------------------------------------------"
1120 >        cd ${KRNLOBJDIR}/${_kernel}; \
1121 >            ${CROSSENV} PATH=${TMPPATH} \
1122 >            ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME}.${_kernel} ${.TARGET:S/kernel//}
1123 > .endfor
1124 > .endif
1125  
1126   distributekernel distributekernel.debug:
1127 + .if !defined(NO_INSTALLKERNEL)
1128   .if empty(INSTALLKERNEL)
1129          @echo "ERROR: No kernel \"${KERNCONF}\" to install."; \
1130          false
1131   .endif
1132 +        mkdir -p ${DESTDIR}/${DISTDIR}
1133 + .if defined(NO_ROOT)
1134 +        echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.premeta
1135 + .endif
1136          cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
1137 <            ${CROSSENV} PATH=${TMPPATH} ${MAKE} KERNEL=${INSTKERNNAME} \
1138 <            DESTDIR=${DESTDIR}/${DISTDIR}/kernel \
1137 >            ${IMAKEENV} ${IMAKE_INSTALL:S/METALOG/kernel.premeta/} \
1138 >            ${IMAKE_MTREE} PATH=${TMPPATH} ${MAKE} KERNEL=${INSTKERNNAME} \
1139 >            DESTDIR=${INSTALL_DDIR}/kernel \
1140              ${.TARGET:S/distributekernel/install/}
1141 + .if defined(NO_ROOT)
1142 +        sed -e 's|^./kernel|.|' ${DESTDIR}/${DISTDIR}/kernel.premeta > \
1143 +            ${DESTDIR}/${DISTDIR}/kernel.meta
1144 + .endif
1145 + .endif
1146 + .if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes"
1147 + .for _kernel in ${BUILDKERNELS:[2..-1]}
1148 + .if defined(NO_ROOT)
1149 +        echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta
1150 + .endif
1151 +        cd ${KRNLOBJDIR}/${_kernel}; \
1152 +            ${IMAKEENV} ${IMAKE_INSTALL:S/METALOG/kernel.${_kernel}.premeta/} \
1153 +            ${IMAKE_MTREE} PATH=${TMPPATH} ${MAKE} \
1154 +            KERNEL=${INSTKERNNAME}.${_kernel} \
1155 +            DESTDIR=${INSTALL_DDIR}/kernel.${_kernel} \
1156 +            ${.TARGET:S/distributekernel/install/}
1157 + .if defined(NO_ROOT)
1158 +        sed -e 's|^./kernel|.|' \
1159 +            ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta > \
1160 +            ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta
1161 + .endif
1162 + .endfor
1163 + .endif
1164  
1165   packagekernel:
1166 <        ${_+_}cd ${DESTDIR}/${DISTDIR}/kernel; \
1167 <            tar cvJf ${DESTDIR}/${DISTDIR}/kernel.txz .
1166 > .if defined(NO_ROOT)
1167 > .if !defined(NO_INSTALLKERNEL)
1168 >        cd ${DESTDIR}/${DISTDIR}/kernel; \
1169 >            tar cvf - @${DESTDIR}/${DISTDIR}/kernel.meta | \
1170 >            ${XZ_CMD} > ${PACKAGEDIR}/kernel.txz
1171 > .endif
1172 > .if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes"
1173 > .for _kernel in ${BUILDKERNELS:[2..-1]}
1174 >        cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \
1175 >            tar cvf - @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \
1176 >            ${XZ_CMD} > ${PACKAGEDIR}/kernel.${_kernel}.txz
1177 > .endfor
1178 > .endif
1179 > .else
1180 > .if !defined(NO_INSTALLKERNEL)
1181 >        cd ${DESTDIR}/${DISTDIR}/kernel; \
1182 >            tar cvf - . | \
1183 >            ${XZ_CMD} > ${PACKAGEDIR}/kernel.txz
1184 > .endif
1185 > .if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes"
1186 > .for _kernel in ${BUILDKERNELS:[2..-1]}
1187 >        cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \
1188 >            tar cvf - . | \
1189 >            ${XZ_CMD} > ${PACKAGEDIR}/kernel.${_kernel}.txz
1190 > .endfor
1191 > .endif
1192 > .endif
1193  
1194   #
1195 + #
1196 + # checkworld
1197 + #
1198 + # Run test suite on installed world.
1199 + #
1200 + checkworld: .PHONY
1201 +        @if [ ! -x "${LOCALBASE}/bin/kyua" ]; then \
1202 +                echo "You need kyua (devel/kyua) to run the test suite." | /usr/bin/fmt; \
1203 +                exit 1; \
1204 +        fi
1205 +        ${_+_}PATH="$$PATH:${LOCALBASE}/bin" kyua test -k ${TESTSBASE}/Kyuafile
1206 +
1207 + #
1208 + #
1209   # doxygen
1210   #
1211   # Build the API documentation with doxygen
1212   #
1213 < doxygen:
1214 <        @if [ ! -x `/usr/bin/which doxygen` ]; then \
1213 > doxygen: .PHONY
1214 >        @if [ ! -x "${LOCALBASE}/bin/doxygen" ]; then \
1215                  echo "You need doxygen (devel/doxygen) to generate the API documentation of the kernel." | /usr/bin/fmt; \
1216                  exit 1; \
1217          fi
1218 <        cd ${.CURDIR}/tools/kerneldoc/subsys && ${MAKE} obj all
1218 >        ${_+_}cd ${.CURDIR}/tools/kerneldoc/subsys; ${MAKE} obj all
1219  
1220   #
1221   # update
1222   #
1223 < # Update the source tree, by running cvsup and/or running cvs to update to the
1223 > # Update the source tree(s), by running svn/svnup to update to the
1224   # latest copy.
1225   #
1226   update:
1227 < .if defined(SUP_UPDATE)
1227 > .if (defined(CVS_UPDATE) || defined(SUP_UPDATE)) && !defined(SVN_UPDATE)
1228          @echo "--------------------------------------------------------------"
1229 <        @echo ">>> Running ${SUP}"
1229 >        @echo "CVS_UPDATE and SUP_UPDATE are no longer supported."
1230 >        @echo "Please see: https://wiki.freebsd.org/CvsIsDeprecated"
1231          @echo "--------------------------------------------------------------"
1232 < .if defined(SUPFILE)
892 <        @${SUP} ${SUPFLAGS} ${SUPFILE}
1232 >        @exit 1
1233   .endif
1234 < .if defined(SUPFILE1)
895 <        @${SUP} ${SUPFLAGS} ${SUPFILE1}
896 < .endif
897 < .if defined(SUPFILE2)
898 <        @${SUP} ${SUPFLAGS} ${SUPFILE2}
899 < .endif
900 < .if defined(PORTSSUPFILE) && !defined(NO_PORTSUPDATE)
901 <        @${SUP} ${SUPFLAGS} ${PORTSSUPFILE}
902 < .endif
903 < .if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE)
904 <        @${SUP} ${SUPFLAGS} ${DOCSUPFILE}
905 < .endif
906 < .endif
907 < .if defined(CVS_UPDATE)
1234 > .if defined(SVN_UPDATE)
1235          @echo "--------------------------------------------------------------"
1236 <        @echo ">>> Updating ${.CURDIR} from CVS repository" ${CVSROOT}
1236 >        @echo ">>> Updating ${.CURDIR} using Subversion"
1237          @echo "--------------------------------------------------------------"
1238 <        cd ${.CURDIR}; ${CVS} -R -q update ${CVSFLAGS}
1238 >        @(cd ${.CURDIR}; ${SVN} update ${SVNFLAGS})
1239   .endif
1240  
1241   #
# Line 926 | Line 1253 | update:
1253   # legacy: Build compatibility shims for the next three targets
1254   #
1255   legacy:
1256 + .if ${BOOTSTRAPPING} < 7000 && ${BOOTSTRAPPING} != 0
1257 +        @echo "ERROR: Source upgrades from versions prior to 0.7 not supported."; \
1258 +        false
1259 + .endif
1260   .for _tool in tools/build
1261          ${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,depend,all,install)"; \
1262              cd ${.CURDIR}/${_tool}; \
# Line 939 | Line 1270 | legacy:
1270   #
1271   # bootstrap-tools: Build tools needed for compatibility
1272   #
1273 + _bt=            _bootstrap-tools        
1274 +
1275   .if ${MK_GAMES} != "no"
1276   _strfile=       games/fortune/strfile
1277   .endif
1278  
1279   .if ${MK_CXX} != "no"
1280   _gperf=         gnu/usr.bin/gperf
948 .if ${BOOTSTRAPPING} < 700004
949 _groff=         gnu/usr.bin/groff
950 .else
951 _groff=         gnu/usr.bin/groff/tmac
1281   .endif
1282 +
1283 + .if ${MK_VT} != "no"
1284 + _vtfontcvt=     usr.bin/vtfontcvt
1285   .endif
1286  
1287 < .if ${BOOTSTRAPPING} < 700018
1287 > .if ${BOOTSTRAPPING} < 800022
1288 > _ar=            usr.bin/ar
1289 > .endif
1290 >
1291 > .if ${BOOTSTRAPPING} < 800013
1292 > _mklocale=      usr.bin/mklocale
1293 > .endif
1294 >
1295 > .if ${BOOTSTRAPPING} < 900002
1296 > _sed=           usr.bin/sed
1297 > .endif
1298 >
1299 > .if ${BOOTSTRAPPING} < 1000033
1300 > _m4=            usr.bin/m4
1301 > _lex=           usr.bin/lex
1302 >
1303 > ${_bt}-usr.bin/lex: ${_bt}-usr.bin/m4
1304 > .endif
1305 >
1306 > .if ${BOOTSTRAPPING} < 1001506
1307 > _yacc=          lib/liby \
1308 >                usr.bin/yacc
1309 >
1310 > ${_bt}-usr.bin/yacc: ${_bt}-lib/liby
1311 > .endif
1312 >
1313 > # crunchgen broken on head with STRIP= for a while, even
1314 > # when building stable binaries, so bootstrap there too.
1315 > # r284356 to r285986 is the broken range.
1316 > .if ${BOOTSTRAPPING} < 1000014 || \
1317 >        (${BOOTSTRAPPING} > 1100076 && ${BOOTSTRAPPING} < 1100078)
1318 > _crunch=        usr.sbin/crunch
1319 > .endif
1320 >
1321 > # r245440 mtree -N support added
1322 > # r313404 requires sha384.h for libnetbsd, added to libmd in r292782
1323 > .if ${BOOTSTRAPPING} < 1003512
1324 > _nmtree=        lib/libmd \
1325 >                lib/libnetbsd \
1326 >                usr.sbin/nmtree
1327 >
1328 > ${_bt}-lib/libnetbsd: ${_bt}-lib/libmd
1329 > ${_bt}-usr.sbin/nmtree: ${_bt}-lib/libnetbsd
1330 > .endif
1331 >
1332 > .if ${BOOTSTRAPPING} < 1000027
1333 > _cat=           bin/cat
1334 > .endif
1335 >
1336 > .if ${BOOTSTRAPPING} >= 900040 && ${BOOTSTRAPPING} < 900041
1337 > _awk=           usr.bin/awk
1338 > .endif
1339 >
1340 > # r296926 -P keymap search path, MFC to stable/10 in r298297
1341 > .if ${BOOTSTRAPPING} < 1003501 || \
1342 >        (${BOOTSTRAPPING} >= 1100000 && ${BOOTSTRAPPING} < 1100103)
1343 > _kbdcontrol=    usr.sbin/kbdcontrol
1344 > .endif
1345 >
1346 > .if ${MK_BSNMP} != "no"
1347   _gensnmptree=   usr.sbin/bsnmpd/gensnmptree
1348   .endif
1349  
1350 < .if ${MK_RESCUE} != "no" && \
1351 <    ${BOOTSTRAPPING} < 700026
1352 < _crunchgen=     usr.sbin/crunch/crunchgen
1350 > .if ${MK_CLANG} != "no"
1351 > _clang_tblgen= \
1352 >        lib/clang/libllvmsupport \
1353 >        lib/clang/libllvmtablegen \
1354 >        usr.bin/clang/tblgen \
1355 >        usr.bin/clang/clang-tblgen
1356 >
1357 > ${_bt}-usr.bin/clang/clang-tblgen: ${_bt}-lib/clang/libllvmtablegen ${_bt}-lib/clang/libllvmsupport
1358 > ${_bt}-usr.bin/clang/tblgen: ${_bt}-lib/clang/libllvmtablegen ${_bt}-lib/clang/libllvmsupport
1359   .endif
1360  
1361 < bootstrap-tools:
1361 > # Rebuild ctfconvert and ctfmerge to avoid difficult-to-diagnose failures
1362 > # resulting from missing bug fixes or ELF Toolchain updates.
1363 > .if ${MK_CDDL} != "no"
1364 > _dtrace_tools= cddl/lib/libctf lib/libelf \
1365 >    lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge
1366 >
1367 > ${_bt}-cddl/usr.bin/ctfconvert: ${_bt}-lib/libelf ${_bt}-lib/libdwarf ${_bt}-cddl/lib/libctf
1368 > ${_bt}-cddl/usr.bin/ctfmerge: ${_bt}-lib/libelf ${_bt}-lib/libdwarf ${_bt}-cddl/lib/libctf
1369 > .endif
1370 >
1371 > # Default to building the GPL DTC, but build the BSDL one if users explicitly
1372 > # request it.
1373 > _dtc= usr.bin/dtc
1374 > .if ${MK_GPL_DTC} != "no"
1375 > _dtc= gnu/usr.bin/dtc
1376 > .endif
1377 >
1378 > .if ${MK_KERBEROS} != "no"
1379 > _kerberos5_bootstrap_tools= \
1380 >        kerberos5/tools/make-roken \
1381 >        kerberos5/lib/libroken \
1382 >        kerberos5/lib/libvers \
1383 >        kerberos5/tools/asn1_compile \
1384 >        kerberos5/tools/slc \
1385 >        usr.bin/compile_et
1386 >
1387 > .ORDER: ${_kerberos5_bootstrap_tools:C/^/${_bt}-/g}
1388 > .endif
1389 >
1390 > .if ${_BOOTSTRAP_MAKEINFO} != "no"
1391 > _texinfo=       gnu/usr.bin/texinfo/libtxi \
1392 >                gnu/usr.bin/texinfo/makeinfo \
1393 >                gnu/usr.bin/texinfo/install-info
1394 >
1395 > ${_bt}-gnu/usr.bin/texinfo/install-info: ${_bt}-gnu/usr.bin/texinfo/libtxi
1396 > ${_bt}-gnu/usr.bin/texinfo/makeinfo: ${_bt}-gnu/usr.bin/texinfo/libtxi
1397 > .endif
1398 > bootstrap-tools: .PHONY
1399 >
1400 > #       Please document (add comment) why something is in 'bootstrap-tools'.
1401 > #       Try to bound the building of the bootstrap-tool to just the
1402 > #       MidnightBSD versions that need the tool built at this stage of the build.
1403   .for _tool in \
1404 +    ${_clang_tblgen} \
1405 +    ${_kerberos5_bootstrap_tools} \
1406 +    ${_dtrace_tools} \
1407      ${_strfile} \
1408      ${_gperf} \
1409 <    ${_groff} \
1409 >    ${_ar} \
1410 >    ${_dtc} \
1411 >    ${_awk} \
1412 >    ${_cat} \
1413 >    ${_kbdcontrol} \
1414      usr.bin/lorder \
1415      usr.bin/makewhatis \
1416 +    ${_mklocale} \
1417      usr.bin/rpcgen \
1418 +    ${_sed} \
1419 +    ${_yacc} \
1420 +    ${_m4} \
1421 +    ${_lex} \
1422      usr.bin/xinstall \
1423      ${_gensnmptree} \
1424      usr.sbin/config \
1425 <    ${_crunchgen}
1425 >    ${_crunch} \
1426 >    ${_nmtree} \
1427 >    ${_texinfo} \
1428 >    ${_vtfontcvt}
1429 > ${_bt}-${_tool}: .PHONY .MAKE
1430          ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
1431                  cd ${.CURDIR}/${_tool}; \
1432                  ${MAKE} DIRPRFX=${_tool}/ obj; \
1433                  ${MAKE} DIRPRFX=${_tool}/ depend; \
1434                  ${MAKE} DIRPRFX=${_tool}/ all; \
1435                  ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install
1436 +
1437 + bootstrap-tools: ${_bt}-${_tool}
1438   .endfor
1439  
1440   #
1441   # build-tools: Build special purpose build tools
1442   #
987 .if defined(MODULES_WITH_WORLD) && exists(${KERNSRCDIR}/modules)
988 _aicasm= sys/modules/aic7xxx/aicasm
989 .endif
990
1443   .if !defined(NO_SHARE)
1444   _share= share/syscons/scrnmaps
1445   .endif
1446  
1447 < .if ${MK_KERBEROS} != "no"
1448 < _kerberos5_tools= kerberos5/tools
1447 > .if ${MK_GCC} != "no"
1448 > _gcc_tools= gnu/usr.bin/cc/cc_tools
1449   .endif
1450  
1451   .if ${MK_RESCUE} != "no"
1452   _rescue= rescue/rescue
1453   .endif
1454  
1455 < build-tools:
1455 > .if ${MK_TCSH} != "no"
1456 > _tcsh=bin/csh
1457 > .endif
1458 >
1459 > build-tools: .MAKE
1460   .for _tool in \
1461 <    bin/csh \
1461 >    ${_tcsh} \
1462      bin/sh \
1463      ${_rescue} \
1464      ${LOCAL_TOOL_DIRS} \
1465      lib/ncurses/ncurses \
1466      lib/ncurses/ncursesw \
1467      ${_share} \
1012    ${_aicasm} \
1468      usr.bin/awk \
1469      lib/libmagic \
1470 <    usr.sbin/sysinstall
1470 >    usr.bin/mkesdb_static \
1471 >    usr.bin/mkcsmapper_static \
1472 >    usr.bin/vi/catalog
1473          ${_+_}@${ECHODIR} "===> ${_tool} (obj,build-tools)"; \
1474                  cd ${.CURDIR}/${_tool}; \
1475                  ${MAKE} DIRPRFX=${_tool}/ obj; \
1476                  ${MAKE} DIRPRFX=${_tool}/ build-tools
1477   .endfor
1478   .for _tool in \
1479 <    gnu/usr.bin/cc/cc_tools \
1023 <    ${_kerberos5_tools}
1479 >    ${_gcc_tools}
1480          ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all)"; \
1481                  cd ${.CURDIR}/${_tool}; \
1482                  ${MAKE} DIRPRFX=${_tool}/ obj; \
# Line 1028 | Line 1484 | build-tools:
1484                  ${MAKE} DIRPRFX=${_tool}/ all
1485   .endfor
1486  
1487 +
1488   #
1489 + # kernel-tools: Build kernel-building tools
1490 + #
1491 + kernel-tools:
1492 +        mkdir -p ${MAKEOBJDIRPREFIX}/usr
1493 +        mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
1494 +            -p ${MAKEOBJDIRPREFIX}/usr >/dev/null
1495 +
1496 + #
1497   # cross-tools: Build cross-building tools
1498   #
1499 < .if ${TARGET_ARCH} != ${MACHINE_ARCH}
1499 > .if !defined(TARGET_ARCH) && defined(XDEV_ARCH)
1500 > TARGET_ARCH=    ${XDEV_ARCH}
1501 > .endif
1502 > .if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${BOOTSTRAPPING} < 800035
1503   .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386"
1504   _btxld=         usr.sbin/btxld
1505   .endif
1506 + .endif
1507 + .if ${TARGET_ARCH} != ${MACHINE_ARCH}
1508   .if ${MK_RESCUE} != "no" || defined(RELEASEDIR)
1509   _crunchide=     usr.sbin/crunch/crunchide
1510   .endif
# Line 1043 | Line 1513 | _kgzip=                usr.sbin/kgzip
1513   .endif
1514   .endif
1515  
1516 < cross-tools:
1516 > .if ${XAS:M/*} == "" && ${MK_BINUTILS} != "no"
1517 > _binutils=      gnu/usr.bin/binutils
1518 > .endif
1519 >
1520 > # If an full path to an external cross compiler is given, don't build
1521 > # a cross compiler.
1522 > .if ${XCC:M/*} == "" && ${MK_CROSS_COMPILER} != "no"
1523 > .if ${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang"
1524 > _clang=         usr.bin/clang
1525 > _clang_libs=    lib/clang
1526 > .else
1527 > _gcc=           gnu/usr.bin/cc
1528 > .endif
1529 >
1530 > # The boot2 for pc98 requires gcc.
1531 > .if ${TARGET} == "pc98"
1532 > _gcc=           gnu/usr.bin/cc
1533 > .endif
1534 > .endif
1535 >
1536 > cross-tools: .MAKE .PHONY
1537   .for _tool in \
1538 <    gnu/usr.bin/binutils \
1539 <    gnu/usr.bin/cc \
1540 <    usr.bin/sed \
1538 >    ${_clang_libs} \
1539 >    ${_clang} \
1540 >    ${_binutils} \
1541 >    ${_gcc} \
1542      usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \
1543      ${_btxld} \
1544      ${_crunchide} \
# Line 1060 | Line 1551 | cross-tools:
1551                  ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
1552   .endfor
1553  
1554 + NXBDESTDIR=     ${OBJTREE}/nxb-bin
1555 + NXBENV=         MAKEOBJDIRPREFIX=${OBJTREE}/nxb \
1556 +                INSTALL="sh ${.CURDIR}/tools/install.sh" \
1557 +                VERSION="${VERSION}"
1558 + NXBMAKE=        ${NXBENV} ${MAKE} \
1559 +                TBLGEN=${NXBDESTDIR}/usr/bin/tblgen \
1560 +                CLANG_TBLGEN=${NXBDESTDIR}/usr/bin/clang-tblgen \
1561 +                MACHINE=${TARGET} MACHINE_ARCH=${TARGET_ARCH} \
1562 +                -DWITHOUT_GDB -DNO_TESTS \
1563 +                SSP_CFLAGS= \
1564 +                -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \
1565 +                -DNO_PIC -DNO_PROFILE -DNO_SHARED \
1566 +                -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF \
1567 +                -DWITHOUT_CLANG_FULL -DWITHOUT_LLDB
1568 +
1569 + native-xtools: .PHONY
1570 +        mkdir -p ${NXBDESTDIR}/bin ${NXBDESTDIR}/sbin ${NXBDESTDIR}/usr
1571 +        mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
1572 +            -p ${NXBDESTDIR}/usr >/dev/null
1573 +        mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
1574 +            -p ${NXBDESTDIR}/usr/include >/dev/null
1575 + .for _tool in \
1576 +    bin/cat \
1577 +    bin/chmod \
1578 +    bin/cp \
1579 +    ${_tcsh} \
1580 +    bin/echo \
1581 +    bin/expr \
1582 +    bin/hostname \
1583 +    bin/ln \
1584 +    bin/ls \
1585 +    bin/mkdir \
1586 +    bin/mv \
1587 +    bin/ps \
1588 +    bin/realpath \
1589 +    bin/rm \
1590 +    bin/rmdir \
1591 +    bin/sh \
1592 +    bin/sleep \
1593 +    ${_clang_tblgen} \
1594 +    usr.bin/ar \
1595 +    ${_binutils} \
1596 +    ${_gcc} \
1597 +    ${_gcc_tools} \
1598 +    ${_clang_libs} \
1599 +    ${_clang} \
1600 +    sbin/md5 \
1601 +    sbin/sysctl \
1602 +    gnu/usr.bin/diff \
1603 +    usr.bin/awk \
1604 +    usr.bin/basename \
1605 +    usr.bin/bmake \
1606 +    usr.bin/bzip2 \
1607 +    usr.bin/cmp \
1608 +    usr.bin/dirname \
1609 +    usr.bin/env \
1610 +    usr.bin/fetch \
1611 +    usr.bin/find \
1612 +    usr.bin/grep \
1613 +    usr.bin/gzip \
1614 +    usr.bin/id \
1615 +    usr.bin/lex \
1616 +    usr.bin/lorder \
1617 +    usr.bin/mktemp \
1618 +    usr.bin/mt \
1619 +    usr.bin/patch \
1620 +    usr.bin/sed \
1621 +    usr.bin/sort \
1622 +    usr.bin/tar \
1623 +    usr.bin/touch \
1624 +    usr.bin/tr \
1625 +    usr.bin/true \
1626 +    usr.bin/uniq \
1627 +    usr.bin/unzip \
1628 +    usr.bin/xargs \
1629 +    usr.bin/xinstall \
1630 +    usr.bin/xz \
1631 +    usr.bin/yacc \
1632 +    usr.sbin/chown
1633 +        ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
1634 +                cd ${.CURDIR}/${_tool}; \
1635 +                ${NXBMAKE} DIRPRFX=${_tool}/ obj; \
1636 +                ${NXBMAKE} DIRPRFX=${_tool}/ depend; \
1637 +                ${NXBMAKE} DIRPRFX=${_tool}/ all; \
1638 +                ${NXBMAKE} DIRPRFX=${_tool}/ DESTDIR=${NXBDESTDIR} install
1639 + .endfor
1640 +
1641   #
1642   # hierarchy - ensure that all the needed directories are present
1643   #
1644 < hierarchy:
1645 <        cd ${.CURDIR}/etc;              ${MAKE} distrib-dirs
1644 > hierarchy hier: .MAKE .PHONY
1645 >        ${_+_}cd ${.CURDIR}/etc; ${HMAKE} distrib-dirs
1646  
1647   #
1648   # libraries - build all libraries, and install them under ${DESTDIR}.
# Line 1073 | Line 1651 | hierarchy:
1651   # interdependencies (__L) are built automatically by the
1652   # ${.CURDIR}/tools/make_libdeps.sh script.
1653   #
1654 < libraries:
1655 <        cd ${.CURDIR}; \
1654 > libraries: .MAKE .PHONY
1655 >        ${_+_}cd ${.CURDIR}; \
1656              ${MAKE} -f Makefile.inc1 _prereq_libs; \
1657              ${MAKE} -f Makefile.inc1 _startup_libs; \
1658              ${MAKE} -f Makefile.inc1 _prebuild_libs; \
1659 <            ${MAKE} -f Makefile.inc1 _generic_libs;
1659 >            ${MAKE} -f Makefile.inc1 _generic_libs
1660  
1661   #
1662   # static libgcc.a prerequisite for shared libc
1663   #
1664 < _prereq_libs= gnu/lib/libssp/libssp_nonshared gnu/lib/libgcc
1664 > _prereq_libs= gnu/lib/libssp/libssp_nonshared gnu/lib/libgcc lib/libcompiler_rt
1665  
1666   # These dependencies are not automatically generated:
1667   #
# Line 1091 | Line 1669 | _prereq_libs= gnu/lib/libssp/libssp_nonshared gnu/lib/
1669   # all shared libraries for ELF.
1670   #
1671   _startup_libs=  gnu/lib/csu
1672 < .if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf)
1095 < _startup_libs+= lib/csu/${MACHINE_ARCH}-elf
1096 < .else
1097 < _startup_libs+= lib/csu/${MACHINE_ARCH}
1098 < .endif
1672 > _startup_libs+= lib/csu
1673   _startup_libs+= gnu/lib/libgcc
1674 + _startup_libs+= lib/libcompiler_rt
1675   _startup_libs+= lib/libc
1676 + _startup_libs+= lib/libc_nonshared
1677 + .if ${MK_LIBCPLUSPLUS} != "no"
1678 + _startup_libs+= lib/libcxxrt
1679 + .endif
1680  
1681   gnu/lib/libgcc__L: lib/libc__L
1682 + gnu/lib/libgcc__L: lib/libc_nonshared__L
1683 + .if ${MK_LIBCPLUSPLUS} != "no"
1684 + lib/libcxxrt__L: gnu/lib/libgcc__L
1685 + .endif
1686  
1687 < _prebuild_libs= ${_kerberos5_lib_libasn1} ${_kerberos5_lib_libkrb5} \
1687 > _prebuild_libs= ${_kerberos5_lib_libasn1} \
1688 >                ${_kerberos5_lib_libhdb} \
1689 >                ${_kerberos5_lib_libheimbase} \
1690 >                ${_kerberos5_lib_libheimntlm} \
1691 >                ${_kerberos5_lib_libheimsqlite} \
1692 >                ${_kerberos5_lib_libheimipcc} \
1693 >                ${_kerberos5_lib_libhx509} ${_kerberos5_lib_libkrb5} \
1694                  ${_kerberos5_lib_libroken} \
1695 <                lib/libbz2 lib/libcom_err lib/libcrypt \
1696 <                lib/libexpat \
1695 >                ${_kerberos5_lib_libwind} \
1696 >                ${_lib_atf} \
1697 >                lib/libbz2 ${_libcom_err} lib/libcrypt \
1698 >                lib/libelf lib/libexpat \
1699 >                lib/libfigpar \
1700                  ${_lib_libgssapi} ${_lib_libipx} \
1701 <                lib/libkiconv lib/libkvm lib/libmd \
1701 >                lib/libkiconv lib/libkvm lib/liblzma lib/libmd \
1702                  lib/ncurses/ncurses lib/ncurses/ncursesw \
1703 <                lib/libopie lib/libpam ${_default_thread_lib} \
1704 <                lib/libradius lib/libsbuf lib/libtacplus lib/libutil \
1705 <                ${_lib_libypclnt} lib/libz lib/msun \
1706 <                ${_secure_lib_libcrypto} ${_secure_lib_libssh} \
1707 <                ${_secure_lib_libssl} lib/libsqlite3 lib/liblzma \
1708 <                lib/libarchive lib/libfetch lib/libmagic
1703 >                lib/libopie lib/libpam ${_lib_libthr} \
1704 >                ${_lib_libradius} lib/libsbuf lib/libtacplus \
1705 >                lib/libgeom \
1706 >                ${_cddl_lib_libumem} ${_cddl_lib_libnvpair} \
1707 >                ${_cddl_lib_libuutil} \
1708 >                ${_cddl_lib_libavl} \
1709 >                ${_cddl_lib_libzfs_core} \
1710 >                lib/libutil ${_lib_libypclnt} lib/libz lib/msun \
1711 >                ${_secure_lib_libcrypto} ${_lib_libldns} \
1712 >                ${_secure_lib_libssh} ${_secure_lib_libssl} \
1713 >                lib/libblocksruntime lib/libarchive lib/libfetch lib/libsqlite3 \
1714 >                lib/libdispatch lib/libmagic
1715 > .if ${MK_GNUCXX} != no
1716 > _prebuild_libs+= gnu/lib/libstdc++ gnu/lib/libsupc++
1717 > gnu/lib/libstdc++__L: lib/msun__L
1718 > .endif
1719  
1720 < .if ${MK_LIBTHR} != "no" && ${MK_LIBKSE} != "no"
1721 < _default_thread_lib=    lib/${DEFAULT_THREAD_LIB}
1722 < .elif ${MK_LIBTHR} != "no"
1121 < _default_thread_lib=    lib/libthr
1122 < .elif ${MK_LIBKSE} != "no"
1123 < _default_thread_lib=    lib/libkse
1720 > .if ${MK_DIALOG} != "no"
1721 > _prebuild_libs+= gnu/lib/libdialog
1722 > gnu/lib/libdialog__L: lib/msun__L lib/ncurses/ncursesw__L
1723   .endif
1724  
1725 < _generic_libs=  ${_apache_lib} ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} usr.bin/lex/lib
1725 > .if ${MK_LIBCPLUSPLUS} != "no"
1726 > _prebuild_libs+= lib/libc++
1727 > .endif
1728  
1729 < lib/libopie__L lib/libtacplus__L: lib/libmd__L
1729 > lib/libgeom__L: lib/libexpat__L
1730  
1731 < .if ${MK_APACHE} != "no"
1732 < _apache_lib= apache/lib
1731 > .if defined(WITH_ATF) || ${MK_TESTS} != "no"
1732 > .if !defined(WITH_ATF)
1733 > # Ensure that the ATF libraries will be built during make libraries, even
1734 > # though they will have -DNO_TESTS
1735 > MAKE+=          -DWITH_ATF
1736   .endif
1737 + _lib_atf=       lib/atf
1738 + .if ${MK_GNUCXX} != no
1739 + lib/atf__L: gnu/lib/libstdc++__L
1740 + .endif
1741 + .if ${MK_LIBCPLUSPLUS} != "no"
1742 + lib/atf__L: lib/libc++__L lib/msun__L
1743 + .endif
1744 + .endif
1745  
1746 + .if ${MK_LIBTHR} != "no"
1747 + _lib_libthr=    lib/libthr
1748 + .endif
1749 +
1750 + .if ${MK_RADIUS_SUPPORT} != "no"
1751 + _lib_libradius= lib/libradius
1752 + .endif
1753 +
1754 + .if ${MK_OFED} != "no"
1755 + _ofed_lib=      contrib/ofed/usr.lib/
1756 + .endif
1757 +
1758 + lib/liblzma__L lib/libdispatch__L: lib/libthr__L
1759 + lib/libfetch__L: secure/lib/libssl__L
1760 +
1761 + _generic_libs=  ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} usr.bin/lex/lib ${_ofed_lib}
1762 + .for _DIR in ${LOCAL_LIB_DIRS}
1763 + .if exists(${.CURDIR}/${_DIR}/Makefile)
1764 + _generic_libs+= ${_DIR}
1765 + .endif
1766 + .endfor
1767 +
1768 + lib/libopie__L lib/libtacplus__L: lib/libmd__L
1769 +
1770   .if ${MK_CDDL} != "no"
1771 + _cddl_lib_libumem= cddl/lib/libumem
1772 + _cddl_lib_libnvpair= cddl/lib/libnvpair
1773 + _cddl_lib_libavl= cddl/lib/libavl
1774 + _cddl_lib_libuutil= cddl/lib/libuutil
1775 + _cddl_lib_libzfs_core= cddl/lib/libzfs_core
1776   _cddl_lib= cddl/lib
1777 + cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L
1778 + cddl/lib/libzfs__L: lib/libgeom__L
1779   .endif
1780  
1781   .if ${MK_CRYPT} != "no"
# Line 1140 | Line 1783 | _cddl_lib= cddl/lib
1783   _secure_lib_libcrypto= secure/lib/libcrypto
1784   _secure_lib_libssl= secure/lib/libssl
1785   lib/libradius__L secure/lib/libssl__L: secure/lib/libcrypto__L
1786 + .if ${MK_LDNS} != "no"
1787 + _lib_libldns= lib/libldns
1788 + lib/libldns__L: secure/lib/libcrypto__L
1789 + .endif
1790   .if ${MK_OPENSSH} != "no"
1791   _secure_lib_libssh= secure/lib/libssh
1792   secure/lib/libssh__L: lib/libz__L secure/lib/libcrypto__L lib/libcrypt__L
1793 < .if ${MK_KERBEROS} != "no"
1793 > .if ${MK_LDNS} != "no"
1794 > secure/lib/libssh__L: lib/libldns__L
1795 > .endif
1796 > .if ${MK_GSSAPI} != "no" && ${MK_KERBEROS_SUPPORT} != "no"
1797   secure/lib/libssh__L: lib/libgssapi__L kerberos5/lib/libkrb5__L \
1798 <    kerberos5/lib/libasn1__L lib/libcom_err__L lib/libmd__L \
1799 <    kerberos5/lib/libroken__L
1798 >    kerberos5/lib/libhx509__L kerberos5/lib/libasn1__L lib/libcom_err__L \
1799 >    lib/libmd__L kerberos5/lib/libroken__L
1800   .endif
1801   .endif
1802   .endif
1803   _secure_lib=    secure/lib
1804   .endif
1805  
1806 + .if ${MK_KERBEROS} != "no"
1807 + kerberos5/lib/libasn1__L: lib/libcom_err__L kerberos5/lib/libroken__L
1808 + kerberos5/lib/libhdb__L: kerberos5/lib/libasn1__L lib/libcom_err__L \
1809 +    kerberos5/lib/libkrb5__L kerberos5/lib/libroken__L \
1810 +    kerberos5/lib/libwind__L kerberos5/lib/libheimsqlite__L
1811 + kerberos5/lib/libheimntlm__L: secure/lib/libcrypto__L kerberos5/lib/libkrb5__L \
1812 +    kerberos5/lib/libroken__L lib/libcom_err__L
1813 + kerberos5/lib/libhx509__L: kerberos5/lib/libasn1__L lib/libcom_err__L \
1814 +    secure/lib/libcrypto__L kerberos5/lib/libroken__L kerberos5/lib/libwind__L
1815 + kerberos5/lib/libkrb5__L: kerberos5/lib/libasn1__L lib/libcom_err__L \
1816 +    lib/libcrypt__L secure/lib/libcrypto__L kerberos5/lib/libhx509__L \
1817 +    kerberos5/lib/libroken__L kerberos5/lib/libwind__L \
1818 +    kerberos5/lib/libheimbase__L kerberos5/lib/libheimipcc__L
1819 + kerberos5/lib/libroken__L: lib/libcrypt__L
1820 + kerberos5/lib/libwind__L: kerberos5/lib/libroken__L lib/libcom_err__L
1821 + kerberos5/lib/libheimbase__L: lib/libthr__L
1822 + kerberos5/lib/libheimipcc__L: kerberos5/lib/libroken__L kerberos5/lib/libheimbase__L lib/libthr__L
1823 + kerberos5/lib/libheimsqlite__L: lib/libthr__L
1824 + .endif
1825 +
1826 + .if ${MK_GSSAPI} != "no"
1827 + _lib_libgssapi= lib/libgssapi
1828 + .endif
1829 +
1830   .if ${MK_IPX} != "no"
1831   _lib_libipx=    lib/libipx
1832   .endif
# Line 1160 | Line 1834 | _lib_libipx=   lib/libipx
1834   .if ${MK_KERBEROS} != "no"
1835   _kerberos5_lib= kerberos5/lib
1836   _kerberos5_lib_libasn1= kerberos5/lib/libasn1
1837 + _kerberos5_lib_libhdb= kerberos5/lib/libhdb
1838 + _kerberos5_lib_libheimbase= kerberos5/lib/libheimbase
1839   _kerberos5_lib_libkrb5= kerberos5/lib/libkrb5
1840 + _kerberos5_lib_libhx509= kerberos5/lib/libhx509
1841   _kerberos5_lib_libroken= kerberos5/lib/libroken
1842 < _lib_libgssapi= lib/libgssapi
1842 > _kerberos5_lib_libheimntlm= kerberos5/lib/libheimntlm
1843 > _kerberos5_lib_libheimsqlite= kerberos5/lib/libheimsqlite
1844 > _kerberos5_lib_libheimipcc= kerberos5/lib/libheimipcc
1845 > _kerberos5_lib_libwind= kerberos5/lib/libwind
1846 > _libcom_err= lib/libcom_err
1847   .endif
1848  
1849   .if ${MK_NIS} != "no"
# Line 1174 | Line 1855 | lib/libradius__L: lib/libmd__L
1855   .endif
1856  
1857   .for _lib in ${_prereq_libs}
1858 < ${_lib}__PL: .PHONY
1858 > ${_lib}__PL: .PHONY .MAKE
1859   .if exists(${.CURDIR}/${_lib})
1860          ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \
1861                  cd ${.CURDIR}/${_lib}; \
1862 <                ${MAKE} DIRPRFX=${_lib}/ obj; \
1863 <                ${MAKE} DIRPRFX=${_lib}/ depend; \
1864 <                ${MAKE} -DWITHOUT_PROFILE -DNO_PIC DIRPRFX=${_lib}/ all; \
1865 <                ${MAKE} -DWITHOUT_PROFILE -DNO_PIC DIRPRFX=${_lib}/ install
1862 >                ${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ obj; \
1863 >                ${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ depend; \
1864 >                ${MAKE} -DNO_TESTS -DNO_PROFILE -DNO_PIC \
1865 >                    DIRPRFX=${_lib}/ all; \
1866 >                ${MAKE} -DNO_TESTS -DNO_PROFILE -DNO_PIC \
1867 >                    DIRPRFX=${_lib}/ install
1868   .endif
1869   .endfor
1870  
1871   .for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs}
1872 < ${_lib}__L: .PHONY
1872 > ${_lib}__L: .PHONY .MAKE
1873   .if exists(${.CURDIR}/${_lib})
1874          ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \
1875                  cd ${.CURDIR}/${_lib}; \
1876 <                ${MAKE} DIRPRFX=${_lib}/ obj; \
1877 <                ${MAKE} DIRPRFX=${_lib}/ depend; \
1878 <                ${MAKE} DIRPRFX=${_lib}/ all; \
1879 <                ${MAKE} DIRPRFX=${_lib}/ install
1876 >                ${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ obj; \
1877 >                ${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ depend; \
1878 >                ${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ all; \
1879 >                ${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ install
1880   .endif
1881   .endfor
1882  
1883   # libpam is special: we need to build static PAM modules before
1884   # static PAM library, and dynamic PAM library before dynamic PAM
1885   # modules.
1886 < lib/libpam__L: .PHONY
1886 > lib/libpam__L: .PHONY .MAKE
1887          ${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \
1888                  cd ${.CURDIR}/lib/libpam; \
1889 <                ${MAKE} DIRPRFX=lib/libpam/ obj; \
1890 <                ${MAKE} DIRPRFX=lib/libpam/ depend; \
1891 <                ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET all; \
1892 <                ${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET install
1889 >                ${MAKE} -DNO_TESTS DIRPRFX=lib/libpam/ obj; \
1890 >                ${MAKE} -DNO_TESTS DIRPRFX=lib/libpam/ depend; \
1891 >                ${MAKE} -DNO_TESTS DIRPRFX=lib/libpam/ \
1892 >                    -D_NO_LIBPAM_SO_YET all; \
1893 >                ${MAKE} -DNO_TESTS DIRPRFX=lib/libpam/ \
1894 >                    -D_NO_LIBPAM_SO_YET install
1895  
1896   _prereq_libs: ${_prereq_libs:S/$/__PL/}
1897   _startup_libs: ${_startup_libs:S/$/__L/}
# Line 1215 | Line 1900 | _generic_libs: ${_generic_libs:S/$/__L/}
1900  
1901   .for __target in all clean cleandepend cleandir depend includes obj
1902   .for entry in ${SUBDIR}
1903 < ${entry}.${__target}__D: .PHONY
1904 <        ${_+_}@if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
1903 > ${entry}.${__target}__D: .PHONY .MAKE
1904 >        ${_+_}@set -e; if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
1905                  ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH} (${__target})"; \
1906                  edir=${entry}.${MACHINE_ARCH}; \
1907                  cd ${.CURDIR}/$${edir}; \
# Line 1262 | Line 1947 | delete-old-files:
1947   # argument list will get too long. Using .for/.endfor make "loops" will make
1948   # the Makefile parser segfault.
1949          @exec 3<&0; \
1950 +        cd ${.CURDIR}; \
1951          ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
1952              -V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \
1953          while read file; do \
# Line 1269 | Line 1955 | delete-old-files:
1955                          chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \
1956                          rm ${RM_I} "${DESTDIR}/$${file}" <&3; \
1957                  fi; \
1958 +                for ext in debug symbols; do \
1959 +                  if ! [ -e "${DESTDIR}/$${file}" ] && [ -f \
1960 +                      "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \
1961 +                          rm ${RM_I} "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" \
1962 +                              <&3; \
1963 +                  fi; \
1964 +                done; \
1965          done
1966   # Remove catpages without corresponding manpages.
1967          @exec 3<&0; \
# Line 1284 | Line 1977 | delete-old-files:
1977  
1978   check-old-files:
1979          @echo ">>> Checking for old files"
1980 <        @${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
1980 >        @cd ${.CURDIR}; \
1981 >        ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
1982              -V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \
1983          while read file; do \
1984                  if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
1985                          echo "${DESTDIR}/$${file}"; \
1986                  fi; \
1987 +                for ext in debug symbols; do \
1988 +                  if [ -f "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \
1989 +                          echo "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}"; \
1990 +                  fi; \
1991 +                done; \
1992          done
1993   # Check for catpages without corresponding manpages.
1994          @find ${DESTDIR}/usr/share/man/cat* ! -type d | \
# Line 1305 | Line 2004 | delete-old-libs:
2004          @echo ">>> Removing old libraries"
2005          @echo "${OLD_LIBS_MESSAGE}" | fmt
2006          @exec 3<&0; \
2007 +        cd ${.CURDIR}; \
2008          ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
2009              -V OLD_LIBS | xargs -n1 | \
2010          while read file; do \
# Line 1312 | Line 2012 | delete-old-libs:
2012                          chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \
2013                          rm ${RM_I} "${DESTDIR}/$${file}" <&3; \
2014                  fi; \
2015 +                for ext in debug symbols; do \
2016 +                  if ! [ -e "${DESTDIR}/$${file}" ] && [ -f \
2017 +                      "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \
2018 +                          rm ${RM_I} "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" \
2019 +                              <&3; \
2020 +                  fi; \
2021 +                done; \
2022          done
2023          @echo ">>> Old libraries removed"
2024  
2025   check-old-libs:
2026          @echo ">>> Checking for old libraries"
2027 <        @${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
2027 >        @cd ${.CURDIR}; \
2028 >        ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
2029              -V OLD_LIBS | xargs -n1 | \
2030          while read file; do \
2031                  if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
2032                          echo "${DESTDIR}/$${file}"; \
2033                  fi; \
2034 +                for ext in debug symbols; do \
2035 +                  if [ -f "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \
2036 +                          echo "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}"; \
2037 +                  fi; \
2038 +                done; \
2039          done
2040  
2041   delete-old-dirs:
2042          @echo ">>> Removing old directories"
2043 <        @${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
2044 <            -V OLD_DIRS | xargs -n1 | \
2043 >        @cd ${.CURDIR}; \
2044 >        ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
2045 >            -V OLD_DIRS | xargs -n1 | sort -r | \
2046          while read dir; do \
2047                  if [ -d "${DESTDIR}/$${dir}" ]; then \
2048                          rmdir -v "${DESTDIR}/$${dir}" || true; \
2049                  elif [ -L "${DESTDIR}/$${dir}" ]; then \
2050                          echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \
2051                  fi; \
2052 +                if [ -d "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
2053 +                        rmdir -v "${DESTDIR}${DEBUGDIR}/$${dir}" || true; \
2054 +                elif [ -L "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
2055 +                        echo "${DESTDIR}${DEBUGDIR}/$${dir} is a link, please remove everything manually."; \
2056 +                fi; \
2057          done
2058          @echo ">>> Old directories removed"
2059  
2060   check-old-dirs:
2061          @echo ">>> Checking for old directories"
2062 <        @${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
2062 >        @cd ${.CURDIR}; \
2063 >        ${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
2064              -V OLD_DIRS | xargs -n1 | \
2065          while read dir; do \
2066                  if [ -d "${DESTDIR}/$${dir}" ]; then \
# Line 1348 | Line 2068 | check-old-dirs:
2068                  elif [ -L "${DESTDIR}/$${dir}" ]; then \
2069                          echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \
2070                  fi; \
2071 +                if [ -d "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
2072 +                        echo "${DESTDIR}${DEBUGDIR}/$${dir}"; \
2073 +                elif [ -L "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \
2074 +                        echo "${DESTDIR}${DEBUGDIR}/$${dir} is a link, please remove everything manually."; \
2075 +                fi; \
2076          done
2077  
2078   delete-old: delete-old-files delete-old-dirs
# Line 1363 | Line 2088 | check-old: check-old-files check-old-libs check-old-di
2088   # showconfig - show build configuration.
2089   #
2090   showconfig:
2091 <        @${MAKE} -n -f bsd.own.mk -V dummy -dg1 | grep ^MK_ | sort
2091 >        @${MAKE} -n -f bsd.own.mk -V dummy -dg1 2>&1 | grep ^MK_ | sort
2092 >
2093 > .if !empty(KRNLOBJDIR) && !empty(KERNCONF)
2094 > DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF}/
2095 >
2096 > .if !defined(FDT_DTS_FILE) || empty(FDT_DTS_FILE)
2097 > .if exists(${KERNCONFDIR}/${KERNCONF})
2098 > FDT_DTS_FILE!= awk 'BEGIN {FS="="} /^makeoptions[[:space:]]+FDT_DTS_FILE/ {print $$2}' \
2099 >        '${KERNCONFDIR}/${KERNCONF}' ; echo
2100 > .endif
2101 > .endif
2102 >
2103 > .endif
2104 >
2105 > .if !defined(DTBOUTPUTPATH) || !exists(${DTBOUTPUTPATH})
2106 > DTBOUTPUTPATH= ${.CURDIR}
2107 > .endif
2108 >
2109 > #
2110 > # Build 'standalone' Device Tree Blob
2111 > #
2112 > builddtb:
2113 >        @PATH=${TMPPATH} MACHINE=${TARGET} \
2114 >        ${.CURDIR}/sys/tools/fdt/make_dtb.sh ${.CURDIR}/sys \
2115 >            "${FDT_DTS_FILE}" ${DTBOUTPUTPATH}
2116 >
2117 > ###############
2118 >
2119 > .if defined(XDEV) && defined(XDEV_ARCH)
2120 >
2121 > .if ${XDEV} == ${MACHINE} && ${XDEV_ARCH} == ${MACHINE_ARCH}
2122 > XDEV_CPUTYPE?=${CPUTYPE}
2123 > .else
2124 > XDEV_CPUTYPE?=${TARGET_CPUTYPE}
2125 > .endif
2126 >
2127 > NOFUN=-DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT \
2128 >        -DWITHOUT_MAN -DWITHOUT_NLS -DNO_PROFILE \
2129 >        -DWITHOUT_KERBEROS -DWITHOUT_RESCUE -DNO_TESTS -DNO_WARNS \
2130 >        TARGET=${XDEV} TARGET_ARCH=${XDEV_ARCH} \
2131 >        CPUTYPE=${XDEV_CPUTYPE}
2132 >
2133 > XDDIR=${XDEV_ARCH}-freebsd
2134 > XDTP?=/usr/${XDDIR}
2135 > .if ${XDTP:N/*}
2136 > .error XDTP variable should be an absolute path
2137 > .endif
2138 >
2139 > CDBENV=MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${XDDIR} \
2140 >        INSTALL="sh ${.CURDIR}/tools/install.sh"
2141 > CDENV= ${CDBENV} \
2142 >        _SHLIBDIRPREFIX=${XDDESTDIR} \
2143 >        TOOLS_PREFIX=${XDTP}
2144 > CD2CFLAGS=-isystem ${XDDESTDIR}/usr/include -L${XDDESTDIR}/usr/lib \
2145 >        --sysroot=${XDDESTDIR}/ -B${XDDESTDIR}/usr/libexec \
2146 >        -B${XDDESTDIR}/usr/bin -B${XDDESTDIR}/usr/lib
2147 > CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" CXX="${CXX} ${CD2CFLAGS}" \
2148 >        CPP="${CPP} ${CD2CFLAGS}" \
2149 >        MACHINE=${XDEV} MACHINE_ARCH=${XDEV_ARCH}
2150 >
2151 > CDTMP=  ${MAKEOBJDIRPREFIX}/${XDDIR}/${.CURDIR}/tmp
2152 > CDMAKE=${CDENV} PATH=${CDTMP}/usr/bin:${PATH} ${MAKE} ${NOFUN}
2153 > CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDDESTDIR}/usr/bin:${PATH} ${MAKE} ${NOFUN}
2154 > XDDESTDIR=${DESTDIR}/${XDTP}
2155 > .if !defined(OSREL)
2156 > OSREL!= uname -r | sed -e 's/[-(].*//'
2157 > .endif
2158 >
2159 > .ORDER: xdev-build xdev-install
2160 > xdev: xdev-build xdev-install
2161 >
2162 > .ORDER: _xb-worldtmp _xb-bootstrap-tools _xb-build-tools _xb-cross-tools
2163 > xdev-build: _xb-worldtmp _xb-bootstrap-tools _xb-build-tools _xb-cross-tools
2164 >
2165 > _xb-worldtmp: .PHONY
2166 >        mkdir -p ${CDTMP}/usr
2167 >        mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
2168 >            -p ${CDTMP}/usr >/dev/null
2169 >
2170 > _xb-bootstrap-tools: .PHONY
2171 > .for _tool in \
2172 >    ${_clang_tblgen}
2173 >        ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
2174 >        cd ${.CURDIR}/${_tool}; \
2175 >        ${CDMAKE} DIRPRFX=${_tool}/ obj; \
2176 >        ${CDMAKE} DIRPRFX=${_tool}/ depend; \
2177 >        ${CDMAKE} DIRPRFX=${_tool}/ all; \
2178 >        ${CDMAKE} DIRPRFX=${_tool}/ DESTDIR=${CDTMP} install
2179 > .endfor
2180 >
2181 > _xb-build-tools: .PHONY
2182 >        ${_+_}@cd ${.CURDIR}; \
2183 >        ${CDBENV} ${MAKE} -f Makefile.inc1 ${NOFUN} build-tools
2184 >
2185 > _xb-cross-tools: .PHONY
2186 > .for _tool in \
2187 >    ${_binutils} \
2188 >    usr.bin/ar \
2189 >    ${_clang_libs} \
2190 >    ${_clang} \
2191 >    ${_gcc}
2192 >        ${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,depend,all)"; \
2193 >        cd ${.CURDIR}/${_tool}; \
2194 >        ${CDMAKE} DIRPRFX=${_tool}/ obj; \
2195 >        ${CDMAKE} DIRPRFX=${_tool}/ depend; \
2196 >        ${CDMAKE} DIRPRFX=${_tool}/ all
2197 > .endfor
2198 >
2199 > _xi-mtree: .PHONY
2200 >        ${_+_}@${ECHODIR} "mtree populating ${XDDESTDIR}"
2201 >        mkdir -p ${XDDESTDIR}
2202 >        mtree -deU -f ${.CURDIR}/etc/mtree/BSD.root.dist \
2203 >            -p ${XDDESTDIR} >/dev/null
2204 >        mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
2205 >            -p ${XDDESTDIR}/usr >/dev/null
2206 >        mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
2207 >            -p ${XDDESTDIR}/usr/include >/dev/null
2208 > .if ${MK_TESTS} != "no"
2209 >        mkdir -p ${XDDESTDIR}${TESTSBASE}
2210 >        mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
2211 >            -p ${XDDESTDIR}${TESTSBASE} >/dev/null
2212 > .endif
2213 >
2214 > .ORDER: xdev-build _xi-mtree _xi-cross-tools _xi-includes _xi-libraries _xi-links
2215 > xdev-install: xdev-build _xi-mtree _xi-cross-tools _xi-includes _xi-libraries _xi-links
2216 >
2217 > _xi-cross-tools: .PHONY
2218 >        @echo "_xi-cross-tools"
2219 > .for _tool in \
2220 >    ${_binutils} \
2221 >    usr.bin/ar \
2222 >    ${_clang_libs} \
2223 >    ${_clang} \
2224 >    ${_gcc}
2225 >        ${_+_}@${ECHODIR} "===> xdev ${_tool} (install)"; \
2226 >        cd ${.CURDIR}/${_tool}; \
2227 >        ${CDMAKE} DIRPRFX=${_tool}/ install DESTDIR=${XDDESTDIR}
2228 > .endfor
2229 >
2230 > _xi-includes: .PHONY
2231 >        ${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 par-includes \
2232 >                DESTDIR=${XDDESTDIR}
2233 >
2234 > _xi-libraries: .PHONY
2235 >        ${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 libraries \
2236 >                DESTDIR=${XDDESTDIR}
2237 >
2238 > _xi-links: .PHONY
2239 >        ${_+_}cd ${XDDESTDIR}/usr/bin; \
2240 >       mkdir -p ../../../../usr/bin; \
2241 >                for i in *; do \
2242 >                        ln -sf ../../${XDTP}/usr/bin/$$i \
2243 >                            ../../../../usr/bin/${XDDIR}-$$i; \
2244 >                        ln -sf ../../${XDTP}/usr/bin/$$i \
2245 >                            ../../../../usr/bin/${XDDIR}${OSREL}-$$i; \
2246 >                done
2247 > .else
2248 > xdev xdev-build xdev-install:
2249 >        @echo "*** Error: Both XDEV and XDEV_ARCH must be defined for \"${.TARGET}\" target"
2250 > .endif

Comparing trunk/Makefile.inc1 (property cvs2svn:cvs-rev):
Revision 4656 by laffer1, Sun Feb 19 23:04:03 2012 UTC vs.
Revision 11174 by laffer1, Sat Jun 30 23:22:56 2018 UTC

# Line 1 | Line 0
1 1.37

Comparing trunk/Makefile.inc1 (property svn:keywords):
Revision 4656 by laffer1, Sun Feb 19 23:04:03 2012 UTC vs.
Revision 11174 by laffer1, Sat Jun 30 23:22:56 2018 UTC

# Line 0 | Line 1
1 + MidnightBSD=%H

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines