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

Re: [PATCH 1/1] Makefile: use `git ls-files` to list header files, if possible

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 4, 2019, 11:08 UTC
Message-ID
<nycvar.QRO.7.76.6.1903041206300.45@tvgsbejvaqbjf.bet>
In-Reply-To
<20190303171951.GD23811@sigill.intra.peff.net>
Hi Peff,
On Sun, 3 Mar 2019, Jeff King wrote:
> By the way, "make hdr-check" already fails for me on master, as I do not
> have libgcrypt installed, and it unconditionally checks sha256/gcrypt.h.

Oh? I thought it'd fail only on Windows, so I have not submitted https://github.com/dscho/git/commit/fix-hdr-check yet:

-- snipsnap --
From c13d9985284d4b452db0d95b6949e02c533db634 Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Sat, 23 Feb 2019 20:38:40 +0100
Subject: [PATCH] hdr-check: make it work on Windows

On Windows, we define a specific set of pre-processor macros, among other reasons: to avoid including syslog.h (which is not available on Windows).

The hdr-check target did not use those definitions, resulting in a failure to include said syslog.h.

To fix that, let's let the hdr-check target make use of ALL_CFLAGS, which does include the pre-processor macros that would e.g. skip the conditional block including syslog.h.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index c5240942f2..b9f00f0ea0 100644
--- a/Makefile
+++ b/Makefile
@@ -2741,7 +2741,7 @@ 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 $<
+	$(QUIET_HDR)$(CC) $(ALL_CFLAGS) -include git-compat-util.h -I. -o /dev/null -c -xc $<
 
 .PHONY: hdr-check $(HCO)
 hdr-check: $(HCO)
-- 
2.20.1.windows.1.1576.g37ac248661.dirty
Previous: Jeff KingNext: Jeff King
Message 16 of 31 in “Avoid calling find in the Makefile, if possible”
  1. 0/1 Avoid calling find in the Makefile, if possibleJohannes Schindelin via GitGitGadget, Mar 1, 2019
  2. 1/1 Makefile: use `git ls-files` to list header files, if possibleJohannes Schindelin via GitGitGadget, Mar 1, 2019
  3. Jeff KingMar 1, 2019
  4. Jeff KingMar 1, 2019
  5. Jeff KingMar 1, 2019
  6. Johannes SchindelinMar 2, 2019
  7. Jeff KingMar 3, 2019
  8. Johannes SchindelinMar 2, 2019
  9. Jeff KingMar 3, 2019
  10. Johannes SchindelinMar 2, 2019
  11. Jeff KingMar 3, 2019
  12. Ramsay JonesMar 3, 2019
  13. Johannes SchindelinMar 4, 2019
  14. Ramsay JonesMar 4, 2019
  15. Jeff KingMar 4, 2019
  16. Johannes SchindelinMar 4, 2019
  17. Jeff KingMar 4, 2019
  18. Junio C HamanoMar 5, 2019
  19. Johannes SchindelinMar 5, 2019
  20. Junio C HamanoMar 5, 2019
  21. Jeff KingMar 5, 2019
  22. Ramsay JonesMar 6, 2019
  23. Jeff KingMar 6, 2019
  24. Junio C HamanoMar 6, 2019
  25. compat/bswap: add include header guardsJeff King, Mar 6, 2019
  26. Junio C HamanoMar 6, 2019
  27. 0/1 Avoid calling find in the Makefile, if possibleJohannes Schindelin via GitGitGadget, Mar 4, 2019
  28. 1/1 Makefile: use `git ls-files` to list header files, if possibleJohannes Schindelin via GitGitGadget, Mar 4, 2019
  29. Ramsay JonesMar 4, 2019
  30. Ramsay JonesMar 4, 2019
  31. Jeff KingMar 4, 2019

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.