Makefile.am 1.97 KB
Newer Older
Murray Cumming's avatar
Murray Cumming committed
1
# pydoc can write docs for all modules in a directory (or a module name),
2 3
# but doesn't like being given a path to any actual file.

4 5 6 7 8

# Using pydoc instead:
# html:
#	pydoc -w $(top_builddir)/glom/python_embed/python_module/.libs/
#	mkdir html
Murray Cumming's avatar
1.33.1  
Murray Cumming committed
9
#	mv glom_1_34.html html/index.html
10

11 12 13 14
book_name = pyglom_$(GLOM_ABI_VERSION_UNDERLINED)

# The name of the sub-directory where the generated documentation
# will be placed.
15 16 17 18
html_outdir = html

# A list of wildcard patterns matching the documentation files to distribute.
htmlref_patterns = *.css *.gif *.html *.png *.js *.inv *.txt
19 20 21 22 23

# Installation directories.
libdocdir    = $(datarootdir)/doc/$(book_name)
referencedir = $(libdocdir)/reference
htmlrefdir   = $(referencedir)/html
24
htmlref_staticdir = $(htmlrefdir)/_static
25
htmlref_sourcesdir = $(htmlrefdir)/_sources
26

27 28 29 30 31 32
# Function: $(call vpath_listall,PATTERN ...)
# Get all filenames which match a PATTERN from the list.  Look for files
# relative to either the current directory or $(srcdir).  Strip $(srcdir)/
# again before returning and remove any duplicates.
vpath_srclist = $(patsubst $(srcdir)/%,%,$(wildcard $(addprefix $(srcdir)/,$(1))))
vpath_listall = $(sort $(wildcard $(1)) $(if $(srcdir:.=),$(vpath_srclist)))
33

34 35
dist_htmlref_DATA = $(call vpath_listall,$(addprefix $(html_outdir)/,$(htmlref_patterns)))
dist_htmlref_static_DATA = $(call vpath_listall,$(addprefix $(html_outdir)/_static/,$(htmlref_patterns)))
36
dist_htmlref_sources_DATA = $(call vpath_listall,$(addprefix $(html_outdir)/_sources/,$(htmlref_patterns)))
37

38
MAINTAINERCLEANFILES = $(html_outdir)/_sources/* $(html_outdir)/_static/* $(html_outdir)/*
39 40

html/index.html:
41 42
	-$(AM_V_at)rm -fr $(html_outdir)
	$(AM_V_GEN)$(SPHINX_BUILD) -b html . $(html_outdir)
43

44
# Explicitly depend on the files to be distributed or installed.
45 46 47 48 49
if ENABLE_DOCUMENTATION
all-local: html/index.html
else
all-local:
endif
50 51 52 53

# Instruct GNU make to delete the targets of a rule after it failed, in
# order to avoid the complication of handling that situation manually.
.DELETE_ON_ERROR: