diff --git a/src/pkg/runtime/Makefile b/src/pkg/runtime/Makefile index e9488cfb505..3a2d3139763 100644 --- a/src/pkg/runtime/Makefile +++ b/src/pkg/runtime/Makefile @@ -26,8 +26,12 @@ GOFILES=\ softfloat64.go\ type.go\ version.go\ + version_$(GOOS).go\ + version_$(GOARCH).go\ runtime_defs.go\ +CLEANFILES+=version.go version_*.go + OFILES_windows=\ syscall.$O\ @@ -127,6 +131,12 @@ mkversion: mkversion.c version.go: mkversion ./mkversion >version.go +version_$(GOARCH).go: + (echo 'package runtime'; echo 'const theGoarch = "$(GOARCH)"') >$@ + +version_$(GOOS).go: + (echo 'package runtime'; echo 'const theGoos = "$(GOOS)"') >$@ + %.c: %.goc goc2c ./goc2c `pwd`/$< > $@.tmp mv -f $@.tmp $@ diff --git a/src/pkg/runtime/mkversion.c b/src/pkg/runtime/mkversion.c index 9790d3f093f..56afa1892ed 100644 --- a/src/pkg/runtime/mkversion.c +++ b/src/pkg/runtime/mkversion.c @@ -5,13 +5,11 @@ char *template = "// generated by mkversion.c; do not edit.\n" "package runtime\n" "const defaultGoroot = \"%s\"\n" - "const theVersion = \"%s\"\n" - "const theGoarch = \"%s\"\n" - "const theGoos = \"%s\"\n"; + "const theVersion = \"%s\"\n"; void main(void) { - print(template, getgoroot(), getgoversion(), getgoarch(), getgoos()); + print(template, getgoroot(), getgoversion()); exits(0); }