builds: move build scripts into "tools/"

We have a bunch of scripts used by our different build systems that are
all located in the top-level directory. Now that we have introduced the
new "tools/" directory though we have a better home for them.

Move the scripts into the "tools/" directory.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2026-03-10 18:52:38 +01:00
committed by Junio C Hamano
parent 97e8478980
commit f6897d7e72
13 changed files with 35 additions and 35 deletions

View File

@@ -2689,21 +2689,21 @@ $(BUILT_INS): git$X
ln -s $< $@ 2>/dev/null || \
cp $< $@
config-list.h: generate-configlist.sh
config-list.h: tools/generate-configlist.sh
@mkdir -p .depend
$(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@ .depend/config-list.h.d
$(QUIET_GEN)$(SHELL_PATH) ./tools/generate-configlist.sh . $@ .depend/config-list.h.d
-include .depend/config-list.h.d
command-list.h: generate-cmdlist.sh command-list.txt
command-list.h: tools/generate-cmdlist.sh command-list.txt
command-list.h: $(wildcard Documentation/git*.adoc)
$(QUIET_GEN)$(SHELL_PATH) ./generate-cmdlist.sh \
$(QUIET_GEN)$(SHELL_PATH) ./tools/generate-cmdlist.sh \
$(patsubst %,--exclude-program %,$(EXCLUDED_PROGRAMS)) \
. $@
hook-list.h: generate-hooklist.sh Documentation/githooks.adoc
$(QUIET_GEN)$(SHELL_PATH) ./generate-hooklist.sh . $@
hook-list.h: tools/generate-hooklist.sh Documentation/githooks.adoc
$(QUIET_GEN)$(SHELL_PATH) ./tools/generate-hooklist.sh . $@
SCRIPT_DEFINES = $(SHELL_PATH_SQ):$(DIFF_SQ):\
$(localedir_SQ):$(USE_GETTEXT_SCHEME):$(SANE_TOOL_PATH_SQ):\
@@ -2716,8 +2716,8 @@ GIT-SCRIPT-DEFINES: FORCE
echo "$$FLAGS" >$@; \
fi
$(SCRIPT_SH_GEN) $(SCRIPT_LIB) : % : %.sh generate-script.sh GIT-BUILD-OPTIONS GIT-SCRIPT-DEFINES
$(QUIET_GEN)./generate-script.sh "$<" "$@+" ./GIT-BUILD-OPTIONS && \
$(SCRIPT_SH_GEN) $(SCRIPT_LIB) : % : %.sh tools/generate-script.sh GIT-BUILD-OPTIONS GIT-SCRIPT-DEFINES
$(QUIET_GEN)./tools/generate-script.sh "$<" "$@+" ./GIT-BUILD-OPTIONS && \
mv $@+ $@
git.rc: git.rc.in GIT-VERSION-GEN GIT-VERSION-FILE
@@ -2757,8 +2757,8 @@ endif
PERL_DEFINES += $(gitexecdir) $(perllibdir) $(localedir)
$(SCRIPT_PERL_GEN): % : %.perl generate-perl.sh GIT-PERL-DEFINES GIT-PERL-HEADER GIT-VERSION-FILE
$(QUIET_GEN)$(SHELL_PATH) generate-perl.sh ./GIT-BUILD-OPTIONS ./GIT-VERSION-FILE GIT-PERL-HEADER "$<" "$@+" && \
$(SCRIPT_PERL_GEN): % : %.perl tools/generate-perl.sh GIT-PERL-DEFINES GIT-PERL-HEADER GIT-VERSION-FILE
$(QUIET_GEN)$(SHELL_PATH) tools/generate-perl.sh ./GIT-BUILD-OPTIONS ./GIT-VERSION-FILE GIT-PERL-HEADER "$<" "$@+" && \
mv $@+ $@
PERL_DEFINES := $(subst $(space),:,$(PERL_DEFINES))
@@ -2786,8 +2786,8 @@ GIT-PERL-HEADER: $(PERL_HEADER_TEMPLATE) GIT-PERL-DEFINES Makefile
perllibdir:
@echo '$(perllibdir_SQ)'
git-instaweb: git-instaweb.sh generate-script.sh GIT-BUILD-OPTIONS GIT-SCRIPT-DEFINES
$(QUIET_GEN)./generate-script.sh "$<" "$@+" ./GIT-BUILD-OPTIONS && \
git-instaweb: git-instaweb.sh tools/generate-script.sh GIT-BUILD-OPTIONS GIT-SCRIPT-DEFINES
$(QUIET_GEN)./tools/generate-script.sh "$<" "$@+" ./GIT-BUILD-OPTIONS && \
chmod +x $@+ && \
mv $@+ $@
else # NO_PERL
@@ -2804,9 +2804,9 @@ endif # NO_PERL
$(SCRIPT_PYTHON_GEN): GIT-BUILD-OPTIONS
ifndef NO_PYTHON
$(SCRIPT_PYTHON_GEN): generate-python.sh
$(SCRIPT_PYTHON_GEN): tools/generate-python.sh
$(SCRIPT_PYTHON_GEN): % : %.py
$(QUIET_GEN)$(SHELL_PATH) generate-python.sh ./GIT-BUILD-OPTIONS "$<" "$@"
$(QUIET_GEN)$(SHELL_PATH) tools/generate-python.sh ./GIT-BUILD-OPTIONS "$<" "$@"
else # NO_PYTHON
$(SCRIPT_PYTHON_GEN): % : unimplemented.sh
$(QUIET_GEN) \
@@ -3226,9 +3226,9 @@ endif
NO_PERL_CPAN_FALLBACKS_SQ = $(subst ','\'',$(NO_PERL_CPAN_FALLBACKS))
endif
perl/build/lib/%.pm: perl/%.pm generate-perl.sh GIT-BUILD-OPTIONS GIT-VERSION-FILE GIT-PERL-DEFINES
perl/build/lib/%.pm: perl/%.pm tools/generate-perl.sh GIT-BUILD-OPTIONS GIT-VERSION-FILE GIT-PERL-DEFINES
$(call mkdir_p_parent_template)
$(QUIET_GEN)$(SHELL_PATH) generate-perl.sh ./GIT-BUILD-OPTIONS ./GIT-VERSION-FILE GIT-PERL-HEADER "$<" "$@"
$(QUIET_GEN)$(SHELL_PATH) tools/generate-perl.sh ./GIT-BUILD-OPTIONS ./GIT-VERSION-FILE GIT-PERL-HEADER "$<" "$@"
perl/build/man/man3/Git.3pm: perl/Git.pm
$(call mkdir_p_parent_template)
@@ -3936,7 +3936,7 @@ check-docs::
### Make sure built-ins do not have dups and listed in git.c
#
check-builtins::
./check-builtins.sh
./tools/check-builtins.sh
### Test suite coverage testing
#

View File

@@ -1,5 +1,5 @@
ifndef COMPILER_FEATURES
COMPILER_FEATURES := $(shell ./detect-compiler $(CC))
COMPILER_FEATURES := $(shell ./tools/detect-compiler $(CC))
endif
ifeq ($(filter no-error,$(DEVOPTS)),)

View File

@@ -636,7 +636,7 @@ set(EXCLUSION_PROGS_CACHE ${EXCLUSION_PROGS} CACHE STRING "Programs not built" F
if(NOT EXISTS ${CMAKE_BINARY_DIR}/command-list.h OR NOT EXCLUSION_PROGS_CACHE STREQUAL EXCLUSION_PROGS)
list(REMOVE_ITEM EXCLUSION_PROGS empty)
message("Generating command-list.h")
execute_process(COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/generate-cmdlist.sh"
execute_process(COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/tools/generate-cmdlist.sh"
${EXCLUSION_PROGS}
"${CMAKE_SOURCE_DIR}"
"${CMAKE_BINARY_DIR}/command-list.h")
@@ -644,14 +644,14 @@ endif()
if(NOT EXISTS ${CMAKE_BINARY_DIR}/config-list.h)
message("Generating config-list.h")
execute_process(COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/generate-configlist.sh"
execute_process(COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/tools/generate-configlist.sh"
"${CMAKE_SOURCE_DIR}"
"${CMAKE_BINARY_DIR}/config-list.h")
endif()
if(NOT EXISTS ${CMAKE_BINARY_DIR}/hook-list.h)
message("Generating hook-list.h")
execute_process(COMMAND "${SH_EXE}" ${CMAKE_SOURCE_DIR}/generate-hooklist.sh
execute_process(COMMAND "${SH_EXE}" ${CMAKE_SOURCE_DIR}/tools/generate-hooklist.sh
"${CMAKE_SOURCE_DIR}"
"${CMAKE_BINARY_DIR}/hook-list.h")
endif()
@@ -832,11 +832,11 @@ foreach(script ${git_shell_scripts})
endif()
add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/${shell_gen_path}"
COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/generate-script.sh"
COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/tools/generate-script.sh"
"${CMAKE_SOURCE_DIR}/${script}.sh"
"${CMAKE_BINARY_DIR}/${shell_gen_path}"
"${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS"
DEPENDS "${CMAKE_SOURCE_DIR}/generate-script.sh"
DEPENDS "${CMAKE_SOURCE_DIR}/tools/generate-script.sh"
"${CMAKE_SOURCE_DIR}/${script}.sh"
VERBATIM)
list(APPEND shell_gen ${CMAKE_BINARY_DIR}/${shell_gen_path})
@@ -875,13 +875,13 @@ foreach(script ${git_perl_scripts} ${perl_modules})
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/${perl_gen_dir}")
add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/${perl_gen_path}"
COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/generate-perl.sh"
COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/tools/generate-perl.sh"
"${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS"
"${CMAKE_BINARY_DIR}/GIT-VERSION-FILE"
"${CMAKE_BINARY_DIR}/GIT-PERL-HEADER"
"${CMAKE_SOURCE_DIR}/${script}"
"${CMAKE_BINARY_DIR}/${perl_gen_path}"
DEPENDS "${CMAKE_SOURCE_DIR}/generate-perl.sh"
DEPENDS "${CMAKE_SOURCE_DIR}/tools/generate-perl.sh"
"${CMAKE_SOURCE_DIR}/${script}"
"${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS"
"${CMAKE_BINARY_DIR}/GIT-VERSION-FILE"
@@ -892,11 +892,11 @@ add_custom_target(perl-gen ALL DEPENDS ${perl_gen})
# Python script
add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/git-p4"
COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/generate-python.sh"
COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/tools/generate-python.sh"
"${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS"
"${CMAKE_SOURCE_DIR}/git-p4.py"
"${CMAKE_BINARY_DIR}/git-p4"
DEPENDS "${CMAKE_SOURCE_DIR}/generate-python.sh"
DEPENDS "${CMAKE_SOURCE_DIR}/tools/generate-python.sh"
"${CMAKE_SOURCE_DIR}/git-p4.py"
"${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS"
VERBATIM)

View File

@@ -3,7 +3,7 @@ git_subtree = custom_target(
output: 'git-subtree',
command: [
shell,
meson.project_source_root() / 'generate-script.sh',
meson.project_source_root() / 'tools/generate-script.sh',
'@INPUT@',
'@OUTPUT@',
meson.project_build_root() / 'GIT-BUILD-OPTIONS',

View File

@@ -554,7 +554,7 @@ libgit_sources = [
libgit_sources += custom_target(
input: 'command-list.txt',
output: 'command-list.h',
command: [shell, meson.current_source_dir() + '/generate-cmdlist.sh', meson.current_source_dir(), '@OUTPUT@'],
command: [shell, meson.current_source_dir() + '/tools/generate-cmdlist.sh', meson.current_source_dir(), '@OUTPUT@'],
env: script_environment,
)
@@ -723,10 +723,10 @@ endif
builtin_sources += custom_target(
output: 'config-list.h',
depfile: 'config-list.h.d',
depend_files: [ 'generate-configlist.sh' ],
depend_files: [ 'tools/generate-configlist.sh' ],
command: [
shell,
meson.current_source_dir() / 'generate-configlist.sh',
meson.current_source_dir() / 'tools/generate-configlist.sh',
meson.current_source_dir(),
'@OUTPUT@',
'@DEPFILE@',
@@ -739,7 +739,7 @@ builtin_sources += custom_target(
output: 'hook-list.h',
command: [
shell,
meson.current_source_dir() + '/generate-hooklist.sh',
meson.current_source_dir() + '/tools/generate-hooklist.sh',
meson.current_source_dir(),
'@OUTPUT@',
],
@@ -1959,7 +1959,7 @@ foreach script : scripts_sh
output: fs.stem(script),
command: [
shell,
meson.project_source_root() / 'generate-script.sh',
meson.project_source_root() / 'tools/generate-script.sh',
'@INPUT@',
'@OUTPUT@',
meson.project_build_root() / 'GIT-BUILD-OPTIONS',
@@ -2008,7 +2008,7 @@ if perl_features_enabled
generate_perl_command = [
shell,
meson.project_source_root() / 'generate-perl.sh',
meson.project_source_root() / 'tools/generate-perl.sh',
meson.project_build_root() / 'GIT-BUILD-OPTIONS',
git_version_file.full_path(),
perl_header,
@@ -2057,7 +2057,7 @@ if target_python.found()
output: fs.stem(script),
command: [
shell,
meson.project_source_root() / 'generate-python.sh',
meson.project_source_root() / 'tools/generate-python.sh',
meson.project_build_root() / 'GIT-BUILD-OPTIONS',
'@INPUT@',
'@OUTPUT@',