git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Feb 25, 2022, 23:05 UTC
Message-ID
<220226.861qzq7d2r.gmgdl@evledraar.gmail.com>
In-Reply-To
<xmqqwnhi8swx.fsf@gitster.g>
On Fri, Feb 25 2022, Junio C Hamano wrote:
Show 20 quoted lines
> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> 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
Previous: Junio C HamanoNext: Junio C Hamano
Message 18 of 67 in “Makefile: optimize noop runs, add shared.mak”
  1. 0/8 Makefile: optimize noop runs, add shared.makÆvar Arnfjörð Bjarmason, Dec 24, 2021
  2. 1/8 Makefiles: add "shared.mak", move ".DELETE_ON_ERROR" to itÆvar Arnfjörð Bjarmason, Dec 24, 2021
  3. 2/8 Makefile: disable GNU make built-in wildcard rulesÆvar Arnfjörð Bjarmason, Dec 24, 2021
  4. 3/8 Makefile: define $(LIB_H) in terms of $(FIND_SOURCE_FILES)Ævar Arnfjörð Bjarmason, Dec 24, 2021
  5. 4/8 Makefile: move ".SUFFIXES" rule to shared.makÆvar Arnfjörð Bjarmason, Dec 24, 2021
  6. Taylor BlauFeb 22, 2022
  7. Ævar Arnfjörð BjarmasonFeb 22, 2022
  8. 6/8 Makefile: add "$(QUIET)" boilerplate to shared.makÆvar Arnfjörð Bjarmason, Dec 24, 2021
  9. 5/8 Makefile: move $(comma), $(empty) and $(space) to shared.makÆvar Arnfjörð Bjarmason, Dec 24, 2021
  10. 7/8 Makefile: use $(wspfx) for $(QUIET...) in shared.makÆvar Arnfjörð Bjarmason, Dec 24, 2021
  11. 8/8 Makefiles: add and use wildcard "mkdir -p" templateÆvar Arnfjörð Bjarmason, Dec 24, 2021
  12. Ævar Arnfjörð BjarmasonFeb 21, 2022
  13. 0/9 Makefile: optimize noop runs, add shared.makÆvar Arnfjörð Bjarmason, Feb 25, 2022
  14. 1/9 scalar Makefile: set the default target after the includesÆvar Arnfjörð Bjarmason, Feb 25, 2022
  15. Junio C HamanoFeb 25, 2022
  16. 2/9 Makefiles: add "shared.mak", move ".DELETE_ON_ERROR" to itÆvar Arnfjörð Bjarmason, Feb 25, 2022
  17. Junio C HamanoFeb 25, 2022
  18. Ævar Arnfjörð BjarmasonFeb 25, 2022
  19. Junio C HamanoFeb 25, 2022
  20. Phillip WoodFeb 28, 2022
  21. Ævar Arnfjörð BjarmasonFeb 28, 2022
  22. Phillip WoodFeb 28, 2022
  23. Ævar Arnfjörð BjarmasonFeb 28, 2022
  24. 3/9 Makefile: disable GNU make built-in wildcard rulesÆvar Arnfjörð Bjarmason, Feb 25, 2022
  25. Junio C HamanoFeb 25, 2022
  26. 5/9 Makefile: move ".SUFFIXES" rule to shared.makÆvar Arnfjörð Bjarmason, Feb 25, 2022
  27. Junio C HamanoFeb 25, 2022
  28. 7/9 Makefile: add "$(QUIET)" boilerplate to shared.makÆvar Arnfjörð Bjarmason, Feb 25, 2022
  29. Junio C HamanoFeb 25, 2022
  30. 6/9 Makefile: move $(comma), $(empty) and $(space) to shared.makÆvar Arnfjörð Bjarmason, Feb 25, 2022
  31. Junio C HamanoFeb 25, 2022
  32. 4/9 Makefile: define $(LIB_H) in terms of $(FIND_SOURCE_FILES)Ævar Arnfjörð Bjarmason, Feb 25, 2022
  33. 8/9 Makefile: use $(wspfx) for $(QUIET...) in shared.makÆvar Arnfjörð Bjarmason, Feb 25, 2022
  34. Junio C HamanoFeb 25, 2022
  35. 9/9 Makefiles: add and use wildcard "mkdir -p" templateÆvar Arnfjörð Bjarmason, Feb 25, 2022
  36. 0/9 Makefile: optimize noop runs, add shared.makÆvar Arnfjörð Bjarmason, Mar 2, 2022
  37. 1/9 scalar Makefile: use "The default target of..." patternÆvar Arnfjörð Bjarmason, Mar 2, 2022
  38. Junio C HamanoMar 2, 2022
  39. 2/9 Makefiles: add "shared.mak", move ".DELETE_ON_ERROR" to itÆvar Arnfjörð Bjarmason, Mar 2, 2022
  40. 3/9 Makefile: disable GNU make built-in wildcard rulesÆvar Arnfjörð Bjarmason, Mar 2, 2022
  41. 4/9 Makefile: define $(LIB_H) in terms of $(FIND_SOURCE_FILES)Ævar Arnfjörð Bjarmason, Mar 2, 2022
  42. 5/9 Makefile: move ".SUFFIXES" rule to shared.makÆvar Arnfjörð Bjarmason, Mar 2, 2022
  43. 7/9 Makefile: add "$(QUIET)" boilerplate to shared.makÆvar Arnfjörð Bjarmason, Mar 2, 2022
  44. 6/9 Makefile: move $(comma), $(empty) and $(space) to shared.makÆvar Arnfjörð Bjarmason, Mar 2, 2022
  45. 8/9 Makefile: use $(wspfx) for $(QUIET...) in shared.makÆvar Arnfjörð Bjarmason, Mar 2, 2022
  46. Junio C HamanoMar 2, 2022
  47. 9/9 Makefiles: add and use wildcard "mkdir -p" templateÆvar Arnfjörð Bjarmason, Mar 2, 2022
  48. Junio C HamanoMar 2, 2022
  49. Junio C HamanoMar 2, 2022
  50. Phillip WoodMar 3, 2022
  51. 0/8 Makefile: optimize noop runs, add shared.makÆvar Arnfjörð Bjarmason, Mar 3, 2022
  52. 1/8 scalar Makefile: use "The default target of..." patternÆvar Arnfjörð Bjarmason, Mar 3, 2022
  53. 2/8 Makefiles: add "shared.mak", move ".DELETE_ON_ERROR" to itÆvar Arnfjörð Bjarmason, Mar 3, 2022
  54. 3/8 Makefile: disable GNU make built-in wildcard rulesÆvar Arnfjörð Bjarmason, Mar 3, 2022
  55. Rene KitaApr 11, 2022
  56. Ævar Arnfjörð BjarmasonApr 11, 2022
  57. 4/8 Makefile: define $(LIB_H) in terms of $(FIND_SOURCE_FILES)Ævar Arnfjörð Bjarmason, Mar 3, 2022
  58. 5/8 Makefile: move ".SUFFIXES" rule to shared.makÆvar Arnfjörð Bjarmason, Mar 3, 2022
  59. Adam DinwoodieApr 5, 2022
  60. Ævar Arnfjörð BjarmasonApr 5, 2022
  61. Documentation/Makefile: fix "make info" regression in dad9cd7d518Ævar Arnfjörð Bjarmason, Apr 5, 2022
  62. Adam DinwoodieApr 6, 2022
  63. Junio C HamanoApr 6, 2022
  64. Taylor BlauApr 6, 2022
  65. 7/8 Makefile: add "$(QUIET)" boilerplate to shared.makÆvar Arnfjörð Bjarmason, Mar 3, 2022
  66. 6/8 Makefile: move $(comma), $(empty) and $(space) to shared.makÆvar Arnfjörð Bjarmason, Mar 3, 2022
  67. 8/8 Makefiles: add and use wildcard "mkdir -p" templateÆvar Arnfjörð Bjarmason, Mar 3, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.