8 TARGETS=udp-preload.so check
10 TESTSCRIPTS ?= $(shell echo $(srcdir)/t-*[0-9a-z])
11 TESTNAMES := $(patsubst t-%,%,$(notdir $(TESTSCRIPTS)))
13 DEPS += udp-preload.so
14 DEPS += $(srcdir)/common.tcl
16 DEPS += ../test-example/sites.conf
20 CFLAGS += -D_REENTRANT -fPIC
22 udp-preload.so: udp-preload.o
23 $(CC) -shared -Wl,-soname,$@.1 $^ -o $@ -ldl
25 # These test scripts use little cpu but contain sleeps etc. So when
26 # there are several, we are going to want to run *loads* in parallel.
28 # Ideally we would do something like "every one of these counts for a
29 # tenth of a job" but make can't do that. So bodge it: we treat all the
30 # tests as a single job, and disconnect the parent's jobserver.
32 # make.info says $(MAKE) causes special handling of the rule but only
33 # if it's written literally like that in the rule, hence this
34 # indirection. We need no squash MAKEFLAGS and MFLAGS too.
35 # MAKELEVEL seems like it will be fine to pass on.
37 MAKE_NOTSPECIAL:=$(MAKE)
40 env -u MAKEFLAGS -u MFLAGS \
41 $(MAKE_NOTSPECIAL) -j$(shell nproc || 1)0 check-real
43 check-real: $(foreach t,$(TESTNAMES),d-$t/ok)
45 d-%/ok: $(srcdir)/t-% $(DEPS)
46 @rm -rf d-$*; mkdir d-$*
47 export STEST_BUILDDIR=$(topbuilddir); \
48 cd $(topdir) && stest/t-$* >$(topbuilddir)/stest/d-$*/log 2>&1