shithub: riscv

Download patch

ref: 90032afb5f48daa2f05f572b645da92db945284f
parent: a24a294465b5e4c4d68618c4bec13e900dbd4ff7
author: Jacob Moody <[email protected]>
date: Thu Feb 29 18:53:22 EST 2024

/sys/src: remove testfiles on mk clean

--- a/sys/src/cmd/eqn/mkfile
+++ b/sys/src/cmd/eqn/mkfile
@@ -23,7 +23,7 @@
 	size.$O\
 	sqrt.$O\
 	text.$O\
-	eqn.$O\
+	y.tab.$O\
 
 YFILES=eqn.y\
 
@@ -39,8 +39,7 @@
 YFLAGS=-d -S
 CFLAGS=-c
 
-eqn.c:	y.tab.c prevy.tab.h
-	cp y.tab.c $target
+y.tab.c:	prevy.tab.h
 
 prevy.tab.h:	y.tab.h
 	rc -c 'cmp -s y.tab.h prevy.tab.h || cp y.tab.h prevy.tab.h'
--- a/sys/src/cmd/git/test/mkfile
+++ b/sys/src/cmd/git/test/mkfile
@@ -9,3 +9,7 @@
 	range
 
 </sys/src/cmd/mktest
+
+clean:V:
+	rm -f *.[$OS] *.out *.a[$OS] y.tab.? lex.yy.c y.debug y.output [$OS].??* $TARG
+	rm -fr scratch
--- a/sys/src/cmd/mkfile
+++ b/sys/src/cmd/mkfile
@@ -51,6 +51,9 @@
 		mk $MKFLAGS $stem
 	}
 
+%.tests:V:
+	@{cd test && mk $MKFLAGS $stem}
+
 cmds:V: $O.cp $O.yacc ${TARG:%=$O.%}
 
 all:V: cmds
@@ -68,10 +71,11 @@
 cleancmds:V:
 	rm -f *.[$OS] [$OS].* y.tab.? y.debug y.output $YTARG.c *.tab.h
 
-clean:V: cleancmds clean.dirs
+clean:V: cleancmds clean.dirs clean.tests
 
 nuke:V: cleancmds nuke.dirs
 	rm -f *.acid
 
-test:VQ: test.dirs cmds
-	@{cd test && mk $MKFLAGS test}
+test.dirs test.tests:V: cmds
+
+test:VQ: test.dirs test.tests
--- a/sys/src/cmd/mkmany
+++ b/sys/src/cmd/mkmany
@@ -67,6 +67,7 @@
 	rm -f *.[$OS] y.tab.? lex.yy.c y.debug y.output [$OS].??* *.acid $TARG $CLEANFILES
 
 clean:V:
+	test -d ./test && @{cd test && mk $MKFLAGS clean}
 	rm -f *.[$OS] *.a[$OS] y.tab.? lex.yy.c y.debug y.output [$OS].??* $TARG $CLEANFILES
 
 %.clean:V:
--- a/sys/src/cmd/mkone
+++ b/sys/src/cmd/mkone
@@ -40,6 +40,7 @@
 	rm -f *.[$OS] [$OS].out y.tab.? lex.yy.c y.debug y.output *.acid $TARG $CLEANFILES
 
 clean:V:
+	test -d ./test && @{cd test && mk $MKFLAGS clean}
 	rm -f *.[$OS] [$OS].out y.tab.? lex.yy.c y.debug y.output $TARG $CLEANFILES
 
 safeinstall:V: $O.out
--- a/sys/src/cmd/mksyslib
+++ b/sys/src/cmd/mksyslib
@@ -28,6 +28,7 @@
 	for(objtype in $CPUS) mk $stem
 
 clean:V:
+	test -d ./test && @{cd test && mk $MKFLAGS clean}
 	rm -f *.[$OS] [$OS].out $CLEANFILES
 
 %.clean:V:
--- a/sys/src/cmd/mktest
+++ b/sys/src/cmd/mktest
@@ -35,7 +35,7 @@
 	for(t in $TEST)
 		if(test -d $t)
 			@{cd $t && mk $MKFLAGS clean}
-	rm -f *.[$OS] *.a[$OS] y.tab.? lex.yy.c y.debug y.output [$OS].??* $TARG $CLEANFILES
+	rm -f *.[$OS] *.out *.a[$OS] y.tab.? lex.yy.c y.debug y.output [$OS].??* $TARG $CLEANFILES
 
 %.clean:V:
 	rm -f $stem.[$OS] [$OS].$stem $stem.acid $stem
--- a/sys/src/libc/mkfile
+++ b/sys/src/libc/mkfile
@@ -12,7 +12,7 @@
 	}
 
 clean:V:
-	for(i in $DIRS)@{
+	for(i in $DIRS $OLDCPUS test)@{
 		echo $i
 		cd $i
 		mk $MKFLAGS clean
--- a/sys/src/libmp/mkfile
+++ b/sys/src/libmp/mkfile
@@ -11,6 +11,11 @@
 		mk $MKFLAGS $target
 	}
 
+cleantest:V:
+	@{cd test && mk $MKFLAGS clean}
+
+clean:V: cleantest
+
 nuke:V: clean
 	rm -f /$objtype/lib/libmp.a