I wanted to create a makefile. So I wrote instructions in a notepad file.
But what extension should I give while saving this file?
views:
150answers:
3If you run:
make
this program will look for a file named makefile in your directory, and then execute it. If you have several makefiles, then you can execute them with the command:
make -f MyMakefile
From the GNU Make documentation
By default, when make looks for the makefile, it tries the following names, in order:
GNUmakefile
,makefile
andMakefile
. Normally you should call your makefile eithermakefile
orMakefile
These will be searched for if you don't specify the makefile with the -f
flag (Only GNU make will look for GNUMakefile
, so give it that name only if you know you're using GNU tools)
It sounds like you're running Windows, in which case makefiles often have a .NMK
suffix (because they are intended for use with NMAKE
). In the civilised world though makefiles do not generally have a suffix: makefile
or Makefile
are the canonical file names.