No goals set and makefile was not found.

I have a make file containing 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 a shell command:

$make

I got it:

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

How to fix it?

+5
source share
4 answers

Mmm ... makefiles. Whee

All spaces at the beginning of a line. These should be tabs. Or Make will make a really obscure mistake. Make sure these are tabs and try again.


See the button on the left side of the keyboard labeled “tab.” Delete the spaces and press once to insert a tab character.


Give it a try make all. IIRC (several years have passed since I had to dump files with make files), most of them will be by default all, but maybe your not.

.


! Extra Dense (@bbum )!

"no Makefile found" ... ... Make make . Makefile.m Makefile . , , , .

+14

makefile

make make all, make Makefile . , . make Makefile Makefile.m.

+4

Re:
$ Make Make: * makefile. .

, Makefile (none) .bat - .

0

Just spent some insanely disappointing moments with this mistake. My mistake was not so subtle: I called the makefile MakeFile not Makefile, so even using the -f Makefile command (forcing the makefile file name) still led to not found because it was a MakeFile and not a Makefile.

0
source

All Articles