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