#ident	"@(#)mk:i386at/:mkrules	1.1.1.1"
#ident	"$Header: $"

Root=$1
Mach=$2
Work=$3
Cpu=$4
Tools=$5

echo "\n ******** Editing command rulefile ********"

ed - ${Root}/usr/src/${Work}/cmd/sgs/xenv/${Cpu}/cmdrules <<X
1,\$s|^CPU[	 ]*=.*|CPU = $Cpu|
1,\$s|^MACH[	 ]*=.*|MACH = $Mach|
1,\$s|^SGS[	 ]*=.*|SGS =|
1,\$s|^PFX[	 ]*=.*|PFX =|
1,\$s|^TOOLS[	 ]*=.*|TOOLS =|
1,\$s|^INC[	 ]*=.*|INC =|
1,\$s|^LEX[	 ]*=.*|LEX =|
1,\$s|^YACC[	 ]*=.*|YACC =|
w ${Root}/${Mach}/usr/ccs/lib/cmd.rulefile
q
X
chmod 0644 ${Root}/${Mach}/usr/ccs/lib/cmd.rulefile

echo "\n ******** Editing library rulefile ********"
ed - ${Root}/usr/src/${Work}/cmd/sgs/xenv/${Cpu}/librules <<X
1,\$s|^CPU[	 ]*=.*|CPU = $Cpu|
1,\$s|^MACH[	 ]*=.*|MACH = $Mach|
1,\$s|^SGS[	 ]*=.*|SGS =|
1,\$s|^PFX[	 ]*=.*|PFX =|
1,\$s|^TOOLS[	 ]*=.*|TOOLS =|
1,\$s|^INC[	 ]*=.*|INC =|
1,\$s|^LEX[	 ]*=.*|LEX =|
1,\$s|^YACC[	 ]*=.*|YACC =|
w ${Root}/${Mach}/usr/ccs/lib/lib.rulefile
q
X
chmod 0644 ${Root}/${Mach}/usr/ccs/lib/lib.rulefile

exit 0
