指定"makefile"的路径使用"make"命令 [英] Specifying path to "makefile" using "make" command

查看:996
本文介绍了指定"makefile"的路径使用"make"命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从文件系统中的另一个位置运行一个makefile.如何传递要生成的makefile的位置?

I would like to run a makefile from another place in the file system. How do I pass the location of the makefile to make?

如果我站在"/"中,并且想运行一个抵抗"/dir/dir2/dir3/makefile"的makefile,如何将其添加到make命令中?

if I stand in "/" and I would like to run a makefile that resists in "/dir/dir2/dir3/makefile", how do I add that to the make command?

我尝试过:

make --file=dir/dir2/dir3/makefile

但是没有用.

推荐答案

makefile中的所有相对路径都是,而不是makefile的目录.

All relative paths in the makefile will be relative to your current directory and not the directory of the makefile.

假设您了解这一点,并且您想做的事情仍然可以使用,那么您希望-f标志指定要使用的makefile. (在手册页,手册和--help输出中.)

Assuming that you understand that and what you want to do is still going to work then you want the -f flag to specify the makefile to use. (Which is in the man page, the manual and the --help output.)

相反,如果您的意思是要cd到其他地方并运行make,那么也许您正在寻找(cd /some/path && make)?

If, instead, what you mean is you want to cd to somewhere else and run make then perhaps you are looking for (cd /some/path && make)?

这篇关于指定"makefile"的路径使用"make"命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆