diff mbox series

[v3,05/23] Makefile: remove "mv $@ $@+" dance redundant to .DELETE_ON_ERROR

Message ID patch-v3-05.23-e38c90ad0b6-20211116T114334Z-avarab@gmail.com (mailing list archive)
State Superseded
Headers show
Series Makefile: dependency fixes, make noop runtime ~1.4x faster | expand

Commit Message

Ævar Arnfjörð Bjarmason Nov. 16, 2021, noon UTC
Since 7b76d6bf221 (Makefile: add and use the ".DELETE_ON_ERROR" flag,
2021-06-29) we don't need to guard the clobbering of $@ with this sort
of "mv $@+ $@" pattern in these cases where we're merely generating a
file that'll be used as a dependency for other files, as in this case
for GIT-PERL-HEADER.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Mike Hommey Nov. 17, 2021, 2:01 a.m. UTC | #1
On Tue, Nov 16, 2021 at 01:00:05PM +0100, Ævar Arnfjörð Bjarmason wrote:
> Since 7b76d6bf221 (Makefile: add and use the ".DELETE_ON_ERROR" flag,
> 2021-06-29) we don't need to guard the clobbering of $@ with this sort
> of "mv $@+ $@" pattern in these cases where we're merely generating a
> file that'll be used as a dependency for other files, as in this case
> for GIT-PERL-HEADER.

.DELETE_ON_ERROR is, as far as I know, a GNUism. Does building git require
the use of GNU make?

Mike
Ævar Arnfjörð Bjarmason Nov. 17, 2021, 9:20 a.m. UTC | #2
On Wed, Nov 17 2021, Mike Hommey wrote:

> On Tue, Nov 16, 2021 at 01:00:05PM +0100, Ævar Arnfjörð Bjarmason wrote:
>> Since 7b76d6bf221 (Makefile: add and use the ".DELETE_ON_ERROR" flag,
>> 2021-06-29) we don't need to guard the clobbering of $@ with this sort
>> of "mv $@+ $@" pattern in these cases where we're merely generating a
>> file that'll be used as a dependency for other files, as in this case
>> for GIT-PERL-HEADER.
>
> .DELETE_ON_ERROR is, as far as I know, a GNUism. Does building git require
> the use of GNU make?

Yes, we've had a hard dependency on GNU make for forever, and already
use .DELETE_ON_ERROR, this is just moving it around.
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index a71fba15e30..284725099c9 100644
--- a/Makefile
+++ b/Makefile
@@ -2349,8 +2349,7 @@  GIT-PERL-HEADER: $(PERL_HEADER_TEMPLATE) GIT-PERL-DEFINES Makefile
 	    -e 's=@@PERLLIBDIR_REL@@=$(perllibdir_relative_SQ)=g' \
 	    -e 's=@@GITEXECDIR_REL@@=$(gitexecdir_relative_SQ)=g' \
 	    -e 's=@@LOCALEDIR_REL@@=$(localedir_relative_SQ)=g' \
-	    $< >$@+ && \
-	mv $@+ $@
+	    $< >$@
 
 .PHONY: perllibdir
 perllibdir: