Re: [PATCH v3 2/9] Makefiles: add "shared.mak", move ".DELETE_ON_ERROR" to it

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

 



On Fri, Feb 25 2022, Junio C Hamano wrote:

> Ævar Arnfjörð Bjarmason  <avarab@xxxxxxxxx> writes:
>
>> diff --git a/Makefile b/Makefile
>> index 6f0b4b775fe..d378ec22545 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -1,3 +1,6 @@
>> +# Import tree-wide shared Makefile behavior and libraries
>> +include shared.mak
>> +
>>  # The default target of this Makefile is...
>>  all::
>
> Continuing with the theme of [1/9], this change to Makefile gets my
> firm NAK.  The first two lines MUST stay to be the first lines.
>
> Otherwise, a mistaken patch that adds rules to shared.make will
> make the first of these rules, not "all", as the default target.
>
> Just move it below to the third line or so and you'd be OK.

Understood, I can/will do that.

But wouldn't working this into this series be an even better option?

The ".DEFAULT_GOAL" variable is new in, 3.81 (01 Apr 2006), which I
think is old enough to hard depend on. We use $(or ...) added in the
same release in config.mak.dev.

We definitely have a hard dependency on "Version 3.80 (03 Oct 2002)"
$(eval ...) etc.

I checked and RHEL5 (which is otherwise the oldest OS we've supported)
has it, but RHEL4 doesn't (it has 3.80). So I think it's safe to have a
hard dependency on it and other things in 3.81 at this point.

diff --git a/Makefile b/Makefile
index 549ca6e7a5c..03321af7e3e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,6 @@
 # Import tree-wide shared Makefile behavior and libraries
 include shared.mak
 
-# The default target of this Makefile is...
-all::
-
 # Define V=1 to have a more verbose compile.
 #
 # Define SHELL_PATH to a POSIX shell if your /bin/sh is broken.
diff --git a/shared.mak b/shared.mak
index 7ba04049c8a..1034dc758f1 100644
--- a/shared.mak
+++ b/shared.mak
@@ -1,3 +1,8 @@
+### By setting the default goal to "all" we override any implicit
+### setting once "make" sees our first target, which it'll ignore if
+### .DEFAULT_GOAL was explicitly set.
+.DEFAULT_GOAL = all
+
 ### Remove GNU make implicit rules
 
 ## This speeds things up since we don't need to look for and stat() a




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux