从 make 文件中禁用 make 内置规则和变量 [英] Disable make builtin rules and variables from inside the make file

查看:20
本文介绍了从 make 文件中禁用 make 内置规则和变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想根据传递的 禁用内置规则和变量-r-R 选项 到 GNU make,从 make 文件中.也欢迎其他允许我隐式和透明地执行此操作的解决方案.

I want to disable builtin rules and variables as per passing the -r and -R options to GNU make, from inside the make file. Other solutions that allow me to do this implicitly and transparently are also welcome.

我发现 几个参考使用MAKEFLAGS,并有类似的问题.

I've found several references to using MAKEFLAGS, and had similar problems.

推荐答案

你可以用 #! 开始 Makefile 并称它为不同的东西,这样人们就不会尝试直接使用make:

You could start the Makefile with a #! and call it something different so people don't try to use make directly:

#!/usr/bin/make -rRf
# ...

如果 GNU make 不是系统 make,这将导致可怕的问题.也许是一个包装脚本?

This will cause horrific problems if GNU make is not the system make. Maybe a wrapper script?

您还可以阅读 $(MAKEFLAGS) 并确保存在所需的标志.

You can also read $(MAKEFLAGS) and make sure the required flags are present.

这篇关于从 make 文件中禁用 make 内置规则和变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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