Merge branch 'ab/make-optim-noop'
Makefile refactoring with a bit of suffixes rule stripping to optimize the runtime overhead. * ab/make-optim-noop: Makefiles: add and use wildcard "mkdir -p" template Makefile: add "$(QUIET)" boilerplate to shared.mak Makefile: move $(comma), $(empty) and $(space) to shared.mak Makefile: move ".SUFFIXES" rule to shared.mak Makefile: define $(LIB_H) in terms of $(FIND_SOURCE_FILES) Makefile: disable GNU make built-in wildcard rules Makefiles: add "shared.mak", move ".DELETE_ON_ERROR" to it scalar Makefile: use "The default target of..." pattern
This commit is contained in:
commit
f62106d750
@ -1,3 +1,6 @@
|
|||||||
|
# Import tree-wide shared Makefile behavior and libraries
|
||||||
|
include ../shared.mak
|
||||||
|
|
||||||
# Guard against environment variables
|
# Guard against environment variables
|
||||||
MAN1_TXT =
|
MAN1_TXT =
|
||||||
MAN5_TXT =
|
MAN5_TXT =
|
||||||
@ -215,38 +218,6 @@ DEFAULT_EDITOR_SQ = $(subst ','\'',$(DEFAULT_EDITOR))
|
|||||||
ASCIIDOC_EXTRA += -a 'git-default-editor=$(DEFAULT_EDITOR_SQ)'
|
ASCIIDOC_EXTRA += -a 'git-default-editor=$(DEFAULT_EDITOR_SQ)'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
|
|
||||||
QUIET_SUBDIR1 =
|
|
||||||
|
|
||||||
ifneq ($(findstring $(MAKEFLAGS),w),w)
|
|
||||||
PRINT_DIR = --no-print-directory
|
|
||||||
else # "make -w"
|
|
||||||
NO_SUBDIR = :
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(findstring $(MAKEFLAGS),s),s)
|
|
||||||
ifndef V
|
|
||||||
QUIET = @
|
|
||||||
QUIET_ASCIIDOC = @echo ' ' ASCIIDOC $@;
|
|
||||||
QUIET_XMLTO = @echo ' ' XMLTO $@;
|
|
||||||
QUIET_DB2TEXI = @echo ' ' DB2TEXI $@;
|
|
||||||
QUIET_MAKEINFO = @echo ' ' MAKEINFO $@;
|
|
||||||
QUIET_DBLATEX = @echo ' ' DBLATEX $@;
|
|
||||||
QUIET_XSLTPROC = @echo ' ' XSLTPROC $@;
|
|
||||||
QUIET_GEN = @echo ' ' GEN $@;
|
|
||||||
QUIET_STDERR = 2> /dev/null
|
|
||||||
QUIET_SUBDIR0 = +@subdir=
|
|
||||||
QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
|
|
||||||
$(MAKE) $(PRINT_DIR) -C $$subdir
|
|
||||||
|
|
||||||
QUIET_LINT_GITLINK = @echo ' ' LINT GITLINK $<;
|
|
||||||
QUIET_LINT_MANSEC = @echo ' ' LINT MAN SEC $<;
|
|
||||||
QUIET_LINT_MANEND = @echo ' ' LINT MAN END $<;
|
|
||||||
|
|
||||||
export V
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
all: html man
|
all: html man
|
||||||
|
|
||||||
html: $(DOC_HTML)
|
html: $(DOC_HTML)
|
||||||
@ -463,25 +434,11 @@ quick-install-html: require-htmlrepo
|
|||||||
print-man1:
|
print-man1:
|
||||||
@for i in $(MAN1_TXT); do echo $$i; done
|
@for i in $(MAN1_TXT); do echo $$i; done
|
||||||
|
|
||||||
## Lint: Common
|
|
||||||
.build:
|
|
||||||
$(QUIET)mkdir $@
|
|
||||||
.build/lint-docs: | .build
|
|
||||||
$(QUIET)mkdir $@
|
|
||||||
|
|
||||||
## Lint: gitlink
|
## Lint: gitlink
|
||||||
.build/lint-docs/gitlink: | .build/lint-docs
|
|
||||||
$(QUIET)mkdir $@
|
|
||||||
.build/lint-docs/gitlink/howto: | .build/lint-docs/gitlink
|
|
||||||
$(QUIET)mkdir $@
|
|
||||||
.build/lint-docs/gitlink/config: | .build/lint-docs/gitlink
|
|
||||||
$(QUIET)mkdir $@
|
|
||||||
LINT_DOCS_GITLINK = $(patsubst %.txt,.build/lint-docs/gitlink/%.ok,$(HOWTO_TXT) $(DOC_DEP_TXT))
|
LINT_DOCS_GITLINK = $(patsubst %.txt,.build/lint-docs/gitlink/%.ok,$(HOWTO_TXT) $(DOC_DEP_TXT))
|
||||||
$(LINT_DOCS_GITLINK): | .build/lint-docs/gitlink
|
|
||||||
$(LINT_DOCS_GITLINK): | .build/lint-docs/gitlink/howto
|
|
||||||
$(LINT_DOCS_GITLINK): | .build/lint-docs/gitlink/config
|
|
||||||
$(LINT_DOCS_GITLINK): lint-gitlink.perl
|
$(LINT_DOCS_GITLINK): lint-gitlink.perl
|
||||||
$(LINT_DOCS_GITLINK): .build/lint-docs/gitlink/%.ok: %.txt
|
$(LINT_DOCS_GITLINK): .build/lint-docs/gitlink/%.ok: %.txt
|
||||||
|
$(call mkdir_p_parent_template)
|
||||||
$(QUIET_LINT_GITLINK)$(PERL_PATH) lint-gitlink.perl \
|
$(QUIET_LINT_GITLINK)$(PERL_PATH) lint-gitlink.perl \
|
||||||
$< \
|
$< \
|
||||||
$(HOWTO_TXT) $(DOC_DEP_TXT) \
|
$(HOWTO_TXT) $(DOC_DEP_TXT) \
|
||||||
@ -492,23 +449,18 @@ $(LINT_DOCS_GITLINK): .build/lint-docs/gitlink/%.ok: %.txt
|
|||||||
lint-docs-gitlink: $(LINT_DOCS_GITLINK)
|
lint-docs-gitlink: $(LINT_DOCS_GITLINK)
|
||||||
|
|
||||||
## Lint: man-end-blurb
|
## Lint: man-end-blurb
|
||||||
.build/lint-docs/man-end-blurb: | .build/lint-docs
|
|
||||||
$(QUIET)mkdir $@
|
|
||||||
LINT_DOCS_MAN_END_BLURB = $(patsubst %.txt,.build/lint-docs/man-end-blurb/%.ok,$(MAN_TXT))
|
LINT_DOCS_MAN_END_BLURB = $(patsubst %.txt,.build/lint-docs/man-end-blurb/%.ok,$(MAN_TXT))
|
||||||
$(LINT_DOCS_MAN_END_BLURB): | .build/lint-docs/man-end-blurb
|
|
||||||
$(LINT_DOCS_MAN_END_BLURB): lint-man-end-blurb.perl
|
$(LINT_DOCS_MAN_END_BLURB): lint-man-end-blurb.perl
|
||||||
$(LINT_DOCS_MAN_END_BLURB): .build/lint-docs/man-end-blurb/%.ok: %.txt
|
$(LINT_DOCS_MAN_END_BLURB): .build/lint-docs/man-end-blurb/%.ok: %.txt
|
||||||
|
$(call mkdir_p_parent_template)
|
||||||
$(QUIET_LINT_MANEND)$(PERL_PATH) lint-man-end-blurb.perl $< >$@
|
$(QUIET_LINT_MANEND)$(PERL_PATH) lint-man-end-blurb.perl $< >$@
|
||||||
.PHONY: lint-docs-man-end-blurb
|
.PHONY: lint-docs-man-end-blurb
|
||||||
lint-docs-man-end-blurb: $(LINT_DOCS_MAN_END_BLURB)
|
|
||||||
|
|
||||||
## Lint: man-section-order
|
## Lint: man-section-order
|
||||||
.build/lint-docs/man-section-order: | .build/lint-docs
|
|
||||||
$(QUIET)mkdir $@
|
|
||||||
LINT_DOCS_MAN_SECTION_ORDER = $(patsubst %.txt,.build/lint-docs/man-section-order/%.ok,$(MAN_TXT))
|
LINT_DOCS_MAN_SECTION_ORDER = $(patsubst %.txt,.build/lint-docs/man-section-order/%.ok,$(MAN_TXT))
|
||||||
$(LINT_DOCS_MAN_SECTION_ORDER): | .build/lint-docs/man-section-order
|
|
||||||
$(LINT_DOCS_MAN_SECTION_ORDER): lint-man-section-order.perl
|
$(LINT_DOCS_MAN_SECTION_ORDER): lint-man-section-order.perl
|
||||||
$(LINT_DOCS_MAN_SECTION_ORDER): .build/lint-docs/man-section-order/%.ok: %.txt
|
$(LINT_DOCS_MAN_SECTION_ORDER): .build/lint-docs/man-section-order/%.ok: %.txt
|
||||||
|
$(call mkdir_p_parent_template)
|
||||||
$(QUIET_LINT_MANSEC)$(PERL_PATH) lint-man-section-order.perl $< >$@
|
$(QUIET_LINT_MANSEC)$(PERL_PATH) lint-man-section-order.perl $< >$@
|
||||||
.PHONY: lint-docs-man-section-order
|
.PHONY: lint-docs-man-section-order
|
||||||
lint-docs-man-section-order: $(LINT_DOCS_MAN_SECTION_ORDER)
|
lint-docs-man-section-order: $(LINT_DOCS_MAN_SECTION_ORDER)
|
||||||
@ -524,7 +476,4 @@ doc-l10n install-l10n::
|
|||||||
$(MAKE) -C po $@
|
$(MAKE) -C po $@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Delete the target file on error
|
|
||||||
.DELETE_ON_ERROR:
|
|
||||||
|
|
||||||
.PHONY: FORCE
|
.PHONY: FORCE
|
||||||
|
118
Makefile
118
Makefile
@ -1,6 +1,9 @@
|
|||||||
# The default target of this Makefile is...
|
# The default target of this Makefile is...
|
||||||
all::
|
all::
|
||||||
|
|
||||||
|
# Import tree-wide shared Makefile behavior and libraries
|
||||||
|
include shared.mak
|
||||||
|
|
||||||
# Define V=1 to have a more verbose compile.
|
# Define V=1 to have a more verbose compile.
|
||||||
#
|
#
|
||||||
# Define SHELL_PATH to a POSIX shell if your /bin/sh is broken.
|
# Define SHELL_PATH to a POSIX shell if your /bin/sh is broken.
|
||||||
@ -830,12 +833,33 @@ GENERATED_H += hook-list.h
|
|||||||
.PHONY: generated-hdrs
|
.PHONY: generated-hdrs
|
||||||
generated-hdrs: $(GENERATED_H)
|
generated-hdrs: $(GENERATED_H)
|
||||||
|
|
||||||
LIB_H := $(sort $(patsubst ./%,%,$(shell git ls-files '*.h' ':!t/' ':!Documentation/' 2>/dev/null || \
|
## Exhaustive lists of our source files, either dynamically generated,
|
||||||
|
## or hardcoded.
|
||||||
|
SOURCES_CMD = ( \
|
||||||
|
git ls-files \
|
||||||
|
'*.[hcS]' \
|
||||||
|
'*.sh' \
|
||||||
|
':!*[tp][0-9][0-9][0-9][0-9]*' \
|
||||||
|
':!contrib' \
|
||||||
|
2>/dev/null || \
|
||||||
$(FIND) . \
|
$(FIND) . \
|
||||||
-name .git -prune -o \
|
\( -name .git -type d -prune \) \
|
||||||
-name t -prune -o \
|
-o \( -name '[tp][0-9][0-9][0-9][0-9]*' -prune \) \
|
||||||
-name Documentation -prune -o \
|
-o \( -name contrib -type d -prune \) \
|
||||||
-name '*.h' -print)))
|
-o \( -name build -type d -prune \) \
|
||||||
|
-o \( -name 'trash*' -type d -prune \) \
|
||||||
|
-o \( -name '*.[hcS]' -type f -print \) \
|
||||||
|
-o \( -name '*.sh' -type f -print \) \
|
||||||
|
| sed -e 's|^\./||' \
|
||||||
|
)
|
||||||
|
FOUND_SOURCE_FILES := $(shell $(SOURCES_CMD))
|
||||||
|
|
||||||
|
FOUND_C_SOURCES = $(filter %.c,$(FOUND_SOURCE_FILES))
|
||||||
|
FOUND_H_SOURCES = $(filter %.h,$(FOUND_SOURCE_FILES))
|
||||||
|
|
||||||
|
COCCI_SOURCES = $(filter-out $(THIRD_PARTY_SOURCES),$(FOUND_C_SOURCES))
|
||||||
|
|
||||||
|
LIB_H = $(FOUND_H_SOURCES)
|
||||||
|
|
||||||
LIB_OBJS += abspath.o
|
LIB_OBJS += abspath.o
|
||||||
LIB_OBJS += add-interactive.o
|
LIB_OBJS += add-interactive.o
|
||||||
@ -1265,10 +1289,6 @@ endif
|
|||||||
ALL_CFLAGS = $(DEVELOPER_CFLAGS) $(CPPFLAGS) $(CFLAGS)
|
ALL_CFLAGS = $(DEVELOPER_CFLAGS) $(CPPFLAGS) $(CFLAGS)
|
||||||
ALL_LDFLAGS = $(LDFLAGS)
|
ALL_LDFLAGS = $(LDFLAGS)
|
||||||
|
|
||||||
comma := ,
|
|
||||||
empty :=
|
|
||||||
space := $(empty) $(empty)
|
|
||||||
|
|
||||||
ifdef SANITIZE
|
ifdef SANITIZE
|
||||||
SANITIZERS := $(foreach flag,$(subst $(comma),$(space),$(SANITIZE)),$(flag))
|
SANITIZERS := $(foreach flag,$(subst $(comma),$(space),$(SANITIZE)),$(flag))
|
||||||
BASIC_CFLAGS += -fsanitize=$(SANITIZE) -fno-sanitize-recover=$(SANITIZE)
|
BASIC_CFLAGS += -fsanitize=$(SANITIZE) -fno-sanitize-recover=$(SANITIZE)
|
||||||
@ -1981,39 +2001,6 @@ ifndef PAGER_ENV
|
|||||||
PAGER_ENV = LESS=FRX LV=-c
|
PAGER_ENV = LESS=FRX LV=-c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
|
|
||||||
QUIET_SUBDIR1 =
|
|
||||||
|
|
||||||
ifneq ($(findstring w,$(MAKEFLAGS)),w)
|
|
||||||
PRINT_DIR = --no-print-directory
|
|
||||||
else # "make -w"
|
|
||||||
NO_SUBDIR = :
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(findstring s,$(MAKEFLAGS)),s)
|
|
||||||
ifndef V
|
|
||||||
QUIET_CC = @echo ' ' CC $@;
|
|
||||||
QUIET_AR = @echo ' ' AR $@;
|
|
||||||
QUIET_LINK = @echo ' ' LINK $@;
|
|
||||||
QUIET_BUILT_IN = @echo ' ' BUILTIN $@;
|
|
||||||
QUIET_GEN = @echo ' ' GEN $@;
|
|
||||||
QUIET_LNCP = @echo ' ' LN/CP $@;
|
|
||||||
QUIET_XGETTEXT = @echo ' ' XGETTEXT $@;
|
|
||||||
QUIET_MSGFMT = @echo ' ' MSGFMT $@;
|
|
||||||
QUIET_GCOV = @echo ' ' GCOV $@;
|
|
||||||
QUIET_SP = @echo ' ' SP $<;
|
|
||||||
QUIET_HDR = @echo ' ' HDR $(<:hcc=h);
|
|
||||||
QUIET_RC = @echo ' ' RC $@;
|
|
||||||
QUIET_SPATCH = @echo ' ' SPATCH $<;
|
|
||||||
QUIET_SUBDIR0 = +@subdir=
|
|
||||||
QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
|
|
||||||
$(MAKE) $(PRINT_DIR) -C $$subdir
|
|
||||||
export V
|
|
||||||
export QUIET_GEN
|
|
||||||
export QUIET_BUILT_IN
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef NO_INSTALL_HARDLINKS
|
ifdef NO_INSTALL_HARDLINKS
|
||||||
export NO_INSTALL_HARDLINKS
|
export NO_INSTALL_HARDLINKS
|
||||||
endif
|
endif
|
||||||
@ -2194,16 +2181,6 @@ shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell
|
|||||||
strip: $(PROGRAMS) git$X
|
strip: $(PROGRAMS) git$X
|
||||||
$(STRIP) $(STRIP_OPTS) $^
|
$(STRIP) $(STRIP_OPTS) $^
|
||||||
|
|
||||||
### Flags affecting all rules
|
|
||||||
|
|
||||||
# A GNU make extension since gmake 3.72 (released in late 1994) to
|
|
||||||
# remove the target of rules if commands in those rules fail. The
|
|
||||||
# default is to only do that if make itself receives a signal. Affects
|
|
||||||
# all targets, see:
|
|
||||||
#
|
|
||||||
# info make --index-search=.DELETE_ON_ERROR
|
|
||||||
.DELETE_ON_ERROR:
|
|
||||||
|
|
||||||
### Target-specific flags and dependencies
|
### Target-specific flags and dependencies
|
||||||
|
|
||||||
# The generic compilation pattern rule and automatically
|
# The generic compilation pattern rule and automatically
|
||||||
@ -2566,8 +2543,6 @@ ASM_SRC := $(wildcard $(OBJECTS:o=S))
|
|||||||
ASM_OBJ := $(ASM_SRC:S=o)
|
ASM_OBJ := $(ASM_SRC:S=o)
|
||||||
C_OBJ := $(filter-out $(ASM_OBJ),$(OBJECTS))
|
C_OBJ := $(filter-out $(ASM_OBJ),$(OBJECTS))
|
||||||
|
|
||||||
.SUFFIXES:
|
|
||||||
|
|
||||||
$(C_OBJ): %.o: %.c GIT-CFLAGS $(missing_dep_dirs) $(missing_compdb_dir)
|
$(C_OBJ): %.o: %.c GIT-CFLAGS $(missing_dep_dirs) $(missing_compdb_dir)
|
||||||
$(QUIET_CC)$(CC) -o $*.o -c $(dep_args) $(compdb_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
|
$(QUIET_CC)$(CC) -o $*.o -c $(dep_args) $(compdb_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
|
||||||
$(ASM_OBJ): %.o: %.S GIT-CFLAGS $(missing_dep_dirs) $(missing_compdb_dir)
|
$(ASM_OBJ): %.o: %.S GIT-CFLAGS $(missing_dep_dirs) $(missing_compdb_dir)
|
||||||
@ -2770,7 +2745,8 @@ all:: $(MOFILES)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
po/build/locale/%/LC_MESSAGES/git.mo: po/%.po
|
po/build/locale/%/LC_MESSAGES/git.mo: po/%.po
|
||||||
$(QUIET_MSGFMT)mkdir -p $(dir $@) && $(MSGFMT) -o $@ $<
|
$(call mkdir_p_parent_template)
|
||||||
|
$(QUIET_MSGFMT)$(MSGFMT) -o $@ $<
|
||||||
|
|
||||||
LIB_PERL := $(wildcard perl/Git.pm perl/Git/*.pm perl/Git/*/*.pm perl/Git/*/*/*.pm)
|
LIB_PERL := $(wildcard perl/Git.pm perl/Git/*.pm perl/Git/*/*.pm perl/Git/*/*/*.pm)
|
||||||
LIB_PERL_GEN := $(patsubst perl/%.pm,perl/build/lib/%.pm,$(LIB_PERL))
|
LIB_PERL_GEN := $(patsubst perl/%.pm,perl/build/lib/%.pm,$(LIB_PERL))
|
||||||
@ -2786,35 +2762,16 @@ NO_PERL_CPAN_FALLBACKS_SQ = $(subst ','\'',$(NO_PERL_CPAN_FALLBACKS))
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
perl/build/lib/%.pm: perl/%.pm GIT-PERL-DEFINES
|
perl/build/lib/%.pm: perl/%.pm GIT-PERL-DEFINES
|
||||||
$(QUIET_GEN)mkdir -p $(dir $@) && \
|
$(call mkdir_p_parent_template)
|
||||||
|
$(QUIET_GEN) \
|
||||||
sed -e 's|@@LOCALEDIR@@|$(perl_localedir_SQ)|g' \
|
sed -e 's|@@LOCALEDIR@@|$(perl_localedir_SQ)|g' \
|
||||||
-e 's|@@NO_GETTEXT@@|$(NO_GETTEXT_SQ)|g' \
|
-e 's|@@NO_GETTEXT@@|$(NO_GETTEXT_SQ)|g' \
|
||||||
-e 's|@@NO_PERL_CPAN_FALLBACKS@@|$(NO_PERL_CPAN_FALLBACKS_SQ)|g' \
|
-e 's|@@NO_PERL_CPAN_FALLBACKS@@|$(NO_PERL_CPAN_FALLBACKS_SQ)|g' \
|
||||||
< $< > $@
|
< $< > $@
|
||||||
|
|
||||||
perl/build/man/man3/Git.3pm: perl/Git.pm
|
perl/build/man/man3/Git.3pm: perl/Git.pm
|
||||||
$(QUIET_GEN)mkdir -p $(dir $@) && \
|
$(call mkdir_p_parent_template)
|
||||||
pod2man $< $@
|
$(QUIET_GEN)pod2man $< $@
|
||||||
|
|
||||||
FIND_SOURCE_FILES = ( \
|
|
||||||
git ls-files \
|
|
||||||
'*.[hcS]' \
|
|
||||||
'*.sh' \
|
|
||||||
':!*[tp][0-9][0-9][0-9][0-9]*' \
|
|
||||||
':!contrib' \
|
|
||||||
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 build -type d -prune \) \
|
|
||||||
-o \( -name 'trash*' -type d -prune \) \
|
|
||||||
-o \( -name '*.[hcS]' -type f -print \) \
|
|
||||||
-o \( -name '*.sh' -type f -print \) \
|
|
||||||
| sed -e 's|^\./||' \
|
|
||||||
)
|
|
||||||
|
|
||||||
FOUND_SOURCE_FILES = $(shell $(FIND_SOURCE_FILES))
|
|
||||||
|
|
||||||
$(ETAGS_TARGET): $(FOUND_SOURCE_FILES)
|
$(ETAGS_TARGET): $(FOUND_SOURCE_FILES)
|
||||||
$(QUIET_GEN)$(RM) $@+ && \
|
$(QUIET_GEN)$(RM) $@+ && \
|
||||||
@ -2948,7 +2905,7 @@ test_bindir_programs := $(patsubst %,bin-wrappers/%,$(BINDIR_PROGRAMS_NEED_X) $(
|
|||||||
all:: $(TEST_PROGRAMS) $(test_bindir_programs)
|
all:: $(TEST_PROGRAMS) $(test_bindir_programs)
|
||||||
|
|
||||||
bin-wrappers/%: wrap-for-bin.sh
|
bin-wrappers/%: wrap-for-bin.sh
|
||||||
@mkdir -p bin-wrappers
|
$(call mkdir_p_parent_template)
|
||||||
$(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
|
$(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
|
||||||
-e 's|@@BUILD_DIR@@|$(shell pwd)|' \
|
-e 's|@@BUILD_DIR@@|$(shell pwd)|' \
|
||||||
-e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%$(X),$(@F))$(patsubst git%,$(X),$(filter $(@F),$(BINDIR_PROGRAMS_NEED_X)))|' < $< > $@ && \
|
-e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%$(X),$(@F))$(patsubst git%,$(X),$(filter $(@F),$(BINDIR_PROGRAMS_NEED_X)))|' < $< > $@ && \
|
||||||
@ -3025,9 +2982,6 @@ check: $(GENERATED_H)
|
|||||||
exit 1; \
|
exit 1; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
FOUND_C_SOURCES = $(filter %.c,$(FOUND_SOURCE_FILES))
|
|
||||||
COCCI_SOURCES = $(filter-out $(THIRD_PARTY_SOURCES),$(FOUND_C_SOURCES))
|
|
||||||
|
|
||||||
%.cocci.patch: %.cocci $(COCCI_SOURCES)
|
%.cocci.patch: %.cocci $(COCCI_SOURCES)
|
||||||
$(QUIET_SPATCH) \
|
$(QUIET_SPATCH) \
|
||||||
if test $(SPATCH_BATCH_SIZE) = 0; then \
|
if test $(SPATCH_BATCH_SIZE) = 0; then \
|
||||||
|
@ -727,7 +727,6 @@ vcxproj:
|
|||||||
git diff-index --cached --quiet HEAD --
|
git diff-index --cached --quiet HEAD --
|
||||||
|
|
||||||
# Make .vcxproj files and add them
|
# Make .vcxproj files and add them
|
||||||
unset QUIET_GEN QUIET_BUILT_IN; \
|
|
||||||
perl contrib/buildsystems/generate -g Vcxproj
|
perl contrib/buildsystems/generate -g Vcxproj
|
||||||
git add -f git.sln {*,*/lib,t/helper/*}/*.vcxproj
|
git add -f git.sln {*,*/lib,t/helper/*}/*.vcxproj
|
||||||
|
|
||||||
|
@ -1,18 +1,8 @@
|
|||||||
QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
|
# The default target of this Makefile is...
|
||||||
QUIET_SUBDIR1 =
|
all::
|
||||||
|
|
||||||
ifneq ($(findstring s,$(MAKEFLAGS)),s)
|
# Import tree-wide shared Makefile behavior and libraries
|
||||||
ifndef V
|
include ../../shared.mak
|
||||||
QUIET_GEN = @echo ' ' GEN $@;
|
|
||||||
QUIET_SUBDIR0 = +@subdir=
|
|
||||||
QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
|
|
||||||
$(MAKE) $(PRINT_DIR) -C $$subdir
|
|
||||||
else
|
|
||||||
export V
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
all:
|
|
||||||
|
|
||||||
include ../../config.mak.uname
|
include ../../config.mak.uname
|
||||||
-include ../../config.mak.autogen
|
-include ../../config.mak.autogen
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
# Import tree-wide shared Makefile behavior and libraries
|
||||||
|
include ../../../shared.mak
|
||||||
|
|
||||||
# Run scalar tests
|
# Run scalar tests
|
||||||
#
|
#
|
||||||
# Copyright (c) 2005,2021 Junio C Hamano, Johannes Schindelin
|
# Copyright (c) 2005,2021 Junio C Hamano, Johannes Schindelin
|
||||||
|
103
shared.mak
Normal file
103
shared.mak
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
### Remove GNU make implicit rules
|
||||||
|
|
||||||
|
## This speeds things up since we don't need to look for and stat() a
|
||||||
|
## "foo.c,v" every time a rule referring to "foo.c" is in play. See
|
||||||
|
## "make -p -f/dev/null | grep ^%::'".
|
||||||
|
%:: %,v
|
||||||
|
%:: RCS/%,v
|
||||||
|
%:: RCS/%
|
||||||
|
%:: s.%
|
||||||
|
%:: SCCS/s.%
|
||||||
|
|
||||||
|
## Likewise delete default $(SUFFIXES). See:
|
||||||
|
##
|
||||||
|
## info make --index-search=.SUFFIXES
|
||||||
|
.SUFFIXES:
|
||||||
|
|
||||||
|
### Flags affecting all rules
|
||||||
|
|
||||||
|
# A GNU make extension since gmake 3.72 (released in late 1994) to
|
||||||
|
# remove the target of rules if commands in those rules fail. The
|
||||||
|
# default is to only do that if make itself receives a signal. Affects
|
||||||
|
# all targets, see:
|
||||||
|
#
|
||||||
|
# info make --index-search=.DELETE_ON_ERROR
|
||||||
|
.DELETE_ON_ERROR:
|
||||||
|
|
||||||
|
### Global variables
|
||||||
|
|
||||||
|
## comma, empty, space: handy variables as these tokens are either
|
||||||
|
## special or can be hard to spot among other Makefile syntax.
|
||||||
|
comma := ,
|
||||||
|
empty :=
|
||||||
|
space := $(empty) $(empty)
|
||||||
|
|
||||||
|
### Quieting
|
||||||
|
## common
|
||||||
|
QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
|
||||||
|
QUIET_SUBDIR1 =
|
||||||
|
|
||||||
|
ifneq ($(findstring w,$(MAKEFLAGS)),w)
|
||||||
|
PRINT_DIR = --no-print-directory
|
||||||
|
else # "make -w"
|
||||||
|
NO_SUBDIR = :
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(findstring s,$(MAKEFLAGS)),s)
|
||||||
|
ifndef V
|
||||||
|
## common
|
||||||
|
QUIET_SUBDIR0 = +@subdir=
|
||||||
|
QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
|
||||||
|
$(MAKE) $(PRINT_DIR) -C $$subdir
|
||||||
|
|
||||||
|
QUIET = @
|
||||||
|
QUIET_GEN = @echo ' ' GEN $@;
|
||||||
|
|
||||||
|
QUIET_MKDIR_P_PARENT = @echo $(wspfx_SQ) MKDIR -p $(@D);
|
||||||
|
|
||||||
|
## Used in "Makefile"
|
||||||
|
QUIET_CC = @echo ' ' CC $@;
|
||||||
|
QUIET_AR = @echo ' ' AR $@;
|
||||||
|
QUIET_LINK = @echo ' ' LINK $@;
|
||||||
|
QUIET_BUILT_IN = @echo ' ' BUILTIN $@;
|
||||||
|
QUIET_LNCP = @echo ' ' LN/CP $@;
|
||||||
|
QUIET_XGETTEXT = @echo ' ' XGETTEXT $@;
|
||||||
|
QUIET_MSGFMT = @echo ' ' MSGFMT $@;
|
||||||
|
QUIET_GCOV = @echo ' ' GCOV $@;
|
||||||
|
QUIET_SP = @echo ' ' SP $<;
|
||||||
|
QUIET_HDR = @echo ' ' HDR $(<:hcc=h);
|
||||||
|
QUIET_RC = @echo ' ' RC $@;
|
||||||
|
QUIET_SPATCH = @echo ' ' SPATCH $<;
|
||||||
|
|
||||||
|
## Used in "Documentation/Makefile"
|
||||||
|
QUIET_ASCIIDOC = @echo ' ' ASCIIDOC $@;
|
||||||
|
QUIET_XMLTO = @echo ' ' XMLTO $@;
|
||||||
|
QUIET_DB2TEXI = @echo ' ' DB2TEXI $@;
|
||||||
|
QUIET_MAKEINFO = @echo ' ' MAKEINFO $@;
|
||||||
|
QUIET_DBLATEX = @echo ' ' DBLATEX $@;
|
||||||
|
QUIET_XSLTPROC = @echo ' ' XSLTPROC $@;
|
||||||
|
QUIET_GEN = @echo ' ' GEN $@;
|
||||||
|
QUIET_STDERR = 2> /dev/null
|
||||||
|
|
||||||
|
QUIET_LINT_GITLINK = @echo ' ' LINT GITLINK $<;
|
||||||
|
QUIET_LINT_MANSEC = @echo ' ' LINT MAN SEC $<;
|
||||||
|
QUIET_LINT_MANEND = @echo ' ' LINT MAN END $<;
|
||||||
|
|
||||||
|
export V
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
### Templates
|
||||||
|
|
||||||
|
## mkdir_p_parent: lazily "mkdir -p" the path needed for a $@
|
||||||
|
## file. Uses $(wildcard) to avoid the "mkdir -p" if it's not
|
||||||
|
## needed.
|
||||||
|
##
|
||||||
|
## Is racy, but in a good way; we might redundantly (and safely)
|
||||||
|
## "mkdir -p" when running in parallel, but won't need to exhaustively create
|
||||||
|
## individual rules for "a" -> "prefix" -> "dir" -> "file" if given a
|
||||||
|
## "a/prefix/dir/file". This can instead be inserted at the start of
|
||||||
|
## the "a/prefix/dir/file" rule.
|
||||||
|
define mkdir_p_parent_template
|
||||||
|
$(if $(wildcard $(@D)),,$(QUIET_MKDIR_P_PARENT)$(shell mkdir -p $(@D)))
|
||||||
|
endef
|
@ -1,3 +1,6 @@
|
|||||||
|
# Import tree-wide shared Makefile behavior and libraries
|
||||||
|
include ../shared.mak
|
||||||
|
|
||||||
# Run tests
|
# Run tests
|
||||||
#
|
#
|
||||||
# Copyright (c) 2005 Junio C Hamano
|
# Copyright (c) 2005 Junio C Hamano
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
# Import tree-wide shared Makefile behavior and libraries
|
||||||
|
include ../../shared.mak
|
||||||
|
|
||||||
-include ../../config.mak
|
-include ../../config.mak
|
||||||
export GIT_TEST_OPTIONS
|
export GIT_TEST_OPTIONS
|
||||||
|
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
# Import tree-wide shared Makefile behavior and libraries
|
||||||
|
include ../../shared.mak
|
||||||
|
|
||||||
-include ../../config.mak
|
-include ../../config.mak
|
||||||
export GIT_TEST_OPTIONS
|
export GIT_TEST_OPTIONS
|
||||||
|
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
|
# Import tree-wide shared Makefile behavior and libraries
|
||||||
|
include ../shared.mak
|
||||||
|
|
||||||
# make and install sample templates
|
# make and install sample templates
|
||||||
|
|
||||||
ifndef V
|
|
||||||
QUIET = @
|
|
||||||
endif
|
|
||||||
|
|
||||||
INSTALL ?= install
|
INSTALL ?= install
|
||||||
TAR ?= tar
|
TAR ?= tar
|
||||||
RM ?= rm -f
|
RM ?= rm -f
|
||||||
|
Loading…
Reference in New Issue
Block a user