make 找不到文件

发布于 2024-11-07 06:21:38 字数 1070 浏览 0 评论 0原文

我正在尝试使用 make 安装 go 包,但它返回以下内容:

dan@dan-netbook:~/GoMySQL$ make  
Makefile:1: :/home/dan/.go/go/src/Make.inc: No such file or directory  
Makefile:17: :/home/dan/.go/go/src/Make.pkg: No such file or directory  
make: *** No rule to make target `:/home/dan/.go/go/src/Make.pkg'.  Stop.  

但是如果我运行 ls,就会出现丢失的文件:

dan@dan-netbook:~/GoMySQL$ ls /home/dan/.go/go/src/  
all.bash       env.bash  make.bash  Make.common  quietgcc.bash   
all-qemu.bash  lib9      Make.ccmd  Make.inc     run.bash  
clean.bash     libbio    Make.clib  Make.pkg     sudo.bash  
cmd            libmach   Make.cmd   pkg          version.bash  

这是为什么?

编辑: Makefile 是:

include $(GOROOT)/src/Make.inc  

TARG=mysql  
GOFILES=mysql.go\  
   types.go\  
   const.go\  
   error.go\  
   password.go\  
   reader.go\  
   writer.go\  
   packet.go\  
   convert.go\  
   handler.go\  
   result.go\  
   statement.go  

 include $(GOROOT)/src/Make.pkg   

I'm trying to install a go package with make, but it returns the following:

dan@dan-netbook:~/GoMySQL$ make  
Makefile:1: :/home/dan/.go/go/src/Make.inc: No such file or directory  
Makefile:17: :/home/dan/.go/go/src/Make.pkg: No such file or directory  
make: *** No rule to make target `:/home/dan/.go/go/src/Make.pkg'.  Stop.  

but the missing files are present if I run ls:

dan@dan-netbook:~/GoMySQL$ ls /home/dan/.go/go/src/  
all.bash       env.bash  make.bash  Make.common  quietgcc.bash   
all-qemu.bash  lib9      Make.ccmd  Make.inc     run.bash  
clean.bash     libbio    Make.clib  Make.pkg     sudo.bash  
cmd            libmach   Make.cmd   pkg          version.bash  

Why is this?

Edit: Makefile is:

include $(GOROOT)/src/Make.inc  

TARG=mysql  
GOFILES=mysql.go\  
   types.go\  
   const.go\  
   error.go\  
   password.go\  
   reader.go\  
   writer.go\  
   packet.go\  
   convert.go\  
   handler.go\  
   result.go\  
   statement.go  

 include $(GOROOT)/src/Make.pkg   

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

呆橘 2024-11-14 06:21:38

在此错误消息中:

 Makefile:1: :/home/dan/.go/go/src/Make.inc: No such file or directory  
             ^

我对指示的冒号感到有点惊讶。

我们需要看看Makefile中GOROOT设置了什么,这不太容易。我对构建 go 包不太了解,但从命令行尝试:

echo $GOROOT

并报告打印的内容。

然后尝试更改 Makefile。在它的最开始,添加:

foobar:
    echo $(GOROOT)

其中回显行必须用制表符缩进,而不是空格,并告诉我们会产生什么。

In this error message:

 Makefile:1: :/home/dan/.go/go/src/Make.inc: No such file or directory  
             ^

I'm a bit surprised by the indicated colon.

We need to see what GOROOT is set to in the Makefile, which is not too easy. I don't know much about building go packages, but from the command line, try:

echo $GOROOT

and report what that prints.

Then try changing the Makefile. At the very beginning of it, add:

foobar:
    echo $(GOROOT)

where the echo line must be indented with a tab, not spaces, and tell us what that produces.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文