]> git.ipfire.org Git - thirdparty/git.git/commitdiff
builds: move build scripts into "tools/"
authorPatrick Steinhardt <ps@pks.im>
Thu, 19 Mar 2026 05:33:24 +0000 (06:33 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 19 Mar 2026 13:40:09 +0000 (06:40 -0700)
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>
13 files changed:
Makefile
config.mak.dev
contrib/buildsystems/CMakeLists.txt
contrib/subtree/meson.build
meson.build
tools/check-builtins.sh [moved from check-builtins.sh with 100% similarity]
tools/detect-compiler [moved from detect-compiler with 100% similarity]
tools/generate-cmdlist.sh [moved from generate-cmdlist.sh with 100% similarity]
tools/generate-configlist.sh [moved from generate-configlist.sh with 100% similarity]
tools/generate-hooklist.sh [moved from generate-hooklist.sh with 100% similarity]
tools/generate-perl.sh [moved from generate-perl.sh with 100% similarity]
tools/generate-python.sh [moved from generate-python.sh with 100% similarity]
tools/generate-script.sh [moved from generate-script.sh with 100% similarity]

index 8564b1be369caecf8ac79975f920a734e35c32ac..322f5940e3077da0b657530451bf677aec9bc9c1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -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
 #
index e86b6e1b34a2d7fbc59185f036591b16d259ac4a..c8dcf78779e60b990d815d80301b13b4b67234c1 100644 (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)),)
index c6cfb874efbb17e190c1db4eb68fc45f39dcb9c6..81b4306e72046c243f3aea5465490f28abd1e4e2 100644 (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)
index 161435abebd476884aa902c943b58ba5e26d1468..804c31589447791def0bbd3322220d034acc0588 100644 (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',
index 1d66b5181e97b62889c87a216618cbe5ae75a780..604fe89d2d1a0f415a1259eddfe573324b27050c 100644 (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@',
similarity index 100%
rename from check-builtins.sh
rename to tools/check-builtins.sh
similarity index 100%
rename from detect-compiler
rename to tools/detect-compiler
similarity index 100%
rename from generate-perl.sh
rename to tools/generate-perl.sh
similarity index 100%
rename from generate-python.sh
rename to tools/generate-python.sh
similarity index 100%
rename from generate-script.sh
rename to tools/generate-script.sh