#!/bin/rc
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

flag e +

if (test -z GOBIN) {
	GOBIN=$home/bin/$objtype
}
. "$GOROOT"/src/Make.$GOARCH
if (test -z "$GC") {
	exit 'missing $GC - maybe no Make.'^$GOARCH^'?'
fi

mk mkbuiltin1
if (test -e $GOBIN/$GC) {
	rm -f _builtin.c
	for (i in runtime unsafe) {
		$GOBIN/$GC -A $i.go
		O=$O ./mkbuiltin1 $i >>_builtin.c
	}
	mv _builtin.c builtin.c
}