46c6c4
diff --git a/Makefile.in b/Makefile.in
86ff90
index e1b2ff3..ff82f29 100644
46c6c4
--- a/Makefile.in
46c6c4
+++ b/Makefile.in
46c6c4
@@ -7,6 +7,7 @@
46c6c4
 srcdir =	@srcdir@
46c6c4
 VPATH =		@srcdir@
46c6c4
 top_srcdir =	@top_srcdir@
46c6c4
+top_builddir =  @top_builddir@
46c6c4
 
46c6c4
 VERSION=@BIND9_VERSION@
46c6c4
 
46c6c4
@@ -86,7 +87,8 @@ force-test: test-force
46c6c4
 test-force:
46c6c4
 	status=0; \
46c6c4
 	(cd bin/tests && ${MAKE} ${MAKEDEFS} test) || status=1; \
46c6c4
-	(test -f unit/unittest.sh && $(SHELL) unit/unittest.sh) || status=1; \
46c6c4
+	(test -f ${top_builddir}/unit/unittest.sh && \
46c6c4
+		$(SHELL) ${top_builddir}/unit/unittest.sh) || status=1; \
46c6c4
 	exit $$status
46c6c4
 
46c6c4
 README: README.md
86ff90
@@ -110,6 +112,6 @@ CONTRIBUTING: CONTRIBUTING.md
86ff90
 		sed -e '$${/^$$/d;}' > $@
46c6c4
 
46c6c4
 unit::
46c6c4
-	sh ${top_srcdir}/unit/unittest.sh
46c6c4
+	sh ${top_builddir}/unit/unittest.sh
46c6c4
 
46c6c4
 clean::
46c6c4
diff --git a/lib/dns/tests/Makefile.in b/lib/dns/tests/Makefile.in
46c6c4
index c7fd4ed..2a6571b 100644
46c6c4
--- a/lib/dns/tests/Makefile.in
46c6c4
+++ b/lib/dns/tests/Makefile.in
46c6c4
@@ -234,7 +234,7 @@ tsig_test@EXEEXT@: tsig_test.@O@ dnstest.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
46c6c4
 			${ISCLIBS} ${LIBS}
46c6c4
 
46c6c4
 unit::
46c6c4
-	sh ${top_srcdir}/unit/unittest.sh
46c6c4
+	sh ${top_builddir}/unit/unittest.sh
46c6c4
 
46c6c4
 clean distclean::
46c6c4
 	rm -f ${TARGETS}
46c6c4
diff --git a/lib/irs/tests/Makefile.in b/lib/irs/tests/Makefile.in
46c6c4
index 2ecf8b0..38bf342 100644
46c6c4
--- a/lib/irs/tests/Makefile.in
46c6c4
+++ b/lib/irs/tests/Makefile.in
46c6c4
@@ -45,7 +45,7 @@ resconf_test@EXEEXT@: resconf_test.@O@ ${CFGDEPLIBS} ${DNSDEPLIBS} ${IRSDEPLIBS}
46c6c4
 			resconf_test.@O@ ${LIBS}
46c6c4
 
46c6c4
 unit::
46c6c4
-	sh ${top_srcdir}/unit/unittest.sh
46c6c4
+	sh ${top_builddir}/unit/unittest.sh
46c6c4
 
46c6c4
 clean distclean::
46c6c4
 	rm -f ${TARGETS}
46c6c4
diff --git a/lib/isc/tests/Makefile.in b/lib/isc/tests/Makefile.in
cb2172
index 20c7e25..f7fa538 100644
46c6c4
--- a/lib/isc/tests/Makefile.in
46c6c4
+++ b/lib/isc/tests/Makefile.in
cb2172
@@ -159,7 +159,7 @@ time_test@EXEEXT@: time_test.@O@ ${ISCDEPLIBS}
cb2172
 			time_test.@O@ ${ISCLIBS} ${LIBS}
46c6c4
 
46c6c4
 unit::
46c6c4
-	sh ${top_srcdir}/unit/unittest.sh
46c6c4
+	sh ${top_builddir}/unit/unittest.sh
46c6c4
 
46c6c4
 clean distclean::
46c6c4
 	rm -f ${TARGETS}
46c6c4
diff --git a/lib/isccfg/tests/Makefile.in b/lib/isccfg/tests/Makefile.in
46c6c4
index be64b92..cbd444a 100644
46c6c4
--- a/lib/isccfg/tests/Makefile.in
46c6c4
+++ b/lib/isccfg/tests/Makefile.in
46c6c4
@@ -44,7 +44,7 @@ parser_test@EXEEXT@: parser_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS} ${ISCCFGDEPLIBS
46c6c4
 				${ISCLIBS} ${LIBS}
46c6c4
 
46c6c4
 unit::
46c6c4
-	sh ${top_srcdir}/unit/unittest.sh
46c6c4
+	sh ${top_builddir}/unit/unittest.sh
46c6c4
 
46c6c4
 clean distclean::
46c6c4
 	rm -f ${TARGETS}
46c6c4
diff --git a/lib/lwres/tests/Makefile.in b/lib/lwres/tests/Makefile.in
46c6c4
index 7166d44..10db3e7 100644
46c6c4
--- a/lib/lwres/tests/Makefile.in
46c6c4
+++ b/lib/lwres/tests/Makefile.in
46c6c4
@@ -39,7 +39,7 @@ config_test@EXEEXT@: config_test.@O@ ${LWRESDEPLIBS}
46c6c4
 			config_test.@O@ ${LWRESLIBS} ${LIBS}
46c6c4
 
46c6c4
 unit::
46c6c4
-	sh ${top_srcdir}/unit/unittest.sh
46c6c4
+	sh ${top_builddir}/unit/unittest.sh
46c6c4
 
46c6c4
 clean distclean::
46c6c4
 	rm -f ${TARGETS}