Index: Makefile.inc1 =================================================================== --- Makefile.inc1 +++ Makefile.inc1 @@ -386,44 +386,27 @@ SUBDIR+=.WAIT .endif .if defined(SYSROOT_ONLY) -# Only install libraries and headers: -SUBDIR+=include -.if ${MK_CDDL} != "no" -SUBDIR+=cddl/lib -.endif +SUBDIR.${MK_CDDL}+=cddl/lib SUBDIR+=gnu/lib -.if ${MK_CRYPT} != "no" -SUBDIR+= secure/lib -.endif -.if ${MK_KERBEROS} != "no" -SUBDIR+=kerberos5/lib -.endif .else # !defined(SYSROOT_ONLY) SUBDIR+=bin -.if ${MK_CDDL} != "no" -SUBDIR+=cddl -.endif -SUBDIR+=gnu include -.if ${MK_KERBEROS} != "no" -SUBDIR+=kerberos5 -.endif -.if ${MK_RESCUE} != "no" -SUBDIR+=rescue -.endif +SUBDIR.${MK_CDDL}+=cddl +SUBDIR+=gnu +.endif # !defined(SYSROOT_ONLY) +SUBDIR+=include +.if defined(SYSROOT_ONLY) +SUBDIR.${MK_CRYPT}+=secure/lib +SUBDIR.${MK_KERBEROS}+=kerberos5/lib +.else # !defined(SYSROOT_ONLY) +SUBDIR.${MK_RESCUE}+=rescue SUBDIR+=sbin -.if ${MK_CRYPT} != "no" -SUBDIR+=secure -.endif +SUBDIR.${MK_CRYPT}+=secure .if !defined(NO_SHARE) SUBDIR+=share .endif -.if ${MK_BOOT} != "no" -SUBDIR+=stand -.endif +SUBDIR.${MK_BOOT}+=stand SUBDIR+=sys usr.bin usr.sbin -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .endif # !defined(SYSROOT_ONLY) # Local directories are built in parallel with the base system directories. @@ -1566,8 +1549,7 @@ ${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install${libcompat} .endif .if make(reinstallsysroot) - @echo "Removing $$(find ${DESTDIR} -type d -empty -print | wc -l) empty directories from ${DESTDIR}" - find ${DESTDIR} -type d -empty -delete + find ${DESTDIR} -mindepth 1 -type d -empty -delete -print @echo @echo "--------------------------------------------------------------" @echo ">>> Done installing sysroot"