1
0
mirror of https://github.com/golang/go synced 2024-11-20 10:44:41 -07:00
go/src/cmd/gc/mkbuiltin
Maxim Pimenov 87a04c0bcf gc: fix comment in mkbuiltin
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5669046
2012-02-14 16:27:35 -05:00

32 lines
864 B
Bash
Executable File

#!/bin/sh
# 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.
# Generate builtin.c from $* (runtime.go and unsafe.go).
# Run this after changing runtime.go and unsafe.go
# or after changing the export metadata format in the compiler.
# Either way, you need to have a working compiler binary first.
set -e
eval $(go tool dist env)
if [ -z "$GOCHAR" ]; then
echo 'missing $GOCHAR - go tool dist failed?' 1>&2
exit 1
fi
GC=${GOCHAR}g
gcc -o mkbuiltin1 mkbuiltin1.c
rm -f _builtin.c
for i in runtime unsafe
do
go tool $GC -A $i.go
O=$GOCHAR ./mkbuiltin1 $i >>_builtin.c
done
# If _builtin.c has changed vs builtin.c,
# check in the new change.
cmp -s _builtin.c builtin.c || cp _builtin.c builtin.c
rm _builtin.c mkbuiltin1 unsafe.$GOCHAR runtime.$GOCHAR