Add more tests.
[pintos-anon] / grading / userprog / Makefile
1 SRCDIR = ../../src
2
3 SINGLETONS = \
4         $(addprefix args-, argc argv0 argvn single multiple dbl-space) \
5         $(addprefix sc-, bad-sp bad-arg boundary) \
6         halt exit \
7         $(addprefix create-, normal empty null bad-ptr long exists bound) \
8         $(addprefix open-, normal missing boundary empty null bad-ptr twice) \
9         $(addprefix close-, normal twice stdin stdout bad-fd) \
10         $(addprefix read-, normal bad-ptr boundary zero stdout bad-fd) \
11         $(addprefix write-, normal bad-ptr boundary zero stdin bad-fd)
12
13 define SINGLETON_PROG
14 PROGS += $(1)
15 $(subst -,_,$(1))_SRC = $(1).c
16 endef
17
18 $(foreach prog,$(SINGLETONS),$(eval $(call SINGLETON_PROG,$(prog))))
19 DISKS = $(patsubst %,%.dsk,$(PROGS))
20
21 disks: $(DISKS)
22
23 %.dsk: %
24         ./prep-disk $<
25
26 clean::
27         rm -f $(DISKS)
28
29 include $(SRCDIR)/Makefile.userprog
30
31 CFLAGS += -Werror