mirror of
https://github.com/git-for-windows/git.git
synced 2026-04-23 20:01:29 -05:00
Merge branch 'ps/build-tweaks' into next
Tweak the build infrastructure by moving tools around. * ps/build-tweaks: meson: precompile "git-compat-util.h" meson: compile compatibility sources separately git-compat-util.h: move warning infra to prepare for PCHs builds: move build scripts into "tools/" contrib: move "update-unicode.sh" script into "tools/" contrib: move "coverage-diff.sh" script into "tools/" contrib: move "coccinelle/" directory into "tools/" Introduce new "tools/" directory
This commit is contained in:
76
Makefile
76
Makefile
@@ -1005,8 +1005,8 @@ SPATCH_TEST_FLAGS =
|
||||
# COMPUTE_HEADER_DEPENDENCIES=no this will be unset too.
|
||||
SPATCH_USE_O_DEPENDENCIES = YesPlease
|
||||
|
||||
# Set SPATCH_CONCAT_COCCI to concatenate the contrib/cocci/*.cocci
|
||||
# files into a single contrib/cocci/ALL.cocci before running
|
||||
# Set SPATCH_CONCAT_COCCI to concatenate the tools/coccinelle/*.cocci
|
||||
# files into a single tools/coccinelle/ALL.cocci before running
|
||||
# "coccicheck".
|
||||
#
|
||||
# Pros:
|
||||
@@ -1025,7 +1025,7 @@ SPATCH_USE_O_DEPENDENCIES = YesPlease
|
||||
# generate a specific patch, e.g. this will always use strbuf.cocci,
|
||||
# not ALL.cocci:
|
||||
#
|
||||
# make contrib/coccinelle/strbuf.cocci.patch
|
||||
# make tools/coccinelle/strbuf.cocci.patch
|
||||
SPATCH_CONCAT_COCCI = YesPlease
|
||||
|
||||
# Rebuild 'coccicheck' if $(SPATCH), its flags etc. change
|
||||
@@ -1066,11 +1066,13 @@ SOURCES_CMD = ( \
|
||||
'*.sh' \
|
||||
':!*[tp][0-9][0-9][0-9][0-9]*' \
|
||||
':!contrib' \
|
||||
':!tools' \
|
||||
2>/dev/null || \
|
||||
$(FIND) . \
|
||||
\( -name .git -type d -prune \) \
|
||||
-o \( -name '[tp][0-9][0-9][0-9][0-9]*' -prune \) \
|
||||
-o \( -name contrib -type d -prune \) \
|
||||
-o \( -name tools -type d -prune \) \
|
||||
-o \( -name build -type d -prune \) \
|
||||
-o \( -name .build -type d -prune \) \
|
||||
-o \( -name 'trash*' -type d -prune \) \
|
||||
@@ -2697,21 +2699,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):\
|
||||
@@ -2724,8 +2726,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
|
||||
@@ -2765,8 +2767,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))
|
||||
@@ -2794,8 +2796,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
|
||||
@@ -2812,9 +2814,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) \
|
||||
@@ -3234,9 +3236,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)
|
||||
@@ -3465,15 +3467,15 @@ check:
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
COCCI_GEN_ALL = .build/contrib/coccinelle/ALL.cocci
|
||||
COCCI_GLOB = $(wildcard contrib/coccinelle/*.cocci)
|
||||
COCCI_GEN_ALL = .build/tools/coccinelle/ALL.cocci
|
||||
COCCI_GLOB = $(wildcard tools/coccinelle/*.cocci)
|
||||
COCCI_RULES_TRACKED = $(COCCI_GLOB:%=.build/%)
|
||||
COCCI_RULES_TRACKED_NO_PENDING = $(filter-out %.pending.cocci,$(COCCI_RULES_TRACKED))
|
||||
COCCI_RULES =
|
||||
COCCI_RULES += $(COCCI_GEN_ALL)
|
||||
COCCI_RULES += $(COCCI_RULES_TRACKED)
|
||||
COCCI_NAMES =
|
||||
COCCI_NAMES += $(COCCI_RULES:.build/contrib/coccinelle/%.cocci=%)
|
||||
COCCI_NAMES += $(COCCI_RULES:.build/tools/coccinelle/%.cocci=%)
|
||||
|
||||
COCCICHECK_PENDING = $(filter %.pending.cocci,$(COCCI_RULES))
|
||||
COCCICHECK = $(filter-out $(COCCICHECK_PENDING),$(COCCI_RULES))
|
||||
@@ -3488,20 +3490,20 @@ COCCICHECK_PATCHES_PENDING_INTREE = $(COCCICHECK_PATCHES_PENDING:.build/%=%)
|
||||
# on $(MAKECMDGOALS) that match these $(COCCI_RULES)
|
||||
COCCI_RULES_GLOB =
|
||||
COCCI_RULES_GLOB += cocci%
|
||||
COCCI_RULES_GLOB += .build/contrib/coccinelle/%
|
||||
COCCI_RULES_GLOB += .build/tools/coccinelle/%
|
||||
COCCI_RULES_GLOB += $(COCCICHECK_PATCHES)
|
||||
COCCI_RULES_GLOB += $(COCCICHEC_PATCHES_PENDING)
|
||||
COCCI_RULES_GLOB += $(COCCICHECK_PATCHES_INTREE)
|
||||
COCCI_RULES_GLOB += $(COCCICHECK_PATCHES_PENDING_INTREE)
|
||||
COCCI_GOALS = $(filter $(COCCI_RULES_GLOB),$(MAKECMDGOALS))
|
||||
|
||||
COCCI_TEST_RES = $(wildcard contrib/coccinelle/tests/*.res)
|
||||
COCCI_TEST_RES = $(wildcard tools/coccinelle/tests/*.res)
|
||||
|
||||
$(COCCI_RULES_TRACKED): .build/% : %
|
||||
$(call mkdir_p_parent_template)
|
||||
$(QUIET_CP)cp $< $@
|
||||
|
||||
.build/contrib/coccinelle/FOUND_H_SOURCES: $(FOUND_H_SOURCES)
|
||||
.build/tools/coccinelle/FOUND_H_SOURCES: $(FOUND_H_SOURCES)
|
||||
$(call mkdir_p_parent_template)
|
||||
$(QUIET_GEN) >$@
|
||||
|
||||
@@ -3515,12 +3517,12 @@ endif
|
||||
define cocci-rule
|
||||
|
||||
## Rule for .build/$(1).patch/$(2); Params:
|
||||
# $(1) = e.g. ".build/contrib/coccinelle/free.cocci"
|
||||
# $(1) = e.g. ".build/tools/coccinelle/free.cocci"
|
||||
# $(2) = e.g. "grep.c"
|
||||
# $(3) = e.g. "grep.o"
|
||||
COCCI_$(1:.build/contrib/coccinelle/%.cocci=%) += $(1).d/$(2).patch
|
||||
COCCI_$(1:.build/tools/coccinelle/%.cocci=%) += $(1).d/$(2).patch
|
||||
$(1).d/$(2).patch: GIT-SPATCH-DEFINES
|
||||
$(1).d/$(2).patch: $(if $(and $(SPATCH_USE_O_DEPENDENCIES),$(wildcard $(3))),$(3),.build/contrib/coccinelle/FOUND_H_SOURCES)
|
||||
$(1).d/$(2).patch: $(if $(and $(SPATCH_USE_O_DEPENDENCIES),$(wildcard $(3))),$(3),.build/tools/coccinelle/FOUND_H_SOURCES)
|
||||
$(1).d/$(2).patch: $(1)
|
||||
$(1).d/$(2).patch: $(1).d/%.patch : %
|
||||
$$(call mkdir_p_parent_template)
|
||||
@@ -3546,13 +3548,13 @@ endif
|
||||
|
||||
define spatch-rule
|
||||
|
||||
.build/contrib/coccinelle/$(1).cocci.patch: $$(COCCI_$(1))
|
||||
.build/tools/coccinelle/$(1).cocci.patch: $$(COCCI_$(1))
|
||||
$$(QUIET_SPATCH_CAT)cat $$^ >$$@ && \
|
||||
if test -s $$@; \
|
||||
then \
|
||||
echo ' ' SPATCH result: $$@; \
|
||||
fi
|
||||
contrib/coccinelle/$(1).cocci.patch: .build/contrib/coccinelle/$(1).cocci.patch
|
||||
tools/coccinelle/$(1).cocci.patch: .build/tools/coccinelle/$(1).cocci.patch
|
||||
$$(QUIET_CP)cp $$< $$@
|
||||
|
||||
endef
|
||||
@@ -3566,9 +3568,9 @@ $(COCCI_TEST_RES_GEN): GIT-SPATCH-DEFINES
|
||||
$(COCCI_TEST_RES_GEN): .build/%.res : %.c
|
||||
$(COCCI_TEST_RES_GEN): .build/%.res : %.res
|
||||
ifdef SPATCH_CONCAT_COCCI
|
||||
$(COCCI_TEST_RES_GEN): .build/contrib/coccinelle/tests/%.res : $(COCCI_GEN_ALL)
|
||||
$(COCCI_TEST_RES_GEN): .build/tools/coccinelle/tests/%.res : $(COCCI_GEN_ALL)
|
||||
else
|
||||
$(COCCI_TEST_RES_GEN): .build/contrib/coccinelle/tests/%.res : contrib/coccinelle/%.cocci
|
||||
$(COCCI_TEST_RES_GEN): .build/tools/coccinelle/tests/%.res : tools/coccinelle/%.cocci
|
||||
endif
|
||||
$(call mkdir_p_parent_template)
|
||||
$(QUIET_SPATCH_TEST)$(SPATCH) $(SPATCH_TEST_FLAGS) \
|
||||
@@ -3584,14 +3586,14 @@ coccicheck-test: $(COCCI_TEST_RES_GEN)
|
||||
coccicheck: coccicheck-test
|
||||
|
||||
ifdef SPATCH_CONCAT_COCCI
|
||||
COCCICHECK_PATCH_MUST_BE_EMPTY_FILES = contrib/coccinelle/ALL.cocci.patch
|
||||
COCCICHECK_PATCH_MUST_BE_EMPTY_FILES = tools/coccinelle/ALL.cocci.patch
|
||||
else
|
||||
COCCICHECK_PATCH_MUST_BE_EMPTY_FILES = $(COCCICHECK_PATCHES_INTREE)
|
||||
endif
|
||||
coccicheck: $(COCCICHECK_PATCH_MUST_BE_EMPTY_FILES)
|
||||
! grep ^ $(COCCICHECK_PATCH_MUST_BE_EMPTY_FILES) /dev/null
|
||||
|
||||
# See contrib/coccinelle/README
|
||||
# See tools/coccinelle/README
|
||||
coccicheck-pending: coccicheck-test
|
||||
coccicheck-pending: $(COCCICHECK_PATCHES_PENDING_INTREE)
|
||||
|
||||
@@ -3865,8 +3867,8 @@ profile-clean:
|
||||
|
||||
cocciclean:
|
||||
$(RM) GIT-SPATCH-DEFINES
|
||||
$(RM) -r .build/contrib/coccinelle
|
||||
$(RM) contrib/coccinelle/*.cocci.patch
|
||||
$(RM) -r .build/tools/coccinelle
|
||||
$(RM) tools/coccinelle/*.cocci.patch
|
||||
|
||||
clean: profile-clean coverage-clean cocciclean
|
||||
$(RM) -r .build $(UNIT_TEST_BIN)
|
||||
@@ -3944,7 +3946,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
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user