help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to tell make to not try to remake source files?


From: Paul Smith
Subject: Re: How to tell make to not try to remake source files?
Date: Sat, 27 Jan 2024 14:22:13 -0500
User-agent: Evolution 3.50.3 (by Flathub.org)

On Sat, 2024-01-27 at 20:00 +0100, Antonio Diaz Diaz wrote:
> In order to increase the efficiency of the build, I added empty
> recipes to my makefiles to prevent 'make' from trying to remake
> source files:

A simpler and more effective way to increase efficiency and reduce the
output of -d is to remove all the built-in rules.  Instead of defining
new pattern rules for these targets, remove existing pattern rules that
match them.  Make won't try to "build source files" if there's no
pattern rule it can use to do so.

If you have GNU Make 4.0 or higher, you can simply add:

    MAKEFLAGS += -r

to your makefile and it will remove all the built-in pattern rules.

If you want to continue to use older versions of GNU Make, you can get
mostly-equivalent behavior by adding this to your makefile:

    .SUFFIXES:
    %:: %,v
    %:: RCS/%,v
    %:: s.%
    %:: SCCS/s.%

-- 
Paul D. Smith <psmith@gnu.org>            Find some GNU make tips at:
https://www.gnu.org                       http://make.mad-scientist.net
"Please remain calm...I may be mad, but I am a professional." --Mad
Scientist



reply via email to

[Prev in Thread] Current Thread [Next in Thread]