有没有一种方法可以让Go在一步中进行编译和链接(同时执行6g和6l)?

huangapple go评论103阅读模式
英文:

Is there a way to get Go to compile and link in one step (6g and 6l at once)?

问题

我正在尝试搜索Google,但关键词'go'使得很难找到任何有用的答案。
阅读http://golang.org/页面也没有找到任何有用的信息。

目前,我在我的bash.rc中有一个简单的函数:

function gogo() {
    6g -o gotmp.tmp $@;
    6l -o go.out gotmp.tmp;
    rm -f gotmp.tmp;
}

然而,这并不完美。希望有一些内置的东西(也许类似于gogcc,但使用6g/6l后端)。

谢谢!

英文:

I'm trying to search Google but the keyword 'go' makes it difficult to find any useful answers.
Reading the http://golang.org/ page doesn't turn up anything useful either.

Right now, I have a simple function in my bash.rc:

function gogo() {
    6g -o gotmp.tmp $@;
    6l -o go.out gotmp.tmp;
    rm -f gotmp.tmp;
}

However, this is not perfect. It would be nice for something built in (perhaps something like gogcc but using 6g/6l backend).

Thanks!

答案1

得分: 6

你有不使用构建系统的理由吗?

$GOROOT/doc/ 目录下有一个现成的 Makefile。其他构建系统:https://stackoverflow.com/questions/1735993/what-build-systems-work-with-go

英文:

Do you have a reason to not use a build system?

There is a ready made Makefile in $GOROOT/doc/. Other build systems: https://stackoverflow.com/questions/1735993/what-build-systems-work-with-go

huangapple
  • 本文由 发表于 2009年11月15日 10:10:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/1736333.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定