diff mbox series

[1/7] Makefile: mark 'check-builtins' as a .PHONY target

Message ID c889973be754336005d0155ce670f16e322df9c3.1615856156.git.liu.denton@gmail.com (mailing list archive)
State New, archived
Headers show
Series Sort lists and add static-analysis | expand

Commit Message

Denton Liu March 16, 2021, 12:56 a.m. UTC
Then convention in Git's Makefile is to mark targets which do not
actually generate any precious files (such as static checking targets).
.PHONY enables the target to still run, even if a file is erroneously
created with the same name as the target.

Mark 'check-builtins' as a .PHONY target.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
---
 Makefile | 1 +
 1 file changed, 1 insertion(+)

Comments

Eric Sunshine March 16, 2021, 4:59 a.m. UTC | #1
On Mon, Mar 15, 2021 at 8:57 PM Denton Liu <liu.denton@gmail.com> wrote:
> Then convention in Git's Makefile is to mark targets which do not

s/Then/The/

> actually generate any precious files (such as static checking targets).
> .PHONY enables the target to still run, even if a file is erroneously
> created with the same name as the target.
>
> Mark 'check-builtins' as a .PHONY target.
>
> Signed-off-by: Denton Liu <liu.denton@gmail.com>
Junio C Hamano March 17, 2021, 5:47 p.m. UTC | #2
Denton Liu <liu.denton@gmail.com> writes:

> Then convention in Git's Makefile is to mark targets which do not
> actually generate any precious files (such as static checking targets).

s/Then/The/ has been pointed out, but I am not sure what "precious"
means here.  I do not think you are referring to the distinction
between ordinary targets and .PRECIOUS targets here, but the use of
the word makes readers wonder if some interaction with the .PRECIOUS
marking was taken into consideration.

> .PHONY enables the target to still run, even if a file is erroneously
> created with the same name as the target.

True.  Another convention is to "build" such a target with
double-colon rule.  The existing code already follows the
convention, so there is nothing the patch text needs to do, but if
we explain the change in the log message to make the code follow
conventions, we probably should mention it as well for completeness.


Thanks.

> Mark 'check-builtins' as a .PHONY target.
>
> Signed-off-by: Denton Liu <liu.denton@gmail.com>
> ---
>  Makefile | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/Makefile b/Makefile
> index dfb0f1000f..6dbecdb606 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -3236,6 +3236,7 @@ check-docs::
>  
>  ### Make sure built-ins do not have dups and listed in git.c
>  #
> +.PHONY: check-builtins
>  check-builtins::
>  	./check-builtins.sh
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index dfb0f1000f..6dbecdb606 100644
--- a/Makefile
+++ b/Makefile
@@ -3236,6 +3236,7 @@  check-docs::
 
 ### Make sure built-ins do not have dups and listed in git.c
 #
+.PHONY: check-builtins
 check-builtins::
 	./check-builtins.sh