how to “execute” make file

限于喜欢 提交于 2019-12-03 06:40:33

问题


I tried to use a make file in code::blocks but I am doing it wrong. I have the version installed with the compilers included. http://sourceforge.net/projects/codeblocks/files/Binaries/10.05/Windows/codeblocks-10.05mingw-setup.exe/download. What do I do with the make file? It starts with:

CC=gcc

best, US


回答1:


You don't tend to execute the make file itself, rather you execute make, giving it the make file as an argument:

make -f pax.mk

If your make file is actually one of the standard names (like makefile or Makefile), you don't even need to specify it. It'll be picked up by default (if you have more than one of these standard names in your build directory, you better look up the make man page to see which takes precedence).




回答2:


As paxdiablo said make -f pax.mk would execute the pax.mk makefile, if you directly execute it by typing ./pax.mk then you would get syntax error.

You can just type make if your file name is makefile/Makefile.

If suppose you have two files named makefile and Makefile in the same directory then makefile is executed if make alone is giveb. You can even pass arguments to makefile.

check out more about makefile at this Tutorial : Basic understanding of Makefile



来源:https://stackoverflow.com/questions/7751342/how-to-execute-make-file

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