All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Emily Shaffer" <emilyshaffer@google.com>,
	"Jeff King" <peff@peff.net>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH 2/8] Makefile: stop hardcoding {command,config}-list.h
Date: Thu, 23 Sep 2021 12:29:57 +0200	[thread overview]
Message-ID: <patch-2.8-804795771c6-20210923T095326Z-avarab@gmail.com> (raw)
In-Reply-To: <cover-0.8-00000000000-20210923T095326Z-avarab@gmail.com>

Change various places that hardcode the names of these two files to
refer to either $(GENERATED_H), or to a new generated-hdrs
target. That target is consistent with the *-objs targets I recently
added in 029bac01a8 (Makefile: add {program,xdiff,test,git,fuzz}-objs
& objects targets, 2021-02-23).

A subsequent commit will add a new generated hook-list.h. By doing
this refactoring we'll only need to add the new file to the
GENERATED_H variable, not EXCEPT_HDRS, the vcbuild/README etc.

Hardcoding command-list.h there seems to have been a case of
copy/paste programming in 976aaedca0 (msvc: add a Makefile target to
pre-generate the Visual Studio solution, 2019-07-29). The
config-list.h was added later in 709df95b78 (help: move
list_config_help to builtin/help, 2020-04-16).

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 Makefile              | 6 ++++--
 compat/vcbuild/README | 2 +-
 config.mak.uname      | 6 +++---
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index e85a8e07d3e..eb5780264a4 100644
--- a/Makefile
+++ b/Makefile
@@ -817,6 +817,8 @@ XDIFF_LIB = xdiff/lib.a
 
 GENERATED_H += command-list.h
 GENERATED_H += config-list.h
+.PHONY: generated-hdrs
+generated-hdrs: $(GENERATED_H)
 
 LIB_H := $(sort $(patsubst ./%,%,$(shell git ls-files '*.h' ':!t/' ':!Documentation/' 2>/dev/null || \
 	$(FIND) . \
@@ -2910,7 +2912,7 @@ $(SP_OBJ): %.sp: %.c GIT-CFLAGS FORCE
 .PHONY: sparse $(SP_OBJ)
 sparse: $(SP_OBJ)
 
-EXCEPT_HDRS := command-list.h config-list.h unicode-width.h compat/% xdiff/%
+EXCEPT_HDRS := $(GENERATED_H) unicode-width.h compat/% xdiff/%
 ifndef GCRYPT_SHA256
 	EXCEPT_HDRS += sha256/gcrypt.h
 endif
@@ -2933,7 +2935,7 @@ style:
 	git clang-format --style file --diff --extensions c,h
 
 .PHONY: check
-check: config-list.h command-list.h
+check: $(GENERATED_H)
 	@if sparse; \
 	then \
 		echo >&2 "Use 'make sparse' instead"; \
diff --git a/compat/vcbuild/README b/compat/vcbuild/README
index 51fb083dbbe..29ec1d0f104 100644
--- a/compat/vcbuild/README
+++ b/compat/vcbuild/README
@@ -92,7 +92,7 @@ The Steps of Build Git with VS2008
    the git operations.
 
 3. Inside Git's directory run the command:
-       make command-list.h config-list.h
+       make generated-hdrs
    to generate the header file needed to compile git.
 
 4. Then either build Git with the GNU Make Makefile in the Git projects
diff --git a/config.mak.uname b/config.mak.uname
index 76516aaa9a5..8aac06eb094 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -735,9 +735,9 @@ vcxproj:
 	 echo '</Project>') >git-remote-http/LinkOrCopyRemoteHttp.targets
 	git add -f git/LinkOrCopyBuiltins.targets git-remote-http/LinkOrCopyRemoteHttp.targets
 
-	# Add command-list.h and config-list.h
-	$(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 config-list.h command-list.h
-	git add -f config-list.h command-list.h
+	# Add generated headers
+	$(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 $(GENERATED_H)
+	git add -f $(GENERATED_H)
 
 	# Add scripts
 	rm -f perl/perl.mak
-- 
2.33.0.1229.g0a86d28df49


  parent reply	other threads:[~2021-09-23 10:31 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-23 10:29 [PATCH 0/8] Makefile: generate a hook-list.h, prep for config-based-hooks Ævar Arnfjörð Bjarmason
2021-09-23 10:29 ` [PATCH 1/8] Makefile: mark "check" target as .PHONY Ævar Arnfjörð Bjarmason
2021-09-23 10:29 ` Ævar Arnfjörð Bjarmason [this message]
2021-09-23 10:29 ` [PATCH 3/8] Makefile: don't perform "mv $@+ $@" dance for $(GENERATED_H) Ævar Arnfjörð Bjarmason
2021-09-23 10:29 ` [PATCH 4/8] Makefile: remove an out-of-date comment Ævar Arnfjörð Bjarmason
2021-09-23 10:30 ` [PATCH 5/8] hook.[ch]: move find_hook() from run-command.c to hook.c Ævar Arnfjörð Bjarmason
2021-09-23 10:30 ` [PATCH 6/8] hook.c: add a hook_exists() wrapper and use it in bugreport.c Ævar Arnfjörð Bjarmason
2021-09-23 10:30 ` [PATCH 7/8] hook.c users: use "hook_exists()" instead of "find_hook()" Ævar Arnfjörð Bjarmason
2021-09-23 10:30 ` [PATCH 8/8] hook-list.h: add a generated list of hooks, like config-list.h Ævar Arnfjörð Bjarmason
2021-09-24 10:19   ` Phillip Wood
2021-09-24 15:51     ` Junio C Hamano
2021-09-24 16:39       ` René Scharfe
2021-09-24 19:30     ` Ævar Arnfjörð Bjarmason
2021-09-24 19:56       ` René Scharfe
2021-09-24 20:09         ` Ævar Arnfjörð Bjarmason
2021-09-27  9:24       ` Phillip Wood
2021-09-27 10:36         ` Ævar Arnfjörð Bjarmason
2021-11-15 22:04   ` Mike Hommey
2021-11-15 22:26     ` Ævar Arnfjörð Bjarmason
2021-11-15 22:40       ` Mike Hommey
2021-11-15 22:49         ` Ævar Arnfjörð Bjarmason
2021-11-15 23:00           ` Mike Hommey
2021-11-16 12:01             ` Ævar Arnfjörð Bjarmason
2021-11-17  8:39               ` Junio C Hamano
2021-09-26 19:03 ` [PATCH v2 0/8] Makefile: generate a hook-list.h, prep for config-based-hooks Ævar Arnfjörð Bjarmason
2021-09-26 19:03   ` [PATCH v2 1/8] Makefile: mark "check" target as .PHONY Ævar Arnfjörð Bjarmason
2021-09-26 19:03   ` [PATCH v2 2/8] Makefile: stop hardcoding {command,config}-list.h Ævar Arnfjörð Bjarmason
2021-09-26 19:03   ` [PATCH v2 3/8] Makefile: don't perform "mv $@+ $@" dance for $(GENERATED_H) Ævar Arnfjörð Bjarmason
2021-09-26 19:03   ` [PATCH v2 4/8] Makefile: remove an out-of-date comment Ævar Arnfjörð Bjarmason
2021-09-26 19:03   ` [PATCH v2 5/8] hook.[ch]: move find_hook() from run-command.c to hook.c Ævar Arnfjörð Bjarmason
2021-09-26 19:03   ` [PATCH v2 6/8] hook.c: add a hook_exists() wrapper and use it in bugreport.c Ævar Arnfjörð Bjarmason
2021-09-26 19:03   ` [PATCH v2 7/8] hook.c users: use "hook_exists()" instead of "find_hook()" Ævar Arnfjörð Bjarmason
2021-09-26 19:03   ` [PATCH v2 8/8] hook-list.h: add a generated list of hooks, like config-list.h Ævar Arnfjörð Bjarmason
2021-09-27 16:48     ` Junio C Hamano
2021-09-27 18:00       ` René Scharfe
2021-09-27 20:23         ` Junio C Hamano
2021-09-27  9:30   ` [PATCH v2 0/8] Makefile: generate a hook-list.h, prep for config-based-hooks Phillip Wood
2021-09-27 10:38     ` Ævar Arnfjörð Bjarmason
2021-09-27 18:01       ` Phillip Wood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=patch-2.8-804795771c6-20210923T095326Z-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=emilyshaffer@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.