python上的Makefile

Itz*_*984 0 python executable makefile

我正在尝试为python脚本编写一个Makefile,它将创建一个 VMTranslator

可执行文件,应该获取输入,

这意味着它应该如何在shell命令上完成:

1)make <==== should make the VMTranslator executable.

2)VMTranslator BasicTest.vm <==== the user is supposed to use it like this.
Run Code Online (Sandbox Code Playgroud)

我根据在网上找到的内容尝试了以下内容:

#!/usr/local/bin/
    python *$
Run Code Online (Sandbox Code Playgroud)

但它不起作用.

需要包含的文件是:codeWriter.py,vmTranslator.py,parser.py.

如何才能做到这一点?

unw*_*ind 6

Python二进制文件是一个解释器.它不会创建独立的可执行文件.

您可以做的是编写一个可以执行所需操作的Python脚本,只要存在Python可执行文件,就可以使脚本透明地运行:

#!/usr/bin/env python
#

import codeWriter
import vmTranslator
import parser

# Add code here to parse arguments and call into the imported code.
Run Code Online (Sandbox Code Playgroud)

将其另存为VMTranslator,并使文件可执行(chmod +x VMTranslator).