Thread (7 messages) flat view 7 messages, 2 authors, 2016-06-15
DORMANTno replies

[PATCH v2 1/2] Allow generating a non-default set of documentation

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:55:39
Subsystem: documentation, kernel build + files below scripts/ (unless maintained elsewhere), the rest · Maintainers: Jonathan Corbet, Nathan Chancellor, Nicolas Schier, Linus Torvalds

By default, "make doc" generates the manpages and htmldocs in the
Documentation directory, but you may want to change this depending
on the target environment, e.g. to include 'pdf'.  Introduce a new
Makefile variable DEFAULT_DOC_TARGET to allow customizing this.

The primary motivation is to let us check documentation patches with

    $ DEFAULT_DOC_TARGET=git-push.1 make doc

but it is not so far-fetched to imagine that Windows users may want to
omit manpages with

    $ DEFAULT_DOC_TARGET=html make doc

or somesuch.  It won't be useful without additional support to tweak
the format installed by default via DEFAULT_DOC_INSTALL_TARGET, though.

Signed-off-by: Junio C Hamano <redacted>
---
 Documentation/Makefile |  7 ++++++-
 Makefile               | 10 +++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 063fa69..0f8fdf8 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -1,3 +1,6 @@
+# The default target of this Makefile is...
+all::
+
 MAN1_TXT= \
 	$(filter-out $(addsuffix .txt, $(ARTICLES) $(SP_ARTICLES)), \
 		$(wildcard git-*.txt)) \
@@ -65,6 +68,8 @@ endif
 -include ../config.mak.autogen
 -include ../config.mak
 
+DEFAULT_DOC_TARGET ?= html man
+
 #
 # For docbook-xsl ...
 #	-1.68.1,	no extra settings are needed?
@@ -151,7 +156,7 @@ ifndef V
 endif
 endif
 
-all: html man
+all:: $(DEFAULT_DOC_TARGET)
 
 html: $(DOC_HTML)
 
diff --git a/Makefile b/Makefile
index 6b0c961..71655a7 100644
--- a/Makefile
+++ b/Makefile
@@ -281,6 +281,12 @@ all::
 #   DEFAULT_EDITOR='$GIT_FALLBACK_EDITOR',
 #   DEFAULT_EDITOR='"C:\Program Files\Vim\gvim.exe" --nofork'
 #
+# You can define DEFAULT_DOC_TARGET to change it from the built-in
+# default of generating manpages and htmldocs.  e.g.
+#
+#   DEFAULT_DOC_TARGET='man html info pdf'
+#   DEFAULT_DOC_TARGET='html'
+#
 # Define COMPUTE_HEADER_DEPENDENCIES to "yes" if you want dependencies on
 # header files to be automatically computed, to avoid rebuilding objects when
 # an unrelated header file changes.  Define it to "no" to use the hard-coded
@@ -1421,6 +1427,8 @@ ifneq (,$(SOCKLEN_T))
 	BASIC_CFLAGS += -Dsocklen_t=$(SOCKLEN_T)
 endif
 
+DEFAULT_DOC_TARGET ?= html man
+
 ifeq ($(uname_S),Darwin)
 	ifndef NO_FINK
 		ifeq ($(shell test -d /sw/lib && echo y),y)
@@ -2371,7 +2379,7 @@ $(XDIFF_LIB): $(XDIFF_OBJS)
 $(VCSSVN_LIB): $(VCSSVN_OBJS)
 	$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(VCSSVN_OBJS)
 
-export DEFAULT_EDITOR DEFAULT_PAGER
+export DEFAULT_EDITOR DEFAULT_PAGER DEFAULT_DOC_TARGET
 
 doc:
 	$(MAKE) -C Documentation all
-- 
1.8.1.293.g4a210a9
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help