I have to submit a makefile along with my source code for a project in my data structures class. I have never done this before, so I had to do a lot of Googling. Needless to say, I have successfully created a makefile and ran it, but I have found something strange. I am running on a Windows 7 machine, and using a g++ compiler. I downloaded the necessary program so that MinGW will run makefiles. However, only one variation of the commands work. I go to the directory I want and type "mingw32-make", then an error pops up saying "mingw32-make: **** No targets specified and no makefile found. Stop. But if I type "mingw32-make -f <filename.extension>" and hit enter, it works. Even though I have it working, it kind of concerns me that only one of the commands work. My professor will be compiling this in a Linux environment, and I would not like it to not compile because my makefile is somehow messed up. Are there any ideas why it is doing this? And just a side note, my makefile is a txt file named Makefile if that helps. Any help would be greatly appreciated.

When you say it's a textfile named Makefile, do you mean it is named Makefile or Makefile.txt ?

What happens if you rename it Makefile ? make looks for a file named Makefile but it does not look for one named Makefile.txt

Windows has a nasty habit of not telling you the extension. The fact that it can tell you (on the right there) that one file is a cpp file and one a text file, when of course there is no difference between the file types of a cpp file and a plain text file, suggests that it is called Makefile.txt and windows is hiding that from you.

Is there supposed to be a special extension for the makefile?

No. There is supposed to be no extension.

Then how exactly am I supposed to create a makefile? The coding in the text file is correct. I ran it using the command that has -f in it and it worked. Earlier I tried doing a make using notepad++ but that had a .make extension.

On a *nix operating system, you just name the file Makefile and that's it. On windows, I understand if you save the file as "Makefile" (with the "s) it won't secretly name it Makefile.txt

ALternatively, you can change your Windows Explorer settings to show you the filename extensions, and then rename it without the extension. This is a problem with how your operating system displays file names to the user, and how your chosen text editor saves them.

The " marks worked! Thank you so much!