python-3.x - 将 MakeFile 转换为命令行输入或 bazel
问题描述
我目前正在开发一个项目,该项目特别要求我不要使用 Makefile 来构建所有依赖项,因为他们的整个 repo 使用 bazel 来构建文件。我对 MakeFile 的了解为零。我想知道如何将以下 Makefile 转换为命令行参数,然后我可以将其放入简单的 Python 脚本中。先感谢您!非常感谢您的解决方案!
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = .
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
解决方案
如果执行“make”或“make help”,它将执行:
sphinx-build -M help . _build
如果您使用任何其他目标调用 Make,例如“make foo”,并且该目标不存在(或它存在但比 旧Makefile
),它将执行:
sphinx-build -M foo . _build
推荐阅读
- c - ncurses中的nodelay()和cbreak()有什么区别?
- c# - 双向链接到 ListView 的所有 SelectedItems 的属性?
- c++ - 指向失去价值的对象向量的指针
- android - 如何处理类型不匹配 - 字符串和字符串?
- javascript - 如何在表格中允许 xss
- javascript - Electron 选择带有文本输入和 onclick 事件的目录
- java - 将 EditText 值从 android 发送到 PHP 文件并执行 PHPmailer send() 函数
- python - 使用networkx的有向网络和边缘权重
- android - 如何本地链接库并避免冲突?
- node.js - npm install -g firebase-tools 导致错误