没有指定目标,也没有找到makefile [英] No targets specified and no makefile found

查看:130
本文介绍了没有指定目标,也没有找到makefile的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含以下代码的制作文件:

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.

我该如何解决?

解决方案

Mmm ... makefiles.呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜

该行开头的所有空白.那必须是制表符.否则,Make会掩盖一个真正晦涩的错误.确保这些是标签页,然后重试.


请参阅键盘左侧标记为选项卡"的按钮.删除空格并单击一次以插入制表符.


尝试make all. IIRC(自从我不得不处理makefile以来已经有几年了),大多数make将默认为all,但也许不是.

扩展名无关紧要.


天哪!我们都是额外的密集人群(大多数都是@bbum)!

未找到Makefile"的意思是……好吧,Make甚至都没有看到makefile.将Makefile.m重命名为Makefile的建议是正确的.同样,整个制表符与空格之间的关系当然也很重要.

I have a make file that contains this code:

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

When I write this in the shell command:

$make

I got this:

make: **** No targets specified and no makefile found. Stop.

How do I fix this?

解决方案

Mmm... makefiles. Whee.

All that whitespace at the beginning of the line. That has to be tabs. Or Make will barf up a really obscure error. Make sure those are tabs and try again.


See the button on the left side of the keyboard labeled "tab". Delete the spaces and hit that once to insert a tab character.


Try make all. IIRC (been a few years since I've had to muck with makefiles) most makes will default to all, but maybe yours isn't.

Extension doesn't matter.


Holy Heck! We are all Extra Dense(@bbum mostly so)!

"no Makefile found" means... well.. that Make didn't even see the makefile. The suggestions to rename the Makefile.m to Makefile are correct. As well, the whole tab vs. whitespace thing is certainly pertinent.

这篇关于没有指定目标,也没有找到makefile的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆