我有一个包含 5 个 python 脚本的工具,比如A.py、B.py、C.py、D.py和E.py。我必须在 Linux 中运行这个程序。A.py是我运行的一个程序,它导入其他文件并使用它们。为了运行 A.py,我使用命令
$蟒蛇A.py
到目前为止,输入和输出路径都是在 A.py 中硬编码的。现在我应该编写一个包含所有文件结构和依赖项的makefile。这个 makefile 还应该包括执行 python scrip A.py 的命令。当make makefile
调用命令并且工具应该开始运行时,必须了解所需的输入和输出路径。这该怎么做?
编辑:
生成文件应该是这样的,包含所有这些细节。
INPUT_PATH = list of all input paths
FILES = list of .c files located in the above specified paths
OUTPUT_PATH = output path where generated file has to be stored
command to execute python scrip:
A.py inputpath+filename outputpath
Run Code Online (Sandbox Code Playgroud)
所以每当有新的输入 .c 文件时,它们都会被添加到 makefile 的列表中。您可以建议任何此类示例生成文件吗?