shithub: rc

ref: 7eadf4cdfa03b8b93c86924dd25cd3dddc78418f
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
		}
	}
}