安装从源转到自定义前缀

问题描述:

I have a Go installation in /usr, which is old (yum). If I download the source from the Golang site and run the all.bash, the binaries and libraries are installed in the downloaded dir.

With a usual Makefile, it's easy to set PREFIX, can this be done in the all.bash file somewhere?

我在/ usr中安装了Go安装,该安装较旧(百胜)。 如果我从Golang网站下载源代码并运行all.bash,则二进制文件和库将安装在下载的目录中。 p>

使用常规的Makefile,可以很容易地设置PREFIX, 可以在all.bash文件中的某个地方完成此操作吗? p> div>

You don't need to "install" it anywhere as long as you have GOPATH set and add $GOROOT/bin to your path.

export PATH="$PATH:/usr/src/go/bin"