chiark / gitweb /
stest: Use topbuilddir (now in common.make)
[secnet.git] / stest / Makefile.in
index f9850594d74707357fb106351d46b03c69a55bf9..0979618cd81294f94d04566f05d9931e442d35ba 100644 (file)
@@ -1,9 +1,13 @@
 
-CC:=@CC@
+VPATH:=@srcdir@
+srcdir:=@srcdir@
+topdir:=@top_srcdir@
+
+include ../common.make
 
 TARGETS=udp-preload.so check
 
-TESTSCRIPTS ?= $(shell echo t-*[0-9a-z])
+TESTSCRIPTS ?= $(shell echo $(srcdir)/t-*[0-9a-z])
 TESTNAMES := $(patsubst t-%,%,$(notdir $(TESTSCRIPTS)))
 
 all: $(TARGETS)
@@ -33,9 +37,11 @@ check:
 
 check-real: $(foreach t,$(TESTNAMES),d-$t/ok)
 
-d-%/ok: t-% udp-preload.so common.tcl ../secnet ../test-example/sites.conf
+d-%/ok: $(srcdir)/t-% udp-preload.so $(srcdir)/common.tcl \
+               ../secnet ../test-example/sites.conf
        @rm -rf d-$*; mkdir d-$*
-       @cd .. && stest/$< >stest/d-$*/log 2>&1
+       export STEST_BUILDDIR=$(topbuilddir); \
+       cd $(topdir) && stest/t-$* >$(topbuilddir)/stest/d-$*/log 2>&1
        @printf "$* "
        @touch $@