libstand - Make ether_sprintf() public.
[dragonfly.git] / Makefile.inc1
index faf5062..3ea93c0 100644 (file)
@@ -118,15 +118,21 @@ DESTDIRBASE?=             ${OBJTREE}${.CURDIR}
 # anyhow, and we need to be able to override it for stage installs
 .MAKEFLAGS:=   ${.MAKEFLAGS:NDESTDIR=*}
 
-# This sets the compiler we use to build the world/kernel with
-WORLD_CCVER?=  gcc44
-WORLD_BINUTILSVER?=    binutils221
+# This section sets the tools used to build the world/kernel
+WORLD_CCVER?=          gcc44
+WORLD_LDVER?=          ld.bfd
+WORLD_BINUTILSVER?=    binutils222
 
 # temporary until everybody has converted to x86_64
 .if ${MACHINE_ARCH} == "amd64"
 MACHINE_ARCH=  x86_64
+.if defined(.PARSEDIR)
+.export MACHINE_ARCH
+.else
+# LEGACY MAKE - REMOVE FOR DFLY 3.6
 .makeenv MACHINE_ARCH
 .endif
+.endif
 
 TARGET_ARCH?=  ${MACHINE_ARCH}
 .if ${TARGET_ARCH} == ${MACHINE_ARCH}
@@ -239,7 +245,7 @@ BMAKEENV=   MAKEOBJDIRPREFIX=${BTOOLSDEST} \
                PATH=${BTOOLSPATH}:${PATH} \
                INSTALL="sh ${.CURDIR}/tools/install.sh"
 
-BMAKE=         ${BMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING \
+BMAKE=         ${BMAKEENV} make -f Makefile.inc1 -DBOOTSTRAPPING \
                -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED \
                -DNO_WERROR -DNO_NLS
 
@@ -251,7 +257,7 @@ TMAKEENV=   MAKEOBJDIRPREFIX=${BTOOLSDEST} \
                PATH=${BTOOLSPATH}:${PATH} \
                INSTALL="sh ${.CURDIR}/tools/install.sh"
 
-TMAKE=         ${TMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING \
+TMAKE=         ${TMAKEENV} make -f Makefile.inc1 -DBOOTSTRAPPING \
                -DNO_FORTRAN -DNOSHARED
 
 # cross-tool stage
@@ -269,7 +275,7 @@ XMAKEENV=   MAKEOBJDIRPREFIX=${CTOOLSDEST} \
                USRDATA_PREFIX=${WORLDDEST} \
                PATH=${BTOOLSPATH}:${PATH}
 
-XMAKE=         ${XMAKEENV} ${MAKE} -f Makefile.inc1 -DNO_FORTRAN -DNO_GDB \
+XMAKE=         ${XMAKEENV} make -f Makefile.inc1 -DNO_FORTRAN -DNO_GDB \
                -DBOOTSTRAPPING -DNOSHARED
 
 # world stage, note the strict path and note that TOOLS_PREFIX is left
@@ -287,6 +293,7 @@ CROSSENV=   MAKEOBJDIRPREFIX=${WORLDDEST} \
                OBJFORMAT_PATH=${CTOOLSDEST} \
                HOST_CCVER=${HOST_CCVER} \
                CCVER=${WORLD_CCVER} \
+               LDVER=${WORLD_LDVER} \
                BINUTILSVER=${WORLD_BINUTILSVER}
 
 WMAKEENV=      ${CROSSENV} \
@@ -294,13 +301,13 @@ WMAKEENV= ${CROSSENV} \
                INSTALL="sh ${.CURDIR}/tools/install.sh" \
                PATH=${STRICTTMPPATH}
 
-WMAKE=         ${WMAKEENV} ${MAKE} -f Makefile.inc1
+WMAKE=         ${WMAKEENV} make -f Makefile.inc1
 
 # install stage
 #
 IMAKEENV=      ${CROSSENV} \
                PATH=${STRICTTMPPATH}
-IMAKE=         ${IMAKEENV} ${MAKE} -f Makefile.inc1
+IMAKE=         ${IMAKEENV} make -f Makefile.inc1
 
 # kernel stage
 #
@@ -433,14 +440,14 @@ crossworld: _worldtmp _bootstrap-tools _obj _build-tools _cross-tools
 #
 installcheck:
 .if !defined(NO_SENDMAIL)
-       @pw usershow smmsp || (echo "You may need to run 'make preupgrade' first"; exit 1)
-       @pw groupshow smmsp || (echo "You may need to run 'make preupgrade' first"; exit 1)
+       @pw usershow smmsp || (echo "You may need to run 'make preupgrade' first"; /usr/bin/false)
+       @pw groupshow smmsp || (echo "You may need to run 'make preupgrade' first"; /usr/bin/false)
 .endif
-       @pw usershow _pflogd || (echo "You may need to run 'make preupgrade' first"; exit 1)
-       @pw groupshow authpf || (echo "You may need to run 'make preupgrade' first"; exit 1)
-       @pw groupshow _pflogd || (echo "You may need to run 'make preupgrade' first"; exit 1)
+       @pw usershow _pflogd || (echo "You may need to run 'make preupgrade' first"; /usr/bin/false)
+       @pw groupshow authpf || (echo "You may need to run 'make preupgrade' first"; /usr/bin/false)
+       @pw groupshow _pflogd || (echo "You may need to run 'make preupgrade' first"; /usr/bin/false)
 .if !defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/"
-       @case `uname -r` in 1.2*|1.3-*|1.3.*|1.4.*|1.5.0-*|1.5.1-*|1.5.2-*|1.5.3-*) echo "You must upgrade your kernel to at least 1.5.4 and reboot before you can safely installworld, due to libc/system call ABI changes" ; exit 1;; esac
+       @case `uname -r` in 1.2*|1.3-*|1.3.*|1.4.*|1.5.0-*|1.5.1-*|1.5.2-*|1.5.3-*) echo "You must upgrade your kernel to at least 1.5.4 and reboot before you can safely installworld, due to libc/system call ABI changes" ; /usr/bin/false ; esac
 .endif
 #
 # installworld
@@ -462,12 +469,12 @@ reinstall:
        @echo "--------------------------------------------------------------"
        @echo ">>> Making hierarchy"
        @echo "--------------------------------------------------------------"
-       cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 hierarchy
+       cd ${.CURDIR}; make -f Makefile.inc1 hierarchy
        @echo
        @echo "--------------------------------------------------------------"
        @echo ">>> Installing everything.."
        @echo "--------------------------------------------------------------"
-       cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
+       cd ${.CURDIR}; make -f Makefile.inc1 install
 
 #
 # buildkernel, nativekernel, quickkernel, and installkernel
@@ -537,7 +544,7 @@ bk_tools:
            echo "You must buildworld before buildkernel.  If you wish"; \
            echo "to build a kernel using native tools, config it manually"; \
            echo "or use the nativekernel target if you are in a rush"; \
-           exit 1; \
+           /usr/bin/false; \
        fi
 
 maybe_bk_tools:
@@ -546,7 +553,7 @@ maybe_bk_tools:
            if [ ! -f ${WORLDDEST}/.libraries_done ]; then \
                echo "The kernel was build using buildworld tools which no" ; \
                echo "longer appear to exist, quickkernel failed!" ; \
-               exit 1; \
+               /usr/bin/false; \
            fi; \
        fi
 .endfor
@@ -597,10 +604,10 @@ buildkernel:      bk_tools bk_build_list bk_kernwarn
        touch ${KRNLOBJDIR}/${_kernel}/.buildkernel_run
 .if !defined(NO_KERNELDEPEND)
        cd ${KRNLOBJDIR}/${_kernel}; \
-           ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} depend
+           ${KMAKEENV} make KERNEL=${INSTKERNNAME} depend
 .endif
        cd ${KRNLOBJDIR}/${_kernel}; \
-           ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} all
+           ${KMAKEENV} make KERNEL=${INSTKERNNAME} all
        @echo "--------------------------------------------------------------"
        @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
        @echo "--------------------------------------------------------------"
@@ -636,13 +643,13 @@ nativekernel:     bk_build_list bk_kernwarn
        touch ${KRNLOBJDIR}/${_kernel}/.nativekernel_run
        cd ${KRNLOBJDIR}/${_kernel}; \
            MAKESRCPATH=${KRNLSRCDIR}/dev/disk/aic7xxx/aicasm \
-           ${MAKE} -DBOOTSTRAPPING -f ${KRNLSRCDIR}/dev/disk/aic7xxx/aicasm/Makefile
+           make -DBOOTSTRAPPING -f ${KRNLSRCDIR}/dev/disk/aic7xxx/aicasm/Makefile
 .if !defined(NO_KERNELDEPEND)
        cd ${KRNLOBJDIR}/${_kernel}; \
-           ${MAKE} KERNEL=${INSTKERNNAME} depend
+           make KERNEL=${INSTKERNNAME} depend
 .endif
        cd ${KRNLOBJDIR}/${_kernel}; \
-           ${MAKE} KERNEL=${INSTKERNNAME} all
+           make KERNEL=${INSTKERNNAME} all
        @echo "--------------------------------------------------------------"
        @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
        @echo "--------------------------------------------------------------"
@@ -668,7 +675,7 @@ quickkernel:        maybe_bk_tools bk_build_list bk_kernwarn
                        ${KERNCONFDIR}/${_kernel}
 .endif
        cd ${KRNLOBJDIR}/${_kernel}; \
-           ${KMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} all
+           ${KMAKEENV} make KERNEL=${INSTKERNNAME} all
 .else
 .if !defined(NO_KERNELCONFIG)
        cd ${KRNLCONFDIR}; \
@@ -676,7 +683,7 @@ quickkernel:        maybe_bk_tools bk_build_list bk_kernwarn
                ${KERNCONFDIR}/${_kernel}
 .endif
        cd ${KRNLOBJDIR}/${_kernel}; \
-           ${MAKE} KERNEL=${INSTKERNNAME} all
+           make KERNEL=${INSTKERNNAME} all
 .endif
        @echo "--------------------------------------------------------------"
        @echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
@@ -694,10 +701,10 @@ installkernel reinstallkernel:
        @echo "--------------------------------------------------------------"
 .if exists(${KRNLOBJDIR}/${INSTALLKERNEL}/.buildkernel_run)
        cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
-           ${IMAKEENV} ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//}
+           ${IMAKEENV} make KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//}
 .else
        cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
-           ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//}
+           make KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel$//}
 .endif
 
 #
@@ -710,7 +717,7 @@ most:
        @echo ">>> Building programs only"
        @echo "--------------------------------------------------------------"
 .for _dir in bin sbin libexec usr.bin usr.sbin gnu/libexec gnu/usr.bin gnu/usr.sbin
-       cd ${.CURDIR}/${_dir};          ${MAKE} DIRPRFX=${_dir}/ all
+       cd ${.CURDIR}/${_dir};          make DIRPRFX=${_dir}/ all
 .endfor
 
 #
@@ -724,7 +731,7 @@ installmost:
        @echo ">>> Installing programs only"
        @echo "--------------------------------------------------------------"
 .for _dir in bin sbin libexec usr.bin usr.sbin gnu/libexec gnu/usr.bin gnu/usr.sbin
-       cd ${.CURDIR}/${_dir};          ${MAKE} DIRPRFX=${_dir}/ install
+       cd ${.CURDIR}/${_dir};          make DIRPRFX=${_dir}/ install
 .endfor
 
 #
@@ -754,35 +761,45 @@ installmost:
 _strfile=      games/fortune/strfile
 .endif
 
-bootstrap-tools:
+BSTRAPDIRS= ${_strfile} \
+       usr.bin/patch \
+       bin/chmod bin/cp bin/cpdup bin/dd bin/mkdir bin/rm bin/echo \
+       bin/test bin/cat bin/ln bin/mv bin/csh bin/expr bin/sh \
+       bin/hostname bin/kill \
+       usr.bin/yacc usr.bin/colldef usr.bin/uudecode usr.bin/xinstall \
+       usr.bin/m4 usr.bin/rpcgen usr.bin/bmake usr.bin/awk usr.bin/stat \
+       usr.bin/find usr.bin/lex usr.bin/sed usr.bin/uname usr.bin/touch \
+       usr.bin/mkdep usr.bin/mktemp usr.bin/lorder usr.bin/file2c \
+       usr.bin/tsort usr.bin/tr usr.bin/join usr.bin/wc usr.bin/basename \
+       usr.bin/gencat usr.bin/chflags usr.bin/expand usr.bin/paste \
+       usr.bin/mklocale usr.bin/uuencode usr.bin/compile_et usr.bin/hexdump \
+       usr.bin/cap_mkdb usr.bin/true usr.bin/false \
+       usr.bin/cmp usr.bin/xargs usr.bin/id usr.bin/env usr.bin/dirname \
+       usr.bin/tail usr.bin/unifdef usr.bin/tic \
+       usr.sbin/chown usr.sbin/mtree usr.sbin/config \
+       usr.sbin/btxld usr.sbin/zic usr.sbin/makewhatis \
+       gnu/usr.bin/texinfo gnu/usr.bin/grep usr.bin/sort \
+       usr.bin/gzip usr.bin/bzip2 usr.bin/mkcsmapper usr.bin/mkesdb
+
+bootstrap-tools: bootstrap-tools-before bootstrap-tools-targets
+       touch ${BTOOLSDEST}/.bootstrap_done
+
+bootstrap-tools-before:
        ${LN} -fs /bin/date ${BTOOLSDEST}/bin/date
-.for _tool in ${_strfile} \
-    usr.bin/patch \
-    bin/chmod bin/cp bin/cpdup bin/dd bin/mkdir bin/rm bin/echo bin/test \
-    bin/cat bin/ln bin/mv bin/csh bin/expr bin/sh \
-    bin/hostname bin/kill \
-    usr.bin/yacc usr.bin/colldef usr.bin/uudecode usr.bin/xinstall \
-    usr.bin/m4 usr.bin/rpcgen usr.bin/make usr.bin/awk usr.bin/stat \
-    usr.bin/find usr.bin/lex usr.bin/sed usr.bin/uname usr.bin/touch \
-    usr.bin/mkdep usr.bin/mktemp usr.bin/lorder usr.bin/file2c \
-    usr.bin/tsort usr.bin/tr usr.bin/join usr.bin/wc usr.bin/basename \
-    usr.bin/gencat usr.bin/chflags usr.bin/expand usr.bin/paste \
-    usr.bin/mklocale usr.bin/uuencode usr.bin/compile_et usr.bin/hexdump \
-    usr.bin/cap_mkdb usr.bin/true usr.bin/false \
-    usr.bin/cmp usr.bin/xargs usr.bin/id usr.bin/env usr.bin/dirname \
-    usr.bin/tail usr.bin/unifdef \
-    usr.sbin/chown usr.sbin/mtree usr.sbin/config \
-    usr.sbin/btxld usr.sbin/zic usr.sbin/makewhatis \
-    gnu/usr.bin/texinfo gnu/usr.bin/grep usr.bin/sort \
-    usr.bin/gzip usr.bin/bzip2 usr.bin/mkcsmapper usr.bin/mkesdb
+
+bootstrap-tools-targets: ${BSTRAPDIRS:S/^/bstrap-/}
+
+.ORDER: bootstrap-tools-before bootstrap-tools-targets
+
+.for _tool in ${BSTRAPDIRS}
+bstrap-${_tool}!
        ${ECHODIR} "===> ${_tool} (bootstrap-tools)"; \
                cd ${.CURDIR}/${_tool}; \
-               ${MAKE} DIRPRFX=${_tool}/ obj; \
-               ${MAKE} DIRPRFX=${_tool}/ depend; \
-               ${MAKE} DIRPRFX=${_tool}/ all; \
-               ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${BTOOLSDEST} install
+               make DIRPRFX=${_tool}/ obj; \
+               make DIRPRFX=${_tool}/ depend; \
+               make DIRPRFX=${_tool}/ all; \
+               make DIRPRFX=${_tool}/ DESTDIR=${BTOOLSDEST} install
 .endfor
-       touch ${BTOOLSDEST}/.bootstrap_done
 
 # build-tools: Build special purpose build tools.
 #
@@ -793,25 +810,35 @@ bootstrap-tools:
 _share=        share/syscons/scrnmaps
 .endif
 
-.if !defined(NO_GCC41)
-_gcc41_cross= gnu/usr.bin/cc41
-_gcc41_tools= gnu/usr.bin/cc41/cc_prep gnu/usr.bin/cc41/cc_tools
-.endif
+_gcc_common_cross= gnu/usr.bin/gmp gnu/usr.bin/mpfr
 _gcc44_cross= gnu/usr.bin/cc44
 _gcc44_tools= gnu/usr.bin/cc44/cc_prep gnu/usr.bin/cc44/cc_tools
+.if !defined(NO_GCC47)
+_gcc47_cross= lib/libz gnu/usr.bin/mpc gnu/usr.bin/cc47
+_gcc47_tools= gnu/usr.bin/cc47/cc_prep gnu/usr.bin/cc47/cc_tools
+.endif
 _custom_cross= libexec/customcc
 _binutils= gnu/usr.bin/${WORLD_BINUTILSVER}
 
-build-tools:
-.for _tool in ${_gcc41_tools} ${_gcc44_tools} ${_libkrb5} ${_share}
+BTOOLSDIRS= ${_gcc44_tools} ${_gcc47_tools} ${_share}
+
+build-tools: build-tools-targets
+       touch ${BTOOLSDEST}/.build_done
+
+build-tools-targets: ${BTOOLSDIRS:S/^/btools-/}
+
+.ORDER: ${_gcc44_tools:S/^/btools-/}
+.ORDER: ${_gcc47_tools:S/^/btools-/}
+
+.for _tool in ${BTOOLSDIRS}
+btools-${_tool}!
        ${ECHODIR} "===> ${_tool} (build-tools)"; \
                cd ${.CURDIR}/${_tool}; \
-               ${MAKE} DIRPRFX=${_tool}/ obj; \
-               ${MAKE} DIRPRFX=${_tool}/ depend; \
-               ${MAKE} DIRPRFX=${_tool}/ all; \
-               ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${BTOOLSDEST} install
+               make DIRPRFX=${_tool}/ obj; \
+               make DIRPRFX=${_tool}/ depend; \
+               make DIRPRFX=${_tool}/ all; \
+               make DIRPRFX=${_tool}/ DESTDIR=${BTOOLSDEST} install
 .endfor
-       touch ${BTOOLSDEST}/.build_done
 
 #
 # cross-tools: Build cross-building tools
@@ -820,24 +847,29 @@ build-tools:
 _btxld=        usr.sbin/btxld
 .endif
 
-cross-tools:
-.for _tool in ${_btxld} ${_binutils} \
-             usr.bin/objformat \
-             ${_gcc41_cross} ${_gcc44_cross} ${_custom_cross}
+CTOOLSDIRS= ${_btxld} ${_binutils} usr.bin/objformat ${_gcc_common_cross} \
+               ${_gcc44_cross} ${_gcc47_cross} ${_custom_cross}
+
+cross-tools: cross-tools-targets
+       touch ${CTOOLSDEST}/.cross_done
+
+cross-tools-targets: ${CTOOLSDIRS:S/^/ctools-/}
+
+.for _tool in ${CTOOLSDIRS}
+ctools-${_tool}!
        ${ECHODIR} "===> ${_tool} (cross-tools)"; \
                cd ${.CURDIR}/${_tool}; \
-               ${MAKE} DIRPRFX=${_tool}/ obj; \
-               ${MAKE} DIRPRFX=${_tool}/ depend; \
-               ${MAKE} DIRPRFX=${_tool}/ all; \
-               ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${CTOOLSDEST} install
+               make DIRPRFX=${_tool}/ obj; \
+               make DIRPRFX=${_tool}/ depend; \
+               make DIRPRFX=${_tool}/ all; \
+               make DIRPRFX=${_tool}/ DESTDIR=${CTOOLSDEST} install
 .endfor
-       touch ${CTOOLSDEST}/.cross_done
 
 #
 # hierarchy - ensure that all the needed directories are present
 #
 hierarchy:
-       cd ${.CURDIR}/etc;              ${MAKE} distrib-dirs
+       cd ${.CURDIR}/etc;              make distrib-dirs
 
 #
 # libraries - build all libraries, and install them under ${DESTDIR}.
@@ -850,18 +882,18 @@ hierarchy:
 # to specify the correct CCVER or 'cc' will not exec the correct compiler.
 #
 libraries:
-.if !defined(NO_GCC41)
+.if !defined(NO_GCC47)
        cd ${.CURDIR}; \
-           HOST_CCVER=${HOST_CCVER} CCVER=gcc41 \
-               ${MAKE} -f Makefile.inc1 _startup_libs41;
+           HOST_CCVER=${HOST_CCVER} CCVER=gcc47 \
+               make -f Makefile.inc1 _startup_libs47;
 .endif
        cd ${.CURDIR}; \
            HOST_CCVER=${HOST_CCVER} CCVER=gcc44 \
-               ${MAKE} -f Makefile.inc1 _startup_libs44;
+               make -f Makefile.inc1 _startup_libs44;
        cd ${.CURDIR}; \
-           ${MAKE} -f Makefile.inc1 _startup_libs; \
-           ${MAKE} -f Makefile.inc1 _prebuild_libs; \
-           ${MAKE} -f Makefile.inc1 _generic_libs;
+           make -f Makefile.inc1 _startup_libs; \
+           make -f Makefile.inc1 _prebuild_libs; \
+           make -f Makefile.inc1 _generic_libs;
        touch ${WORLDDEST}/.libraries_done
 
 # These dependencies are not automatically generated:
@@ -870,8 +902,16 @@ libraries:
 # shared libraries for ELF.  The target for _startup_libsXX is
 # specifically built using gccXX.
 #
-_startup_libs41=       gnu/lib/gcc41/csu gnu/lib/gcc41/libgcc
-_startup_libs44=       gnu/lib/gcc44/csu gnu/lib/gcc44/libgcc
+_startup_libs47=       gnu/usr.bin/cc47/cc_prep \
+                       gnu/usr.bin/cc47/cc_tools \
+                       gnu/lib/gcc47/csu \
+                       gnu/lib/gcc47/libgcc \
+                       gnu/lib/gcc47/libgcc_eh \
+                       gnu/lib/gcc47/libgcc_pic
+_startup_libs44=       gnu/usr.bin/cc44/cc_prep \
+                       gnu/usr.bin/cc44/cc_tools \
+                       gnu/lib/gcc44/csu \
+                       gnu/lib/gcc44/libgcc
 _startup_libs=         lib/csu lib/libc lib/libc_rtld
 
 _prebuild_libs=                lib/libbz2 lib/liblzma lib/libz
@@ -902,20 +942,20 @@ _generic_libs+=   secure/lib
 
 _generic_libs+=        usr.bin/lex/lib
 
-.for _lib in ${_startup_libs41} ${_startup_libs44} \
+.for _lib in ${_startup_libs44} ${_startup_libs47} \
                ${_startup_libs} ${_prebuild_libs} ${_generic_libs}
 ${_lib}__L: .PHONY
 .if exists(${.CURDIR}/${_lib})
        ${ECHODIR} "===> ${_lib}"; \
                cd ${.CURDIR}/${_lib}; \
-               ${MAKE} DIRPRFX=${_lib}/ depend; \
-               ${MAKE} DIRPRFX=${_lib}/ all; \
-               ${MAKE} DIRPRFX=${_lib}/ install
+               make DIRPRFX=${_lib}/ depend; \
+               make DIRPRFX=${_lib}/ all; \
+               make DIRPRFX=${_lib}/ install
 .endif
 .endfor
 
 _startup_libs: ${_startup_libs:S/$/__L/}
-_startup_libs41: ${_startup_libs41:S/$/__L/}
+_startup_libs47: ${_startup_libs47:S/$/__L/}
 _startup_libs44: ${_startup_libs44:S/$/__L/}
 _prebuild_libs: ${_prebuild_libs:S/$/__L/}
 _generic_libs: ${_generic_libs:S/$/__L/}
@@ -923,7 +963,7 @@ _generic_libs: ${_generic_libs:S/$/__L/}
 # library targets must be ordered because there are inter-library
 # races (e.g. generation of tconfig.h)
 #
-.ORDER: ${_startup_libs41:S/$/__L/}
+.ORDER: ${_startup_libs47:S/$/__L/}
 .ORDER: ${_startup_libs44:S/$/__L/}
 .ORDER: ${_startup_libs:S/$/__L/}
 .ORDER: ${_prebuild_libs:S/$/__L/}
@@ -941,7 +981,7 @@ ${entry}.${__target}__D: .PHONY
                edir=${entry}; \
                cd ${.CURDIR}/$${edir}; \
        fi; \
-       ${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
+       make ${__target} DIRPRFX=${DIRPRFX}$${edir}/
 .endfor
 par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
 .ORDER: ${SUBDIR:S/$/.${__target}__D/}
@@ -952,28 +992,44 @@ par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
 # world build environment.
 #
 wmake:
-       @echo '${WMAKEENV} ${MAKE} -m ${.CURDIR}/share/mk ${WMAKE_ARGS}'
+       @echo '${WMAKEENV} make ${WMAKE_ARGS}'
 
 wmakeenv:
        @echo '${WMAKEENV} /bin/sh'
 
 bmake:
-       @echo '${BMAKEENV} ${MAKE} -m ${.CURDIR}/share/mk ${BMAKE_ARGS}'
+       @echo '${BMAKEENV} make ${BMAKE_ARGS}'
 
 bmakeenv:
        @echo '${BMAKEENV} /bin/sh'
 
 tmake:
-       @echo '${TMAKEENV} ${MAKE} -m ${.CURDIR}/share/mk ${TMAKE_ARGS}'
+       @echo '${TMAKEENV} make ${TMAKE_ARGS}'
 
 tmakeenv:
        @echo '${TMAKEENV} /bin/sh'
 
 xmake:
-       @echo '${XMAKEENV} ${MAKE} -m ${.CURDIR}/share/mk ${XMAKE_ARGS}'
+       @echo '${XMAKEENV} make ${XMAKE_ARGS}'
 
 xmakeenv:
        @echo '${XMAKEENV} /bin/sh'
 
-.include <bsd.subdir.mk>
+# Take advantage of bmake error response
+#
+MAKE_PRINT_VAR_ON_ERROR= \
+       .CURDIR \
+       .OBJDIR \
+       .MAKE \
+       MAKE_VERSION \
+       LD_LIBRARY_PATH \
+       MACHINE_ARCH \
+       MACHINE \
+       MAKEFILE \
+       .TARGETS \
+       .ERROR_TARGET \
+       .ERROR_META_FILE \
+       .MAKE.LEVEL \
+       .MAKE.MODE
 
+.include <bsd.subdir.mk>