aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/subtree
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/subtree')
-rw-r--r--contrib/subtree/.gitignore2
-rw-r--r--contrib/subtree/Makefile23
-rw-r--r--contrib/subtree/meson.build71
-rw-r--r--contrib/subtree/t/Makefile5
4 files changed, 92 insertions, 9 deletions
diff --git a/contrib/subtree/.gitignore b/contrib/subtree/.gitignore
index 0b9381abca..6deaf177c7 100644
--- a/contrib/subtree/.gitignore
+++ b/contrib/subtree/.gitignore
@@ -1,4 +1,6 @@
*~
+asciidoc.conf
+asciidoctor-extensions.rb
git-subtree
git-subtree.1
git-subtree.html
diff --git a/contrib/subtree/Makefile b/contrib/subtree/Makefile
index 6fa7496bfd..8fe0bfd401 100644
--- a/contrib/subtree/Makefile
+++ b/contrib/subtree/Makefile
@@ -1,6 +1,7 @@
# The default target of this Makefile is...
all::
+-include ../../shared.mak
-include ../../config.mak.autogen
-include ../../config.mak
@@ -13,17 +14,16 @@ htmldir ?= $(prefix)/share/doc/git-doc
../../GIT-VERSION-FILE: FORCE
$(MAKE) -C ../../ GIT-VERSION-FILE
--include ../../GIT-VERSION-FILE
-
# this should be set to a 'standard' bsd-type install program
INSTALL ?= install
RM ?= rm -f
ASCIIDOC = asciidoc
-ASCIIDOC_CONF = -f ../../Documentation/asciidoc.conf
+ASCIIDOC_CONF = -f asciidoc.conf
ASCIIDOC_HTML = xhtml11
ASCIIDOC_DOCBOOK = docbook
ASCIIDOC_EXTRA =
+ASCIIDOC_DEPS = asciidoc.conf
XMLTO = xmlto
XMLTO_EXTRA =
@@ -32,8 +32,9 @@ ASCIIDOC = asciidoctor
ASCIIDOC_CONF =
ASCIIDOC_HTML = xhtml5
ASCIIDOC_DOCBOOK = docbook
-ASCIIDOC_EXTRA += -I../../Documentation -rasciidoctor-extensions
+ASCIIDOC_EXTRA += -I. -rasciidoctor-extensions
ASCIIDOC_EXTRA += -alitdd='&\#x2d;&\#x2d;'
+ASCIIDOC_DEPS = asciidoctor-extensions.rb
XMLTO_EXTRA += --skip-validation
endif
@@ -82,13 +83,13 @@ install-html: $(GIT_SUBTREE_HTML)
$(GIT_SUBTREE_DOC): $(GIT_SUBTREE_XML)
$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $^
-$(GIT_SUBTREE_XML): $(GIT_SUBTREE_TXT)
+$(GIT_SUBTREE_XML): $(GIT_SUBTREE_TXT) $(ASCIIDOC_DEPS)
$(ASCIIDOC) -b $(ASCIIDOC_DOCBOOK) -d manpage $(ASCIIDOC_CONF) \
- -agit_version=$(GIT_VERSION) $(ASCIIDOC_EXTRA) $^
+ $(ASCIIDOC_EXTRA) $<
-$(GIT_SUBTREE_HTML): $(GIT_SUBTREE_TXT)
+$(GIT_SUBTREE_HTML): $(GIT_SUBTREE_TXT) $(ASCIIDOC_DEPS)
$(ASCIIDOC) -b $(ASCIIDOC_HTML) -d manpage $(ASCIIDOC_CONF) \
- -agit_version=$(GIT_VERSION) $(ASCIIDOC_EXTRA) $^
+ $(ASCIIDOC_EXTRA) $<
$(GIT_SUBTREE_TEST): $(GIT_SUBTREE)
cp $< $@
@@ -98,6 +99,12 @@ test: $(GIT_SUBTREE_TEST)
clean:
$(RM) $(GIT_SUBTREE)
+ $(RM) asciidoc.conf asciidoctor-extensions.rb
$(RM) *.xml *.html *.1
+asciidoc.conf: ../../Documentation/asciidoc.conf.in ../../GIT-VERSION-FILE
+ $(QUIET_GEN)$(call version_gen,"$(shell pwd)/../..",$<,$@)
+asciidoctor-extensions.rb: ../../Documentation/asciidoctor-extensions.rb.in ../../GIT-VERSION-FILE
+ $(QUIET_GEN)$(call version_gen,"$(shell pwd)/../..",$<,$@)
+
.PHONY: FORCE
diff --git a/contrib/subtree/meson.build b/contrib/subtree/meson.build
new file mode 100644
index 0000000000..a752a188df
--- /dev/null
+++ b/contrib/subtree/meson.build
@@ -0,0 +1,71 @@
+git_subtree = custom_target(
+ input: 'git-subtree.sh',
+ output: 'git-subtree',
+ command: [
+ shell,
+ meson.project_source_root() / 'generate-script.sh',
+ '@INPUT@',
+ '@OUTPUT@',
+ meson.project_build_root() / 'GIT-BUILD-OPTIONS',
+ ],
+ install: true,
+ install_dir: get_option('libexecdir') / 'git-core',
+)
+
+subtree_test_environment = test_environment
+subtree_test_environment.prepend('PATH', meson.current_build_dir())
+
+test('t7900-subtree', shell,
+ args: [ 't7900-subtree.sh' ],
+ env: subtree_test_environment,
+ workdir: meson.current_source_dir() / 't',
+ depends: test_dependencies + bin_wrappers + [ git_subtree ],
+ timeout: 0,
+)
+
+if get_option('docs').contains('man')
+ subtree_xml = custom_target(
+ command: asciidoc_common_options + [
+ '--backend=' + asciidoc_docbook,
+ '--doctype=manpage',
+ '--out-file=@OUTPUT@',
+ '@INPUT@',
+ ],
+ depends: documentation_deps,
+ input: 'git-subtree.txt',
+ output: 'git-subtree.xml',
+ )
+
+ custom_target(
+ command: [
+ xmlto,
+ '-m', '@INPUT@',
+ 'man',
+ subtree_xml,
+ '-o',
+ meson.current_build_dir(),
+ ] + xmlto_extra,
+ input: [
+ '../../Documentation/manpage-normal.xsl',
+ ],
+ output: 'git-subtree.1',
+ install: true,
+ install_dir: get_option('mandir') / 'man1',
+ )
+endif
+
+if get_option('docs').contains('html')
+ custom_target(
+ command: asciidoc_common_options + [
+ '--backend=' + asciidoc_html,
+ '--doctype=manpage',
+ '--out-file=@OUTPUT@',
+ '@INPUT@',
+ ],
+ depends: documentation_deps,
+ input: 'git-subtree.txt',
+ output: 'git-subtree.html',
+ install: true,
+ install_dir: get_option('datadir') / 'doc/git-doc',
+ )
+endif
diff --git a/contrib/subtree/t/Makefile b/contrib/subtree/t/Makefile
index 093399c788..2a85f5ee84 100644
--- a/contrib/subtree/t/Makefile
+++ b/contrib/subtree/t/Makefile
@@ -3,6 +3,9 @@
# Copyright (c) 2005 Junio C Hamano
#
+# The default target of this Makefile is...
+all::
+
-include ../../../config.mak.autogen
-include ../../../config.mak
@@ -31,7 +34,7 @@ TSVN = $(sort $(wildcard t91[0-9][0-9]-*.sh))
TGITWEB = $(sort $(wildcard t95[0-9][0-9]-*.sh))
THELPERS = $(sort $(filter-out $(T),$(wildcard *.sh)))
-all: $(DEFAULT_TEST_TARGET)
+all:: $(DEFAULT_TEST_TARGET)
test: pre-clean $(TEST_LINT)
$(MAKE) aggregate-results-and-cleanup