c - 在这个 git repo 中运行 ./Makefile 会导致错误
问题描述
我将这个 Github 存储库克隆到我的 Arch Linux 机器上。我跑了./Makefile
,但得到了这些错误。
./Makefile: line 9: MKFILE: command not found
./Makefile: line 10: DEPSFILE: command not found
./Makefile: line 11: GCC: command not found
./Makefile: line 12: CHEADER: command not found
./Makefile: line 13: CSOURCE: command not found
./Makefile: line 14: OBJECTS: command not found
./Makefile: line 15: EXECBIN: command not found
./Makefile: line 16: SOURCES: command not found
./Makefile: line 19: all: command not found
./Makefile: line 22: -o: command not found
./Makefile: line 24: fg: no job control
./Makefile: line 25: syntax error near unexpected token `newline'
./Makefile: line 25: ` ${GCC} -c $<'
我如何实际运行这个程序?
解决方案
Makefile
不是脚本文件。它被设计为与make
, not sh
or一起运行bash
。你应该这样做:
make -f ./Makefile
但是,通常您只需执行以下操作:
make
一些 Makefile 作者#/usr/bin/make -f
在文件顶部放置了一个 shebang,以便可以直接执行文件,但通常情况并非如此。
推荐阅读
- java - 如何在 Vaadin Flow 图表中应用 VaadinIcons 作为标记符号?
- php - Php api 使用 curl 调用另一个 - 数据丢失
- javascript - 是否可以在 VueJS 模板中设置范围,以便在引用属性时不必重复对象名称?
- ruby-on-rails - 为什么我的模块没有加载到 Rails 中?
- r - 在 R 中解析突变数据
- c++ - 如何在 C++ 中将略有不同的类型视为相同的类型?
- wordpress - 如何格式化wordpress博客中的代码语法?
- c - 您应该释放传递给 prctl() 的内存吗?
- c++ - OpenCV 管道到 gstreamer RTMP 流
- graph - 如何在 JanusGraph 中将多个图实例相互解耦