shithub: rc

ref: ce7c66bff42a5073a334915fda1f70398747828c
dir: /bin/mkall/

View raw version
#!/bin/rc -e
rfork n
clean=1
install=1
while(~ $1 -?){
	switch($1){
	case -u
		clean=()
		shift
	case -n
		install=()
		clean=()
		shift
	case *
		usage
	}
}
for(i in amd64 386 arm){
	objtype=$i {
		if(! ~ $#* 0){
			if(! ~ $#install 0)
				mk $*^.install
			if not
				mk $*
		}
		if not{
			mk nuke
			if(! ~ $#install 0)
				mk install
			if not
				mk
		}
		if(! ~ $#clean 0){
			if(! ~ $#* 0)
				mk cleancmds >[2]/dev/null || mk $*^.clean
			if not
				mk clean
		}
	}
}