clean:
rm -rf $(TESTS)
+SUBMAKEFLAGS = -s
+
define prep-threads-grading
endef
define prep-userprog-grading
-$(MAKE) -C ../src/userprog -s
-$(MAKE) -C ../grading/userprog -s
+$(MAKE) -C ../src/userprog $(SUBMAKEFLAGS)
+$(MAKE) -C ../grading/userprog $(SUBMAKEFLAGS)
endef
define prep-vm-grading
-$(MAKE) -C ../src/userprog -s
-$(MAKE) -C ../grading/vm -s
+$(MAKE) -C ../src/userprog $(SUBMAKEFLAGS)
+$(MAKE) -C ../grading/vm $(SUBMAKEFLAGS)
endef
define prep-filesys-grading
-$(MAKE) -C ../grading/filesys -s
+$(MAKE) -C ../grading/filesys $(SUBMAKEFLAGS)
endef
define prep-grading
define mk-sandbox
rm -rf $@ && mkdir -p $@/pintos && cp -R ../src $@/pintos
+cd $@/pintos/src && $(MAKE) clean $(SUBMAKEFLAGS)
endef
define run-tests
endef
define apply-patch
-(cd $@/pintos && patch -p0 -s) <
+(cd $@/pintos && patch -p0)
endef
threads: PROJECT = threads
p1-1: PROJECT = threads
p1-1::
$(mk-sandbox)
- $(apply-patch) ../solutions/p1-1.patch
+ $(apply-patch) < ../solutions/p1-1.patch
$(run-tests) -d alarm.*
$(clean)
p1-2: PROJECT = threads
p1-2::
$(mk-sandbox)
- $(apply-patch) ../solutions/p1-2.patch
+ $(apply-patch) < ../solutions/p1-2.patch
$(run-tests) -d priority.*
$(clean)
list stdlib stdio::
$(mk-sandbox)
cp ../src/tests/threads/$@.c $@/pintos/src/threads/test.c
- $(MAKE) -C $@/pintos/src/threads -s
+ $(MAKE) -C $@/pintos/src/threads $(SUBMAKEFLAGS)
-(cd $@/pintos/src/threads/build && pintos -v run -q) | tee $@/output
grep -q '$@: PASS' $@/output
$(clean)
userprog: PROJECT = userprog
userprog::
- $(prep-grading)
+ $(prep-grading) null.dsk
$(mk-sandbox)
- $(apply-patch) ../solutions/p2-null.patch
+ $(apply-patch) < ../solutions/p2-null.patch
$(run-tests) null
$(clean)
p2::
$(prep-grading)
$(mk-sandbox)
- $(apply-patch) ../solutions/p2.patch
+ $(apply-patch) < ../solutions/p2.patch
$(run-tests)
$(clean)
vm::
$(prep-grading)
$(mk-sandbox)
- $(MAKE) -C $@/pintos/src/vm -s
+ $(MAKE) -C $@/pintos/src/vm $(SUBMAKEFLAGS)
$(clean)
filesys: PROJECT = filesys
filesys::
$(prep-grading)
$(mk-sandbox)
- $(MAKE) -C $@/pintos/src/filesys -s
+ $(MAKE) -C $@/pintos/src/filesys $(SUBMAKEFLAGS)
$(clean)