shithub: rc

Download patch

ref: 531cc91cd4780a77772252228193e57805339fa9
parent: 9985addd01611707400ea0d840819af260154e40
author: qwx <[email protected]>
date: Mon Sep 4 21:15:41 EDT 2023

mkall: deal with not entirely standard mkfiles

--- a/bin/mkall
+++ b/bin/mkall
@@ -1,11 +1,22 @@
 #!/bin/rc -e
+clean=1
+if(~ $1 -n){
+	clean=()
+	shift
+}
 for(i in amd64 386 arm){
-	if(! ~ $#* 0)
-		objtype=$i mk $*^.install
-	if not
-		objtype=$i mk install
+	objtype=$i {
+		if(! ~ $#* 0)
+			mk $*^.install
+		if not{
+			mk nuke
+			mk install
+		}
+		if(! ~ $#clean 0){
+			if(! ~ $#* 0)
+				mk cleancmds >[2]/dev/null || mk $*^.clean
+			if not
+				mk clean
+		}
+	}
 }
-if(! ~ $#* 0)
-	mk cleancmds || mk $*^.clean
-if not
-	mk clean