mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
Auto-create bmake/unit-tests objdir if appropriate
Given the way bmake/unit-tests is visited, when doing 'test' MK_AUTO_OBJ=yes will not be effective. So create the objdir before running the sub-make. Also ensure MAKEOBJDIR is passed to opt-m-include-dir Reviewed by: deo
This commit is contained in:
parent
e726e71056
commit
08604a023d
2 changed files with 15 additions and 1 deletions
|
|
@ -147,11 +147,24 @@ ${OBJS}: config.h
|
|||
|
||||
# A simple unit-test driver to help catch regressions
|
||||
TEST_MAKE ?= ${.OBJDIR}/${PROG:T}
|
||||
accept test:
|
||||
accept test: .NOMETA
|
||||
cd ${.CURDIR}/unit-tests && \
|
||||
MAKEFLAGS= ${TEST_MAKE} -r -m / ${.TARGET} ${TESTS:DTESTS=${TESTS:Q}}
|
||||
|
||||
|
||||
.if make(test) && ${MK_AUTO_OBJ} == "yes"
|
||||
# because of the way unit-tests is visted for test
|
||||
# the objdir will not be auto-created as expected.
|
||||
.if defined(MAKEOBJDIRPREFIX) || ${MAKEOBJDIR:Uno:M*/*} != ""
|
||||
_utobj = ${.OBJDIR}/unit-tests
|
||||
.else
|
||||
_utobj = ${.CURDIR}/unit-tests/${MAKEOBJDIR:Uobj}
|
||||
.endif
|
||||
utobj: .NOMETA
|
||||
mkdir -p ${_utobj}
|
||||
test: utobj
|
||||
.endif
|
||||
|
||||
# override some simple things
|
||||
BINDIR= /usr/bin
|
||||
MANDIR= /usr/share/man/man
|
||||
|
|
|
|||
|
|
@ -505,6 +505,7 @@ ENV.depsrc-optional+= TZ=UTC
|
|||
ENV.deptgt-phony+= MAKESYSPATH=.
|
||||
ENV.directive-undef= ENV_VAR=env-value
|
||||
ENV.envfirst= FROM_ENV=value-from-env
|
||||
ENV.opt-m-include-dir= ${MAKEOBJDIR:DMAKEOBJDIR=${MAKEOBJDIR}}
|
||||
ENV.varmisc= FROM_ENV=env
|
||||
ENV.varmisc+= FROM_ENV_BEFORE=env
|
||||
ENV.varmisc+= FROM_ENV_AFTER=env
|
||||
|
|
|
|||
Loading…
Reference in a new issue