简体   繁体   English

如何“执行”制作文件

[英]how to "execute" make file

I tried to use a make file in code::blocks but I am doing it wrong.我试图在 code::blocks 中使用 make 文件,但我做错了。 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 . http://sourceforge.net/projects/codeblocks/files/Binaries/10.05/Windows/codeblocks-10.05mingw-setup.exe/download What do I do with the make file?我该怎么处理make文件? It starts with:它开始于:

CC=gcc

best, US最好的,美国

You don't tend to execute the make file itself, rather you execute make , giving it the make file as an argument: 你不倾向于自己执行make文件,而是执行make ,将make文件作为参数给出:

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. 如果make文件实际上是标准名称之一(如makefileMakefile ),则甚至不需要指定它。 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). 它默认会被选中(如果你的构建目录中有多个这些标准名称,你最好查看make man页面以查看哪个优先)。

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. 正如paxdiablo所说make -f pax.mk会执行pax.mk makefile,如果你通过输入./pax.mk直接执行它,那么你会得到语法错误。

You can just type make if your file name is makefile/Makefile . 如果您的文件名是makefile/Makefile则可以输入make

If suppose you have two files named makefile and Makefile in the same directory then makefile is executed if make alone is giveb. 如果假设在同一目录中有两个名为makefileMakefile ,那么如果make each是giveb,则执行makefile You can even pass arguments to makefile. 您甚至可以将参数传递给makefile。

check out more about makefile at this Tutorial : Basic understanding of Makefile 在本教程中查看有关makefile的更多信息: 对Makefile的基本理解

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM