Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I name "makefile" or "Makefile"?

Although both names will do the job, what is the correct name for makefiles?

GNU `make' homepage uses Makefile, and I guess it is the good way to name it. Any reasons for typing the front M in upper case ?

like image 524
Benoit Avatar asked Oct 01 '12 07:10

Benoit


People also ask

Should makefile be capitalized?

Makefile (capitalized) is a standard in Unix world, where file system is case sensitive (i.e. makefile , MAKEFILE and Makefile are all different files). On Windows, it doesn't matter.

What should a makefile include?

Makefiles contain five kinds of things: explicit rules , implicit rules , variable definitions , directives , and comments . Rules, variables, and directives are described at length in later chapters. An explicit rule says when and how to remake one or more files, called the rule's targets.

Where does make look for makefile?

The built-in rules version of . MAKEFILES tells make to look for makefile or Makefile in the working directory. makefile is tried first; Makefile is used only if makefile cannot be found. You can also use the -f file option to give the name of the user makefile explicitly.

What are makefiles called?

The make utility requires a file, Makefile (or makefile ), which defines set of tasks to be executed. You may have used make to compile a program from source code. Most open source projects use make to compile a final executable binary, which can then be installed using make install .


1 Answers

What Name to Give Your Makefile chapter of GNU Make manual clarifies it:

By default, when make looks for the makefile, it tries the following names, in order: GNUmakefile, makefile and Makefile. Normally you should call your makefile either makefile or Makefile. (We recommend Makefile because it appears prominently near the beginning of a directory listing, right near other important files such as README.) The first name checked, GNUmakefile, is not recommended for most makefiles. You should use this name if you have a makefile that is specific to GNU make, and will not be understood by other versions of make. Other make programs look for makefile and Makefile, but not GNUmakefile.

like image 90
Eldar Abusalimov Avatar answered Sep 25 '22 05:09

Eldar Abusalimov