blob: 0d1b7a26d9379c91e05e08280cd223828d969aac (
plain)
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
|
# foo.
TEST_SRCS:=$(shell find cases/ -name \*.t | sort -n)
PROGS:=$(patsubst %.t,%.p,$(TEST_SRCS))
HARNESS_SRCS:=main.c
# io_queue.c
CFLAGS=-Wall -Werror -g -O -laio -lredhat-kernel
#-lpthread -lrt
all: $(PROGS)
$(PROGS): %.p: %.t $(HARNESS_SRCS)
$(CC) $(CFLAGS) -DTEST_NAME=\"$<\" -o $@ main.c
clean:
rm -f $(PROGS) *.o runtests.out rofile wofile rwfile
.PHONY:
testdir/rofile: .PHONY
rm -f $@
echo "test" >$@
chmod 400 $@
testdir/wofile: .PHONY
rm -f $@
echo "test" >$@
chmod 200 $@
testdir/rwfile: .PHONY
rm -f $@
echo "test" >$@
chmod 600 $@
check: $(PROGS) testdir/rofile testdir/rwfile testdir/wofile
./runtests.sh $(PROGS)
|