chiark / gitweb /
stest: Break out DEPS
[secnet.git] / stest / Makefile.in
index f9850594d74707357fb106351d46b03c69a55bf9..8b2b3debf9ca1e42a3bd200e503eb93eb18396e7 100644 (file)
@@ -1,11 +1,20 @@
 
-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)))
 
+DEPS += udp-preload.so
+DEPS += $(srcdir)/common.tcl
+DEPS += ../secnet
+DEPS += ../test-example/sites.conf
+
 all: $(TARGETS)
 
 CFLAGS += -D_REENTRANT -fPIC
@@ -33,9 +42,10 @@ 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-% $(DEPS)
        @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 $@