git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 3, 2013, 19:05 UTC
Message-ID
<1357239920-2201-2-git-send-email-gitster@pobox.com>
In-Reply-To
<1357239920-2201-1-git-send-email-gitster@pobox.com>

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 <gitster@pobox.com>
---
 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
Previous: Junio C HamanoNext: Junio C Hamano
Message 2 of 9 in “DEFAULT_DOC_TARGET”
  1. 0/2 DEFAULT_DOC_TARGETJunio C Hamano, Jan 3, 2013
  2. 1/2 Allow generating a non-default set of documentationJunio C Hamano, Jan 3, 2013
  3. 2/2 Allow installing a non-default set of documentationJunio C Hamano, Jan 3, 2013
  4. Jeff KingJan 3, 2013
  5. Jeff KingJan 3, 2013
  6. Jeff KingJan 3, 2013
  7. Jeff KingJan 3, 2013
  8. Junio C HamanoJan 3, 2013
  9. Jeff KingJan 3, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.