Should I name “makefile” or “Makefile”?

删除回忆录丶 提交于 2019-12-18 18:37:20

问题


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 ?


回答1:


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.




回答2:


I think that Makefile is displayed at the almost top of the list rather than makefile when using the ls command.




回答3:


it is not only the reason that it appears prominently near the beginning of a directory listing, but also that it would cause a compile error when you using “makefile” to replace “Makefile”。 you could try to test in the helloworld case of Linux device driver..



来源:https://stackoverflow.com/questions/12669367/should-i-name-makefile-or-makefile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!