objective-c - 未指定目标且未找到 makefile

标签 objective-c makefile

我有一个包含这段代码的 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/

相关文章:

iphone - 使用 iOS 5 的外观 API 自定义 UIButton 的 titleLabel

perl - Makefile.PL : Installing multiple scripts and binaries

objective-c - 如何将 Obj-C 2.0 与 GNUstep 一起使用?

c - 仅当项目中发生更改时添加编译时间戳 (C)

iphone - 如何水平翻转 UIButton 和背面的另一个 UIButton?

iphone - 在 iphone 中搜索来自 PDF 的单词

objective-c - 避免 Game Center 上的排行榜黑客攻击

ios - Objective-c Shinobi 网格更新到 2.8

c++ - 涵盖接口(interface)的Makefile(.h文件)

c++ - SIMD程序编译问题