On 2012-11-29, Philip Guenther wrote:

> On Wed, Apr 25, 2012 at 9:02 PM, [email protected] <[email protected]> wrote:
>>         hi,I have a question that when I use a command "make -p",it will 
>> print
>> a lot of default configuration,but I can't find the configuration file(I
>> want to change it for some reasons).So I would appreciate it if you tell
>> me where I can find the file or what's the file name.
>
> The default variables and rules are compiled into the make binary, so
> there is no file that you can edit to change them in the installed
> package.
>
> Changing the default rules locally would almost certainly be a Bad
> Idea.  If you don't want the default rules, invoke make with the -R
> option.  If you just want to alter them, then you should override them
> in your Makefile(s). If you change the GNU make package that's
> installed, then you've created an unexpected dependency on local
> modification, and the make installed on the system can no longer be
> simply upgraded with the OS as time passes.
>
To override GNU Make defaults (with additional configs) I use such code in
each of my top-level Makefile"s:

  SHELL = /bin/sh -eu

  # Disable built in pattern rules.
  MAKEFLAGS += -r
  # Disable built in variables.
  MAKEFLAGS += -R
  # Disable built in suffix rules.
  .SUFFIXES:
  # Delete target file if command fails.
  .DELETE_ON_ERROR:
  # Default target.
  .DEFAULT_GOAL = help

-- 
Best regards!


_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to