e95e13fdaf032568be18041a61059077f0ed6d03
[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
12 define SINGLETON_PROG
13 PROGS += $(1)
14 $(subst -,_,$(1))_SRC = $(1).c
15 endef
16
17 $(foreach prog,$(SINGLETONS),$(eval $(call SINGLETON_PROG,$(prog))))
18 DISKS = $(patsubst %,%.dsk,$(PROGS))
19
20 disks: $(DISKS)
21
22 %.dsk: %
23         ./prep-disk $<
24
25 clean::
26         rm -f $(DISKS)
27
28 include $(SRCDIR)/Makefile.userprog
29
30 CFLAGS += -Werror