我有一个包含这段代码的 make 文件:
all: main.o Etudiant.o
gcc -lobjc -o program main.o Etudiant.o
main.o:main.m Etudiant.h
gcc -c main.m
Etudiant.o:Etudiant.m Etudiant.h
gcc -c Etudiant.m
当我在 shell 命令中这样写时:
$make
我明白了:
make: **** No targets specified and no makefile found. Stop.
我该如何解决这个问题?
最佳答案
嗯……makefile。哇。
行首的所有空格。那必须是标签。或者 Make 会吐出一个非常模糊的错误。确保这些是标签,然后重试。
查看键盘左侧标有“tab”的按钮。删除空格并点击一次以插入制表符。
尝试make all
。 IIRC(自从我不得不处理 makefile 以来已经有几年了)大多数 make 将默认为 all
,但也许你的不是。
扩展无关紧要。
天哪!我们都非常密集(@bbum 大多数情况下如此)!
“未找到 Makefile”的意思是……好吧……Make 甚至没有看到 makefile。将 Makefile.m 重命名为 Makefile 的建议是正确的。同样,整个制表符与空格的对比肯定是相关的。
关于objective-c - 未指定目标且未找到 makefile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4962460/