Plan 9 from Bell Labs’s /usr/web/sources/contrib/ericvh/go-plan9/src/cmd/gc/mkbuiltin

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/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.

. $GOROOT/src/mk.$GOARCH
if(~ $GC ''){
	echo 'missing $GC - maybe no mk.$GOARCH?' >[1=2]
	exit 1
}

#8c mkbuiltin1.c
#8l -o mkbuiltin1 mkbuiltin1.8

rm -f _builtin.c
for(i in runtime unsafe){
	$GC -A $i.go
	./mkbuiltin1 $i >>_builtin.c
}

# If _builtin.c has changed vs builtin.c.boot,
# check in the new change if being run by
# one of the people who tends to work on
# the compiler.  This makes sure that changes
# don't get forgotten, without causing problems
# in end user Go repositories.
switch($user){
case ken r rsc
	if(! cmp _builtin.c builtin.c.boot >/dev/null 2>/dev/null){
		PATH=$PATH:/usr/local/bin	# find p4 on OS X
		p4 open builtin.c.boot >/dev/null 2>/dev/null || true	# if p4 is missing, so be it
		cp _builtin.c builtin.c.boot
	}
}

cat _builtin.c
rm -f _builtin.c

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.