# [PATCH] Makefile: remove the 'hdr-check' target

2 messages from 2019-03-03 to 2019-03-04. Participants: Ramsay Jones, Johannes Schindelin.
Thread: https://gitlist.dev/t/50635

## Ramsay Jones, 2019-03-03 22:23

Subject: [PATCH] Makefile: remove the 'hdr-check' target
Message-ID: <c1b1c37c-5476-4dc1-9e9b-b0c7363c5ae4@ramsayjones.plus.com>
URL: https://gitlist.dev/e/c1b1c37c-5476-4dc1-9e9b-b0c7363c5ae4%40ramsayjones.plus.com

```

The 'hdr-check' target has proved to be costly for some developers and
platforms, depending on the configuration, even when not using this
target. In part, this is due to the use of $(FIND) in the definition
of the $(LIB_H) variable. This effectively reverts commit ebb7baf02f
("Makefile: add a hdr-check target", 2018-09-19).

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---
 Makefile | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/Makefile b/Makefile
index c5240942f2..dd3e38dc1f 100644
--- a/Makefile
+++ b/Makefile
@@ -1852,7 +1852,6 @@ ifndef V
 	QUIET_MSGFMT   = @echo '   ' MSGFMT $@;
 	QUIET_GCOV     = @echo '   ' GCOV $@;
 	QUIET_SP       = @echo '   ' SP $<;
-	QUIET_HDR      = @echo '   ' HDR $<;
 	QUIET_RC       = @echo '   ' RC $@;
 	QUIET_SUBDIR0  = +@subdir=
 	QUIET_SUBDIR1  = ;$(NO_SUBDIR) echo '   ' SUBDIR $$subdir; \
@@ -2735,17 +2734,6 @@ $(SP_OBJ): %.sp: %.c GIT-CFLAGS FORCE
 .PHONY: sparse $(SP_OBJ)
 sparse: $(SP_OBJ)
 
-GEN_HDRS := command-list.h unicode-width.h
-EXCEPT_HDRS := $(GEN_HDRS) compat% xdiff%
-CHK_HDRS = $(filter-out $(EXCEPT_HDRS),$(patsubst ./%,%,$(LIB_H)))
-HCO = $(patsubst %.h,%.hco,$(CHK_HDRS))
-
-$(HCO): %.hco: %.h FORCE
-	$(QUIET_HDR)$(CC) -include git-compat-util.h -I. -o /dev/null -c -xc $<
-
-.PHONY: hdr-check $(HCO)
-hdr-check: $(HCO)
-
 .PHONY: style
 style:
 	git clang-format --style file --diff --extensions c,h
-- 
2.21.0

```

## Johannes Schindelin, 2019-03-04 14:59

Subject: Re: [PATCH] Makefile: remove the 'hdr-check' target
Message-ID: <nycvar.QRO.7.76.6.1903041558480.45@tvgsbejvaqbjf.bet>
URL: https://gitlist.dev/e/nycvar.QRO.7.76.6.1903041558480.45%40tvgsbejvaqbjf.bet
In-Reply-To: <c1b1c37c-5476-4dc1-9e9b-b0c7363c5ae4@ramsayjones.plus.com>

```
Hi Ramsay,

On Sun, 3 Mar 2019, Ramsay Jones wrote:

> The 'hdr-check' target has proved to be costly for some developers and
> platforms, depending on the configuration, even when not using this
> target. In part, this is due to the use of $(FIND) in the definition
> of the $(LIB_H) variable. This effectively reverts commit ebb7baf02f
> ("Makefile: add a hdr-check target", 2018-09-19).

As I said elsewhere, I think it would make sense to keep this target, and
to wire it up to our CI builds.

Ciao,
Dscho

> 
> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
> ---
>  Makefile | 12 ------------
>  1 file changed, 12 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index c5240942f2..dd3e38dc1f 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1852,7 +1852,6 @@ ifndef V
>  	QUIET_MSGFMT   = @echo '   ' MSGFMT $@;
>  	QUIET_GCOV     = @echo '   ' GCOV $@;
>  	QUIET_SP       = @echo '   ' SP $<;
> -	QUIET_HDR      = @echo '   ' HDR $<;
>  	QUIET_RC       = @echo '   ' RC $@;
>  	QUIET_SUBDIR0  = +@subdir=
>  	QUIET_SUBDIR1  = ;$(NO_SUBDIR) echo '   ' SUBDIR $$subdir; \
> @@ -2735,17 +2734,6 @@ $(SP_OBJ): %.sp: %.c GIT-CFLAGS FORCE
>  .PHONY: sparse $(SP_OBJ)
>  sparse: $(SP_OBJ)
>  
> -GEN_HDRS := command-list.h unicode-width.h
> -EXCEPT_HDRS := $(GEN_HDRS) compat% xdiff%
> -CHK_HDRS = $(filter-out $(EXCEPT_HDRS),$(patsubst ./%,%,$(LIB_H)))
> -HCO = $(patsubst %.h,%.hco,$(CHK_HDRS))
> -
> -$(HCO): %.hco: %.h FORCE
> -	$(QUIET_HDR)$(CC) -include git-compat-util.h -I. -o /dev/null -c -xc $<
> -
> -.PHONY: hdr-check $(HCO)
> -hdr-check: $(HCO)
> -
>  .PHONY: style
>  style:
>  	git clang-format --style file --diff --extensions c,h
> -- 
> 2.21.0
> 

```
