【问题标题】:Making executables with makefile on python code [closed]在python代码上使用makefile制作可执行文件[关闭]
【发布时间】:2012-05-03 20:58:33
【问题描述】:

我正在尝试运行以下 makefile:

all:
    chmod +x codeWriter.py
    chmod +x parser.py
    chmod +x vmTranslator.py
    chmod +x VMtranslator


tar:
    tar cvf project7.tar README Makefile *.py VMtranslator

clean:
    rm -f *.tar *.pyc os* sys*

但由于某些未知原因,我收到了这些错误:

line 1: all:: command not found
chmod: codeWriter.py: No such file or directory
chmod: parser.py: No such file or directory
chmod: vmTranslator.py: No such file or directory
chmod: VMtranslator: No such file or directory

line 7: tar:: command not found
tar: README: Cannot stat: No such file or directory
tar: Makefile: Cannot stat: No such file or directory
tar: *.py: Cannot stat: No such file or directory
tar: VMtranslator: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors.

知道为什么吗?

谢谢!

【问题讨论】:

  • 相对于您尝试 chmod +x 的脚本而言,您的 makefile 的路径是什么?

标签: python makefile executable


【解决方案1】:

听起来你试图运行 Makefile,就好像它是一个 shell 脚本(可能是 sh Makefile)。 Makefile 不应该直接运行,甚至不应该有执行权限(在大多数情况下)。

要在 Makefile 中执行配方,请运行 make

【讨论】:

  • 哇,对不起,我今天还没醒。
【解决方案2】:

尝试按照此处所述定义工作主管:

Common GNU makefile directory path

使用该 PWD 引用脚本文件以调用 chmod

【讨论】:

    猜你喜欢
    • 2012-03-20
    • 1970-01-01
    • 2023-01-27
    • 2011-10-14
    • 2012-02-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-07-17
    相关资源
    最近更新 更多