我将this Github repo克隆到了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
而不是sh
或bash
运行。您应该改为:
make -f ./Makefile
但是,通常您只是这样做:
make
某些Makefile作者在文件的顶部放置了一个#/usr/bin/make -f
shebang,以便可以直接执行该文件,但通常不是这种情况。