'makefile erro " *** No target specified and no makefile found.stop."

I have a makefile that contains this code

all: hello.exe

hello.exe: hello.o
     gcc -o hello.exe hello.o

hello.o: hello.c
     gcc -c hello.c

clean:
     rm hello.o hello.exe

When i write this command

  mingh32-make

I got this:

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


Solution 1:[1]

You can solve this in 2 ways.

  1. As the commenters say, rename your file from makefile.txt to makefile.
  2. Another way, use mingw32-make -f makefile.txt

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ice1000