此git repo中的运行./Makefile会导致错误

问题描述 投票:0回答:1

我将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 $<'

我实际上如何运行该程序?

c makefile
1个回答
0
投票

Makefile不是脚本文件。它设计为以make而不是shbash运行。您应该改为:

make -f ./Makefile

但是,通常您只是这样做:

make

某些Makefile作者在文件的顶部放置了一个#/usr/bin/make -f shebang,以便可以直接执行该文件,但通常不是这种情况。

© www.soinside.com 2019 - 2024. All rights reserved.