Index: stable/10/share/mk/bsd.subdir.mk =================================================================== --- stable/10/share/mk/bsd.subdir.mk (revision 313788) +++ stable/10/share/mk/bsd.subdir.mk (revision 313789) @@ -1,136 +1,135 @@ # from: @(#)bsd.subdir.mk 5.9 (Berkeley) 2/1/91 # $FreeBSD$ # # The include file contains the default targets # for building subdirectories. # # For all of the directories listed in the variable SUBDIRS, the # specified directory will be visited and the target made. There is # also a default target which allows the command "make subdir" where # subdir is any directory listed in the variable SUBDIRS. # # # +++ variables +++ # # DISTRIBUTION Name of distribution. [base] # # SUBDIR A list of subdirectories that should be built as well. # Each of the targets will execute the same target in the # subdirectories. # # +++ targets +++ # # distribute: # This is a variant of install, which will # put the stuff into the right "distribution". # # afterinstall, all, all-man, beforeinstall, checkdpadd, clean, # cleandepend, cleandir, cleanilinks depend, install, lint, # maninstall, manlint, obj, objlink, realinstall, regress, tags # .if !target(____) ____: .include DISTRIBUTION?= base .if !target(distribute) distribute: .MAKE .for dist in ${DISTRIBUTION} ${_+_}cd ${.CURDIR}; \ ${MAKE} install -DNO_SUBDIR DESTDIR=${DISTDIR}/${dist} SHARED=copies .endfor .endif _SUBDIR: .USE .MAKE .if defined(SUBDIR) && !empty(SUBDIR) && !defined(NO_SUBDIR) - @${_+_}set -e; for entry in ${SUBDIR:N.WAIT}; do \ + @${_+_}for entry in ${SUBDIR:N.WAIT}; do \ if test -d ${.CURDIR}/$${entry}.${MACHINE_ARCH}; then \ ${ECHODIR} "===> ${DIRPRFX}$${entry}.${MACHINE_ARCH} (${.TARGET:S,realinstall,install,:S,^_sub.,,})"; \ edir=$${entry}.${MACHINE_ARCH}; \ cd ${.CURDIR}/$${edir}; \ else \ ${ECHODIR} "===> ${DIRPRFX}$$entry (${.TARGET:S,realinstall,install,:S,^_sub.,,})"; \ edir=$${entry}; \ cd ${.CURDIR}/$${edir}; \ fi; \ ${MAKE} ${.TARGET:S,realinstall,install,:S,^_sub.,,} \ DIRPRFX=${DIRPRFX}$$edir/; \ done .endif ${SUBDIR:N.WAIT}: .PHONY .MAKE ${_+_}@if test -d ${.TARGET}.${MACHINE_ARCH}; then \ cd ${.CURDIR}/${.TARGET}.${MACHINE_ARCH}; \ else \ cd ${.CURDIR}/${.TARGET}; \ fi; \ ${MAKE} all # Work around parsing of .if nested in .for by putting .WAIT string into a var. __wait= .WAIT .for __target in all all-man checkdpadd clean cleandepend cleandir \ cleanilinks depend distribute lint maninstall manlint obj objlink \ realinstall regress tags ${SUBDIR_TARGETS} .ifdef SUBDIR_PARALLEL __subdir_targets= .for __dir in ${SUBDIR} .if ${__wait} == ${__dir} __subdir_targets+= .WAIT .else __subdir_targets+= ${__target}_subdir_${__dir} __deps= .for __dep in ${SUBDIR_DEPEND_${__dir}} __deps+= ${__target}_subdir_${__dep} .endfor ${__target}_subdir_${__dir}: .PHONY .MAKE ${__deps} .if !defined(NO_SUBDIR) - @${_+_}set -e; \ - if test -d ${.CURDIR}/${__dir}.${MACHINE_ARCH}; then \ + @${_+_}if test -d ${.CURDIR}/${__dir}.${MACHINE_ARCH}; then \ ${ECHODIR} "===> ${DIRPRFX}${__dir}.${MACHINE_ARCH} (${__target:realinstall=install})"; \ edir=${__dir}.${MACHINE_ARCH}; \ cd ${.CURDIR}/$${edir}; \ else \ ${ECHODIR} "===> ${DIRPRFX}${__dir} (${__target:realinstall=install})"; \ edir=${__dir}; \ cd ${.CURDIR}/$${edir}; \ fi; \ ${MAKE} ${__target:realinstall=install} \ DIRPRFX=${DIRPRFX}$$edir/ .endif .endif .endfor ${__target}: ${__subdir_targets} .else ${__target}: _sub.${__target} _sub.${__target}: _SUBDIR .endif .endfor .for __target in files includes .for __stage in build install ${__stage}${__target}: .if make(${__stage}${__target}) ${__stage}${__target}: _sub.${__stage}${__target} _sub.${__stage}${__target}: _SUBDIR .endif .endfor .if !target(${__target}) ${__target}: .MAKE - ${_+_}set -e; cd ${.CURDIR}; ${MAKE} build${__target}; ${MAKE} install${__target} + ${_+_}cd ${.CURDIR}; ${MAKE} build${__target}; ${MAKE} install${__target} .endif .endfor .if !target(install) .if !target(beforeinstall) beforeinstall: .endif .if !target(afterinstall) afterinstall: .endif install: beforeinstall realinstall afterinstall .ORDER: beforeinstall realinstall afterinstall .endif .endif Index: stable/10/share/mk/suite.test.mk =================================================================== --- stable/10/share/mk/suite.test.mk (revision 313788) +++ stable/10/share/mk/suite.test.mk (revision 313789) @@ -1,118 +1,117 @@ # $FreeBSD$ # # You must include bsd.test.mk instead of this file from your Makefile. # # Internal glue for the build of /usr/tests/. .if !target(____) .error suite.test.mk cannot be included directly. .endif # Name of the test suite these tests belong to. Should rarely be changed for # Makefiles built into the FreeBSD src tree. TESTSUITE?= FreeBSD # Knob to control the handling of the Kyuafile for this Makefile. # # If 'yes', a Kyuafile exists in the source tree and is installed into # TESTSDIR. # # If 'auto', a Kyuafile is automatically generated based on the list of test # programs built by the Makefile and is installed into TESTSDIR. This is the # default and is sufficient in the majority of the cases. # # If 'no', no Kyuafile is installed. KYUAFILE?= auto # Per-test program interface definition. # # The name provided here must match one of the interface names supported by # Kyua as this is later encoded in the Kyuafile test program definitions. #TEST_INTERFACE.= interface-name # Per-test program metadata properties as a list of key/value pairs. # # All the variables for a particular program are appended to the program's # definition in the Kyuafile. This feature can be used to avoid having to # explicitly supply a Kyuafile in the source directory, allowing the caller # Makefile to rely on the KYUAFILE=auto behavior defined here. #TEST_METADATA.+= key="value" .if ${KYUAFILE:tl} != "no" FILES+= Kyuafile FILESDIR_Kyuafile= ${TESTSDIR} .endif .if ${KYUAFILE:tl} == "auto" CLEANFILES+= Kyuafile Kyuafile.tmp .endif .if ${KYUAFILE:tl} == "auto" Kyuafile: Makefile @{ \ echo '-- Automatically generated by bsd.test.mk.'; \ echo; \ echo 'syntax(2)'; \ echo; \ echo 'test_suite("${TESTSUITE}")'; \ echo; \ } > ${.TARGET}.tmp .for _T in ${_TESTS} .if defined(.PARSEDIR) @echo '${TEST_INTERFACE.${_T}}_test_program{name="${_T}"${TEST_METADATA.${_T}:C/$/,/:tW:C/^/, /W:C/,$//W}}' \ >>${.TARGET}.tmp .else @echo '${TEST_INTERFACE.${_T}}_test_program{name="${_T}"${TEST_METADATA.${_T}:C/^/, /:Q:S/\\ ,/,/g:S,\\,,g}}' \ >>Kyuafile.auto.tmp .endif .endfor .for _T in ${TESTS_SUBDIRS:N.WAIT} @echo "include(\"${_T}/${.TARGET}\")" >>${.TARGET}.tmp .endfor @mv ${.TARGET}.tmp ${.TARGET} .endif KYUA= ${LOCALBASE}/bin/kyua .if exists(${KYUA}) # Definition of the "make test" target and supporting variables. # # This target, by necessity, can only work for native builds (i.e. a FreeBSD # host building a release for the same system). The target runs Kyua, which is # not in the toolchain, and the tests execute code built for the target host. # # Due to the dependencies of the binaries built by the source tree and how they # are used by tests, it is highly possible for a execution of "make test" to # report bogus results unless the new binaries are put in place. realtest: .PHONY @echo "*** WARNING: make test is experimental" @echo "***" @echo "*** Using this test does not preclude you from running the tests" @echo "*** installed in ${TESTSBASE}. This test run may raise false" @echo "*** positives and/or false negatives." @echo - @set -e; \ - ${KYUA} test -k ${DESTDIR}${TESTSDIR}/Kyuafile; \ + @${KYUA} test -k ${DESTDIR}${TESTSDIR}/Kyuafile; \ result=0; \ echo; \ echo "*** Once again, note that "make test" is unsupported."; \ test $${result} -eq 0 .endif beforetest: .PHONY .if defined(TESTSDIR) .if ${TESTSDIR} == ${TESTSBASE} # Forbid running from ${TESTSBASE}. It can cause false positives/negatives and # it does not cover all the tests (e.g. it misses testing software in external). @echo "*** Sorry, you cannot use make test from src/tests. Install the" @echo "*** tests into their final location and run them from ${TESTSBASE}" @false .else @echo "*** Using this test does not preclude you from running the tests" @echo "*** installed in ${TESTSBASE}. This test run may raise false" @echo "*** positives and/or false negatives." .endif .else @echo "*** No TESTSDIR defined; nothing to do." @false .endif @echo Index: stable/10 =================================================================== --- stable/10 (revision 313788) +++ stable/10 (revision 313789) Property changes on: stable/10 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /head:r288241