Git fork

Makefile: stop hardcoding {command,config}-list.h

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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Ævar Arnfjörð Bjarmason and committed by
Junio C Hamano
7c3c0a99 ea47e59f

+8 -6
+4 -2
Makefile
··· 817 818 GENERATED_H += command-list.h 819 GENERATED_H += config-list.h 820 821 LIB_H := $(sort $(patsubst ./%,%,$(shell git ls-files '*.h' ':!t/' ':!Documentation/' 2>/dev/null || \ 822 $(FIND) . \ ··· 2903 .PHONY: sparse $(SP_OBJ) 2904 sparse: $(SP_OBJ) 2905 2906 - EXCEPT_HDRS := command-list.h config-list.h unicode-width.h compat/% xdiff/% 2907 ifndef GCRYPT_SHA256 2908 EXCEPT_HDRS += sha256/gcrypt.h 2909 endif ··· 2926 git clang-format --style file --diff --extensions c,h 2927 2928 .PHONY: check 2929 - check: config-list.h command-list.h 2930 @if sparse; \ 2931 then \ 2932 echo >&2 "Use 'make sparse' instead"; \
··· 817 818 GENERATED_H += command-list.h 819 GENERATED_H += config-list.h 820 + .PHONY: generated-hdrs 821 + generated-hdrs: $(GENERATED_H) 822 823 LIB_H := $(sort $(patsubst ./%,%,$(shell git ls-files '*.h' ':!t/' ':!Documentation/' 2>/dev/null || \ 824 $(FIND) . \ ··· 2905 .PHONY: sparse $(SP_OBJ) 2906 sparse: $(SP_OBJ) 2907 2908 + EXCEPT_HDRS := $(GENERATED_H) unicode-width.h compat/% xdiff/% 2909 ifndef GCRYPT_SHA256 2910 EXCEPT_HDRS += sha256/gcrypt.h 2911 endif ··· 2928 git clang-format --style file --diff --extensions c,h 2929 2930 .PHONY: check 2931 + check: $(GENERATED_H) 2932 @if sparse; \ 2933 then \ 2934 echo >&2 "Use 'make sparse' instead"; \
+1 -1
compat/vcbuild/README
··· 92 the git operations. 93 94 3. Inside Git's directory run the command: 95 - make command-list.h config-list.h 96 to generate the header file needed to compile git. 97 98 4. Then either build Git with the GNU Make Makefile in the Git projects
··· 92 the git operations. 93 94 3. Inside Git's directory run the command: 95 + make generated-hdrs 96 to generate the header file needed to compile git. 97 98 4. Then either build Git with the GNU Make Makefile in the Git projects
+3 -3
config.mak.uname
··· 735 echo '</Project>') >git-remote-http/LinkOrCopyRemoteHttp.targets 736 git add -f git/LinkOrCopyBuiltins.targets git-remote-http/LinkOrCopyRemoteHttp.targets 737 738 - # Add command-list.h and config-list.h 739 - $(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 config-list.h command-list.h 740 - git add -f config-list.h command-list.h 741 742 # Add scripts 743 rm -f perl/perl.mak
··· 735 echo '</Project>') >git-remote-http/LinkOrCopyRemoteHttp.targets 736 git add -f git/LinkOrCopyBuiltins.targets git-remote-http/LinkOrCopyRemoteHttp.targets 737 738 + # Add generated headers 739 + $(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 $(GENERATED_H) 740 + git add -f $(GENERATED_H) 741 742 # Add scripts 743 rm -f perl/perl.mak