Work on userprog testing.
[pintos-anon] / grading / userprog / Makefile
1 SRCDIR = ../../src
2
3 SINGLETONS = create-normal create-empty create-null create-invalid create-long 
4
5 define SINGLETON_PROG
6 PROGS += $(1)
7 $(1)_SRC = $(1).c
8 endef
9
10 $(foreach prog,$(SINGLETONS),$(eval $(call SINGLETON_PROG,$(prog))))
11 DISKS = $(patsubst %,%.dsk,$(PROGS))
12
13 disks: $(DISKS)
14
15 PINTOS = ../../src/utils/pintos
16 OS_DISK = ../../src/userprog/build/os.dsk
17 %.dsk: %
18         rm -f $@.tmp
19         $(PINTOS) make-disk $@.tmp 2
20         $(PINTOS) -v --os-disk=$(OS_DISK) --fs-disk=$@.tmp run -f -q
21         $(PINTOS) -v --os-disk=$(OS_DISK) --fs-disk=$@.tmp put $<
22         mv $@.tmp $@
23
24 clean::
25         rm -f $(DISKS)
26
27 include $(SRCDIR)/Makefile.userprog