make 找不到文件
我正在尝试使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在此错误消息中:
我对指示的冒号感到有点惊讶。
我们需要看看Makefile中GOROOT设置了什么,这不太容易。我对构建 go 包不太了解,但从命令行尝试:
并报告打印的内容。
然后尝试更改 Makefile。在它的最开始,添加:
其中回显行必须用制表符缩进,而不是空格,并告诉我们会产生什么。
In this error message:
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:
and report what that prints.
Then try changing the Makefile. At the very beginning of it, add:
where the echo line must be indented with a tab, not spaces, and tell us what that produces.