chiark / gitweb /
test-common: Cope if argv0 starts with ./
[secnet.git] / stest / Subdir.sd.mk
1
2 &TARGETS += & udp-preload.so
3
4 &DEPS += & udp-preload.so
5 &DEPS += &^/common.tcl
6 &DEPS += secnet
7 &DEPS += test-example/sites.conf
8 &DEPS += test-example/inside.key
9 &DEPS += test-example/outside.key
10
11 &:include test-common.sd.mk
12
13 &OBJECTS += & udp-preload.o
14
15 $(&OBJECTS) : ALL_CFLAGS += -D_REENTRANT -fPIC
16
17 &udp-preload.so: $(&OBJECTS)
18         $(CC) -shared -Wl,-soname,$@.1 $^ -o $@ -ldl
19
20 # These test scripts use little cpu but contain sleeps etc.  So when
21 # there are several, we are going to want to run *loads* in parallel.
22 #
23 # Ideally we would do something like "every one of these counts for a
24 # tenth of a job" but make can't do that.  So bodge it: we treat all the
25 # tests as a single job, and disconnect the parent's jobserver.
26 #
27 # make.info says $(MAKE) causes special handling of the rule but only
28 # if it's written literally like that in the rule, hence this
29 # indirection.  We need no squash MAKEFLAGS and MFLAGS too.
30 # MAKELEVEL seems like it will be fine to pass on.
31
32 MAKE_NOTSPECIAL:=$(MAKE)
33
34 &check: $(&DEPS)
35         env -u MAKEFLAGS -u MFLAGS \
36         $(MAKE_NOTSPECIAL) -j$(shell nproc || 1)0 &check-real