-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
43 lines (36 loc) · 1.22 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
srcdir = @srcdir@
CC = @CC@
CFLAGS= @CFLAGS@
# Build the expect wrapper script that preloads the read1.so library.
expect-read1 expect-readmore:
rm -f $@-tmp; \
touch $@-tmp; \
echo "# THIS FILE IS GENERATED -*- buffer-read-only: t -*-" >>$@-tmp; \
echo "# vi:set ro:" >>$@-tmp; \
if [ $@ = expect-read1 ] ; then \
echo "export LD_PRELOAD=`pwd`/read1.so" >>$@-tmp; \
else \
echo "export LD_PRELOAD=`pwd`/readmore.so" >>$@-tmp; \
fi; \
echo 'exec expect "$$@"' >>$@-tmp; \
chmod +x $@-tmp; \
mv $@-tmp $@
# Build the read1.so preload library. This overrides the 'read'
# function, making it read one byte at a time. Running the testsuite
# with this catches racy tests.
read1.so: $(srcdir)/scripts/read1.c
$(CC) -o $@ $^ -Wall -shared -fPIC $(CFLAGS)
# Build the readmore.so preload library. This overrides the 'read'
# function, making it try harder to read more at a time. Running the
# testsuite with this catches racy tests.
readmore.so: $(srcdir)/scripts/read1.c
$(CC) -o $@ $^ -Wall -shared -fPIC $(CFLAGS) -DREADMORE
# Build the read1 machinery.
.PHONY: read1 readmore
read1: read1.so expect-read1
readmore: readmore.so expect-readmore
check:
$(srcdir)/testsuite/test.sh
$(srcdir)/test.sh
clean:
rm -fr builds/*