没有指定目标,也没有找到makefile

编程入门 行业动态 更新时间:2024-10-25 04:26:59
本文介绍了没有指定目标,也没有找到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

本文发布于:2023-11-04 00:49:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1556503.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:没有找到   目标   makefile

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!