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>

Patrick Steinhardt committed Mar 19, 2026 at 06:33 UTC a767f2fd6c5a6104ff32a35a27f0c15aec546957
13 files changed +35 -35
Makefile
+17 -17
@@ -2689,21 +2689,21 @@ $(BUILT_INS): git$X
2689 ln -s $< $@ 2>/dev/null || \
2690 cp $< $@
2691
2692 -config-list.h: generate-configlist.sh
2692 +config-list.h: tools/generate-configlist.sh
2693 @mkdir -p .depend
2694 - $(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@ .depend/config-list.h.d
2694 + $(QUIET_GEN)$(SHELL_PATH) ./tools/generate-configlist.sh . $@ .depend/config-list.h.d
2695
2696 -include .depend/config-list.h.d
2697
2698 -command-list.h: generate-cmdlist.sh command-list.txt
2698 +command-list.h: tools/generate-cmdlist.sh command-list.txt
2699
2700 command-list.h: $(wildcard Documentation/git*.adoc)
2701 - $(QUIET_GEN)$(SHELL_PATH) ./generate-cmdlist.sh \
2701 + $(QUIET_GEN)$(SHELL_PATH) ./tools/generate-cmdlist.sh \
2702 $(patsubst %,--exclude-program %,$(EXCLUDED_PROGRAMS)) \
2703 . $@
2704
2705 -hook-list.h: generate-hooklist.sh Documentation/githooks.adoc
2706 - $(QUIET_GEN)$(SHELL_PATH) ./generate-hooklist.sh . $@
2705 +hook-list.h: tools/generate-hooklist.sh Documentation/githooks.adoc
2706 + $(QUIET_GEN)$(SHELL_PATH) ./tools/generate-hooklist.sh . $@
2707
2708 SCRIPT_DEFINES = $(SHELL_PATH_SQ):$(DIFF_SQ):\
2709 $(localedir_SQ):$(USE_GETTEXT_SCHEME):$(SANE_TOOL_PATH_SQ):\
@@ -2716,8 +2716,8 @@ GIT-SCRIPT-DEFINES: FORCE
2716 echo "$$FLAGS" >$@; \
2717 fi
2718
2719 -$(SCRIPT_SH_GEN) $(SCRIPT_LIB) : % : %.sh generate-script.sh GIT-BUILD-OPTIONS GIT-SCRIPT-DEFINES
2720 - $(QUIET_GEN)./generate-script.sh "$<" "$@+" ./GIT-BUILD-OPTIONS && \
2719 +$(SCRIPT_SH_GEN) $(SCRIPT_LIB) : % : %.sh tools/generate-script.sh GIT-BUILD-OPTIONS GIT-SCRIPT-DEFINES
2720 + $(QUIET_GEN)./tools/generate-script.sh "$<" "$@+" ./GIT-BUILD-OPTIONS && \
2721 mv $@+ $@
2722
2723 git.rc: git.rc.in GIT-VERSION-GEN GIT-VERSION-FILE
@@ -2757,8 +2757,8 @@ endif
2757
2758 PERL_DEFINES += $(gitexecdir) $(perllibdir) $(localedir)
2759
2760 -$(SCRIPT_PERL_GEN): % : %.perl generate-perl.sh GIT-PERL-DEFINES GIT-PERL-HEADER GIT-VERSION-FILE
2761 - $(QUIET_GEN)$(SHELL_PATH) generate-perl.sh ./GIT-BUILD-OPTIONS ./GIT-VERSION-FILE GIT-PERL-HEADER "$<" "$@+" && \
2760 +$(SCRIPT_PERL_GEN): % : %.perl tools/generate-perl.sh GIT-PERL-DEFINES GIT-PERL-HEADER GIT-VERSION-FILE
2761 + $(QUIET_GEN)$(SHELL_PATH) tools/generate-perl.sh ./GIT-BUILD-OPTIONS ./GIT-VERSION-FILE GIT-PERL-HEADER "$<" "$@+" && \
2762 mv $@+ $@
2763
2764 PERL_DEFINES := $(subst $(space),:,$(PERL_DEFINES))
@@ -2786,8 +2786,8 @@ GIT-PERL-HEADER: $(PERL_HEADER_TEMPLATE) GIT-PERL-DEFINES Makefile
2786 perllibdir:
2787 @echo '$(perllibdir_SQ)'
2788
2789 -git-instaweb: git-instaweb.sh generate-script.sh GIT-BUILD-OPTIONS GIT-SCRIPT-DEFINES
2790 - $(QUIET_GEN)./generate-script.sh "$<" "$@+" ./GIT-BUILD-OPTIONS && \
2789 +git-instaweb: git-instaweb.sh tools/generate-script.sh GIT-BUILD-OPTIONS GIT-SCRIPT-DEFINES
2790 + $(QUIET_GEN)./tools/generate-script.sh "$<" "$@+" ./GIT-BUILD-OPTIONS && \
2791 chmod +x $@+ && \
2792 mv $@+ $@
2793 else # NO_PERL
@@ -2804,9 +2804,9 @@ endif # NO_PERL
2804 $(SCRIPT_PYTHON_GEN): GIT-BUILD-OPTIONS
2805
2806 ifndef NO_PYTHON
2807 -$(SCRIPT_PYTHON_GEN): generate-python.sh
2807 +$(SCRIPT_PYTHON_GEN): tools/generate-python.sh
2808 $(SCRIPT_PYTHON_GEN): % : %.py
2809 - $(QUIET_GEN)$(SHELL_PATH) generate-python.sh ./GIT-BUILD-OPTIONS "$<" "$@"
2809 + $(QUIET_GEN)$(SHELL_PATH) tools/generate-python.sh ./GIT-BUILD-OPTIONS "$<" "$@"
2810 else # NO_PYTHON
2811 $(SCRIPT_PYTHON_GEN): % : unimplemented.sh
2812 $(QUIET_GEN) \
@@ -3226,9 +3226,9 @@ endif
3226 NO_PERL_CPAN_FALLBACKS_SQ = $(subst ','\'',$(NO_PERL_CPAN_FALLBACKS))
3227 endif
3228
3229 -perl/build/lib/%.pm: perl/%.pm generate-perl.sh GIT-BUILD-OPTIONS GIT-VERSION-FILE GIT-PERL-DEFINES
3229 +perl/build/lib/%.pm: perl/%.pm tools/generate-perl.sh GIT-BUILD-OPTIONS GIT-VERSION-FILE GIT-PERL-DEFINES
3230 $(call mkdir_p_parent_template)
3231 - $(QUIET_GEN)$(SHELL_PATH) generate-perl.sh ./GIT-BUILD-OPTIONS ./GIT-VERSION-FILE GIT-PERL-HEADER "$<" "$@"
3231 + $(QUIET_GEN)$(SHELL_PATH) tools/generate-perl.sh ./GIT-BUILD-OPTIONS ./GIT-VERSION-FILE GIT-PERL-HEADER "$<" "$@"
3232
3233 perl/build/man/man3/Git.3pm: perl/Git.pm
3234 $(call mkdir_p_parent_template)
@@ -3936,7 +3936,7 @@ check-docs::
3936 ### Make sure built-ins do not have dups and listed in git.c
3937 #
3938 check-builtins::
3939 - ./check-builtins.sh
3939 + ./tools/check-builtins.sh
3940
3941 ### Test suite coverage testing
3942 #
config.mak.dev
+1 -1
@@ -1,5 +1,5 @@
1 ifndef COMPILER_FEATURES
2 -COMPILER_FEATURES := $(shell ./detect-compiler $(CC))
2 +COMPILER_FEATURES := $(shell ./tools/detect-compiler $(CC))
3 endif
4
5 ifeq ($(filter no-error,$(DEVOPTS)),)
contrib/buildsystems/CMakeLists.txt
+9 -9
@@ -636,7 +636,7 @@ set(EXCLUSION_PROGS_CACHE ${EXCLUSION_PROGS} CACHE STRING "Programs not built" F
636 if(NOT EXISTS ${CMAKE_BINARY_DIR}/command-list.h OR NOT EXCLUSION_PROGS_CACHE STREQUAL EXCLUSION_PROGS)
637 list(REMOVE_ITEM EXCLUSION_PROGS empty)
638 message("Generating command-list.h")
639 - execute_process(COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/generate-cmdlist.sh"
639 + execute_process(COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/tools/generate-cmdlist.sh"
640 ${EXCLUSION_PROGS}
641 "${CMAKE_SOURCE_DIR}"
642 "${CMAKE_BINARY_DIR}/command-list.h")
@@ -644,14 +644,14 @@ endif()
644
645 if(NOT EXISTS ${CMAKE_BINARY_DIR}/config-list.h)
646 message("Generating config-list.h")
647 - execute_process(COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/generate-configlist.sh"
647 + execute_process(COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/tools/generate-configlist.sh"
648 "${CMAKE_SOURCE_DIR}"
649 "${CMAKE_BINARY_DIR}/config-list.h")
650 endif()
651
652 if(NOT EXISTS ${CMAKE_BINARY_DIR}/hook-list.h)
653 message("Generating hook-list.h")
654 - execute_process(COMMAND "${SH_EXE}" ${CMAKE_SOURCE_DIR}/generate-hooklist.sh
654 + execute_process(COMMAND "${SH_EXE}" ${CMAKE_SOURCE_DIR}/tools/generate-hooklist.sh
655 "${CMAKE_SOURCE_DIR}"
656 "${CMAKE_BINARY_DIR}/hook-list.h")
657 endif()
@@ -832,11 +832,11 @@ foreach(script ${git_shell_scripts})
832 endif()
833
834 add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/${shell_gen_path}"
835 - COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/generate-script.sh"
835 + COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/tools/generate-script.sh"
836 "${CMAKE_SOURCE_DIR}/${script}.sh"
837 "${CMAKE_BINARY_DIR}/${shell_gen_path}"
838 "${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS"
839 - DEPENDS "${CMAKE_SOURCE_DIR}/generate-script.sh"
839 + DEPENDS "${CMAKE_SOURCE_DIR}/tools/generate-script.sh"
840 "${CMAKE_SOURCE_DIR}/${script}.sh"
841 VERBATIM)
842 list(APPEND shell_gen ${CMAKE_BINARY_DIR}/${shell_gen_path})
@@ -875,13 +875,13 @@ foreach(script ${git_perl_scripts} ${perl_modules})
875 file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/${perl_gen_dir}")
876
877 add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/${perl_gen_path}"
878 - COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/generate-perl.sh"
878 + COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/tools/generate-perl.sh"
879 "${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS"
880 "${CMAKE_BINARY_DIR}/GIT-VERSION-FILE"
881 "${CMAKE_BINARY_DIR}/GIT-PERL-HEADER"
882 "${CMAKE_SOURCE_DIR}/${script}"
883 "${CMAKE_BINARY_DIR}/${perl_gen_path}"
884 - DEPENDS "${CMAKE_SOURCE_DIR}/generate-perl.sh"
884 + DEPENDS "${CMAKE_SOURCE_DIR}/tools/generate-perl.sh"
885 "${CMAKE_SOURCE_DIR}/${script}"
886 "${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS"
887 "${CMAKE_BINARY_DIR}/GIT-VERSION-FILE"
@@ -892,11 +892,11 @@ add_custom_target(perl-gen ALL DEPENDS ${perl_gen})
892
893 # Python script
894 add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/git-p4"
895 - COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/generate-python.sh"
895 + COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/tools/generate-python.sh"
896 "${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS"
897 "${CMAKE_SOURCE_DIR}/git-p4.py"
898 "${CMAKE_BINARY_DIR}/git-p4"
899 - DEPENDS "${CMAKE_SOURCE_DIR}/generate-python.sh"
899 + DEPENDS "${CMAKE_SOURCE_DIR}/tools/generate-python.sh"
900 "${CMAKE_SOURCE_DIR}/git-p4.py"
901 "${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS"
902 VERBATIM)
contrib/subtree/meson.build
+1 -1
@@ -3,7 +3,7 @@ git_subtree = custom_target(
3 output: 'git-subtree',
4 command: [
5 shell,
6 - meson.project_source_root() / 'generate-script.sh',
6 + meson.project_source_root() / 'tools/generate-script.sh',
7 '@INPUT@',
8 '@OUTPUT@',
9 meson.project_build_root() / 'GIT-BUILD-OPTIONS',
meson.build
+7 -7
@@ -554,7 +554,7 @@ libgit_sources = [
554 libgit_sources += custom_target(
555 input: 'command-list.txt',
556 output: 'command-list.h',
557 - command: [shell, meson.current_source_dir() + '/generate-cmdlist.sh', meson.current_source_dir(), '@OUTPUT@'],
557 + command: [shell, meson.current_source_dir() + '/tools/generate-cmdlist.sh', meson.current_source_dir(), '@OUTPUT@'],
558 env: script_environment,
559 )
560
@@ -723,10 +723,10 @@ endif
723 builtin_sources += custom_target(
724 output: 'config-list.h',
725 depfile: 'config-list.h.d',
726 - depend_files: [ 'generate-configlist.sh' ],
726 + depend_files: [ 'tools/generate-configlist.sh' ],
727 command: [
728 shell,
729 - meson.current_source_dir() / 'generate-configlist.sh',
729 + meson.current_source_dir() / 'tools/generate-configlist.sh',
730 meson.current_source_dir(),
731 '@OUTPUT@',
732 '@DEPFILE@',
@@ -739,7 +739,7 @@ builtin_sources += custom_target(
739 output: 'hook-list.h',
740 command: [
741 shell,
742 - meson.current_source_dir() + '/generate-hooklist.sh',
742 + meson.current_source_dir() + '/tools/generate-hooklist.sh',
743 meson.current_source_dir(),
744 '@OUTPUT@',
745 ],
@@ -1959,7 +1959,7 @@ foreach script : scripts_sh
1959 output: fs.stem(script),
1960 command: [
1961 shell,
1962 - meson.project_source_root() / 'generate-script.sh',
1962 + meson.project_source_root() / 'tools/generate-script.sh',
1963 '@INPUT@',
1964 '@OUTPUT@',
1965 meson.project_build_root() / 'GIT-BUILD-OPTIONS',
@@ -2008,7 +2008,7 @@ if perl_features_enabled
2008
2009 generate_perl_command = [
2010 shell,
2011 - meson.project_source_root() / 'generate-perl.sh',
2011 + meson.project_source_root() / 'tools/generate-perl.sh',
2012 meson.project_build_root() / 'GIT-BUILD-OPTIONS',
2013 git_version_file.full_path(),
2014 perl_header,
@@ -2057,7 +2057,7 @@ if target_python.found()
2057 output: fs.stem(script),
2058 command: [
2059 shell,
2060 - meson.project_source_root() / 'generate-python.sh',
2060 + meson.project_source_root() / 'tools/generate-python.sh',
2061 meson.project_build_root() / 'GIT-BUILD-OPTIONS',
2062 '@INPUT@',
2063 '@OUTPUT@',
tools/check-builtins.sh renamed
tools/detect-compiler renamed
tools/generate-cmdlist.sh renamed
tools/generate-configlist.sh renamed
tools/generate-hooklist.sh renamed
tools/generate-perl.sh renamed
tools/generate-python.sh renamed
tools/generate-script.sh renamed