mirror of
https://github.com/golang/go
synced 2024-10-05 16:01:22 -06:00
ce7f345cd1
R=r CC=golang-dev https://golang.org/cl/190104
34 lines
876 B
Bash
Executable File
34 lines
876 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 and builtin.c.boot 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
|
|
|
|
GOBIN="${GOBIN:-$HOME/bin}"
|
|
|
|
. "$GOROOT"/src/Make.$GOARCH
|
|
if [ -z "$GC" ]; then
|
|
echo 'missing $GC - maybe no Make.$GOARCH?' 1>&2
|
|
exit 1
|
|
fi
|
|
|
|
gcc -o mkbuiltin1 mkbuiltin1.c
|
|
rm -f _builtin.c
|
|
for i in runtime unsafe
|
|
do
|
|
"$GOBIN"/$GC -A $i.go
|
|
O=$O ./mkbuiltin1 $i >>_builtin.c
|
|
done
|
|
|
|
# If _builtin.c has changed vs builtin.c.boot,
|
|
# check in the new change.
|
|
cmp -s _builtin.c builtin.c.boot || cp _builtin.c builtin.c.boot
|
|
|
|
mv _builtin.c builtin.c
|