Skip to content

Commit

Permalink
Add docs to build system; requires Sphinx to build
Browse files Browse the repository at this point in the history
  • Loading branch information
flicker581 committed Dec 23, 2013
1 parent 5d0fb11 commit 2e6d6f2
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
SUBDIRS = src
if ENABLE_DOCS
SUBDIRS += doc
endif

EXTRA_DIST = rulebases
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = lognorm.pc

Expand Down
13 changes: 12 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,21 @@ if test "$enable_debug" = "no"; then
AC_DEFINE(NDEBUG, 1, [Defined if debug mode is disabled.])
fi


# docs (html) build settings
AC_ARG_ENABLE(docs,
[AS_HELP_STRING([--disable-docs],[Disable building HTML docs (requires Sphinx)])],
[enable_docs="no"],
[enable_docs="yes"]
)
AC_CHECK_PROGS([SPHINXBUILD], [sphinx-build sphinx-build3 sphinx-build2], [no])
AS_IF([test "$enable_docs" = "yes" -a "x$SPHINXBUILD" = xno],
AC_MSG_ERROR(sphinx-build is required to build documentation, install it or try --disable-docs)
)
AM_CONDITIONAL([ENABLE_DOCS], [test "$enable_docs" = yes])

AC_CONFIG_FILES([Makefile \
lognorm.pc \
doc/Makefile \
src/Makefile])
AC_OUTPUT
AC_CONFIG_MACRO_DIR([m4])
Expand Down
1 change: 1 addition & 0 deletions doc/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
_build
Makefile.in
51 changes: 51 additions & 0 deletions doc/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
EXTRA_DIST = _static _templates conf.py \
index.rst introduction.rst installation.rst \
configuration.rst sample_rulebase.rst internals.rst \
lognormalizer.rst license.rst graph.png

htmldir = $(docdir)
built_html = _build/html

#html_DATA = $(built_html)/index.html

# Makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
#SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build

# Internal variables.
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(SPHINXOPTS) .

.PHONY: clean-local html-local man-local all-local dist-hook install-data-hook

dist-hook:
find $(distdir)/ -name .gitignore | xargs rm -f

clean-local:
-rm -rf $(BUILDDIR)/*

html-local:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

man-local:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."

all-local: html-local

install-data-hook:
find $(built_html) -type f -printf "%P\n" | \
while read file; do \
echo " $(INSTALL_DATA) -D $(built_html)/$$file '$(DESTDIR)$(htmldir)/$$file'"; \
$(INSTALL_DATA) -D $(built_html)/$$file "$(DESTDIR)$(htmldir)/$$file" || exit $$?; \
done

uninstall-local:
-rm -rf "$(DESTDIR)$(htmldir)"
File renamed without changes.
Empty file added doc/_static/.gitignore
Empty file.
Empty file added doc/_templates/.gitignore
Empty file.
8 changes: 8 additions & 0 deletions src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.o
*.lo
*.la
Makefile
Makefile.in
.deps
.libs
lognormalizer

0 comments on commit 2e6d6f2

Please sign in to comment.