Add SUBMAKEFLAGS.
authorBen Pfaff <blp@cs.stanford.edu>
Wed, 6 Apr 2005 18:47:48 +0000 (18:47 +0000)
committerBen Pfaff <blp@cs.stanford.edu>
Wed, 6 Apr 2005 18:47:48 +0000 (18:47 +0000)
Move < from apply-patch to invocations.

tests/Makefile

index ce215b3fd00247464df04e20264e2cd663fe99c6..456e083c81b17623978c9b9e15d94994d7479643 100644 (file)
@@ -13,21 +13,23 @@ check:
 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
@@ -36,6 +38,7 @@ endef
 
 define mk-sandbox
 rm -rf $@ && mkdir -p $@/pintos && cp -R ../src $@/pintos
+cd $@/pintos/src && $(MAKE) clean $(SUBMAKEFLAGS)
 endef
 
 define run-tests
@@ -47,7 +50,7 @@ rm -rf $@/pintos
 endef
 
 define apply-patch
-(cd $@/pintos && patch -p0 -s) <
+(cd $@/pintos && patch -p0)
 endef
 
 threads: PROJECT = threads
@@ -59,14 +62,14 @@ 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)
 
@@ -74,16 +77,16 @@ list: PROJECT = threads
 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)
 
@@ -91,7 +94,7 @@ p2: PROJECT = userprog
 p2::
        $(prep-grading)
        $(mk-sandbox)
-       $(apply-patch) ../solutions/p2.patch
+       $(apply-patch) ../solutions/p2.patch
        $(run-tests)
        $(clean)
 
@@ -99,12 +102,12 @@ vm: PROJECT = vm
 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)