chiark / gitweb /
build system: Break out test-common.make
[secnet.git] / stest / Makefile.in
index f9850594d74707357fb106351d46b03c69a55bf9..40ef0dbb26899a41e0682e93050f1113330b0a26 100644 (file)
@@ -1,12 +1,16 @@
 
-CC:=@CC@
+VPATH:=@srcdir@
+srcdir:=@srcdir@
+topdir:=@top_srcdir@
 
-TARGETS=udp-preload.so check
+TARGETS += udp-preload.so
 
-TESTSCRIPTS ?= $(shell echo 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)
+include ../test-common.make
 
 CFLAGS += -D_REENTRANT -fPIC
 
@@ -30,15 +34,3 @@ MAKE_NOTSPECIAL:=$(MAKE)
 check:
        env -u MAKEFLAGS -u MFLAGS \
        $(MAKE_NOTSPECIAL) -j$(shell nproc || 1)0 check-real
-
-check-real: $(foreach t,$(TESTNAMES),d-$t/ok)
-
-d-%/ok: t-% udp-preload.so common.tcl ../secnet ../test-example/sites.conf
-       @rm -rf d-$*; mkdir d-$*
-       @cd .. && stest/$< >stest/d-$*/log 2>&1
-       @printf "$* "
-       @touch $@
-
-clean:
-       $(RM) -f *.o *.so
-       $(RM) -rf tmp