Makefile.am 3.98 KB
Newer Older
1 2
GUIDE=ocarina

yoogx's avatar
yoogx committed
3 4
man_MANS = ocarina-config.1 ocarina.1

5 6 7 8 9
GUIDE_RSTFILES = $(srcdir)/about.rst $(srcdir)/gfdl.rst			\
	$(srcdir)/introduction.rst $(srcdir)/annexes.rst index.rst	\
	$(srcdir)/python.rst $(srcdir)/editors.rst			\
	$(srcdir)/installation.rst $(srcdir)/usage.rst

yoogx's avatar
yoogx committed
10 11
EXTRA_DIST= $(srcdir)/CODING_GUIDELINES $(srcdir)/CONTRIBUTING		\
	$(srcdir)/PROBLEM-REPORT-FORM $(GUIDE_TEXIFILES) $(ALL_IMAGES)	\
12 13
	$(man_MANS) $(srcdir)/ocarina-config.html			\
	$(srcdir)/ocarina_man.html
yoogx's avatar
yoogx committed
14

15
all-local: $(GUIDE).html $(GUIDE).pdf
16

17 18
$(GUIDE).html: $(GUIDE_RSTFILES)
	make  html
19

20 21
$(GUIDE).pdf: $(IMAGES) $(GUIDE_RSTFILES)
	make  latexpdf
22 23

clean-local:
24 25
	rm -f *~
	-rm -rf $(BUILDDIR)/*
26 27 28 29 30 31 32 33 34 35 36 37 38 39

distclean-local:
	rm -f $(GEN_TEXIFILES)
	rm -rf *-stamp
	rm -f *.sed
	rm -rf $(GUIDE).html $(GUIDE).pdf

# In VPATH builds, make difference between the case the doc is built
# by the user and the case it is provided to him by the package.

dist-hook: all
	if [ -r $(GUIDE).pdf ]; then \
	  cp -p -r $(GUIDE).html $(GUIDE).pdf $(distdir); \
	  cp -p $(SED_FILES) $(distdir); \
40 41
	fi
	if [ -r $(srcdir)/$(GUIDE).pdf ]; then \
42 43 44 45 46 47 48 49 50 51 52
	  cp -r $(srcdir)/$(GUIDE).html $(srcdir)/$(GUIDE).pdf $(distdir); \
	  cp -p ${addprefix $(srcdir)/, $(SED_FILES)} $(distdir); \
	fi
	touch $(distdir)/sed-stamp
	touch $(distdir)/ada-stamp
	touch $(distdir)/adb-stamp
	touch $(distdir)/ads-stamp
	touch $(distdir)/aadl-stamp

install-data-local: all
	$(INSTALL) -d $(DESTDIR)$(datadir)/doc/ocarina
53 54
	if [ -r $(builddir)/_build/latex/$(GUIDE).pdf ]; then \
	  $(INSTALL_DATA) $(builddir)/_build/latex/$(GUIDE).pdf $(DESTDIR)$(datadir)/doc/ocarina; \
55
	  $(INSTALL) -d $(DESTDIR)$(datadir)/doc/ocarina/$(GUIDE).html; \
56
	  $(CP) -r $(builddir)/_build/html/* $(DESTDIR)$(datadir)/doc/ocarina/$(GUIDE).html; \
57 58
	fi
	$(INSTALL_DATA)	$(srcdir)/PROBLEM-REPORT-FORM $(DESTDIR)$(datadir)/doc/ocarina
59 60
	$(INSTALL_DATA)	$(srcdir)/ocarina-config.html $(DESTDIR)$(datadir)/doc/ocarina
	$(INSTALL_DATA)	$(srcdir)/ocarina_man.html $(DESTDIR)$(datadir)/doc/ocarina
yoogx's avatar
yoogx committed
61
	$(INSTALL_DATA)	$(srcdir)/ocarina.css $(DESTDIR)$(datadir)/doc/ocarina
62 63 64 65

uninstall-local:
	rm -rf $(DESTDIR)$(datadir)/doc/ocarina

yoogx's avatar
yoogx committed
66 67

###############################################################################
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
# SPHINX rules

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

# Internal variables.
PAPEROPT_a4     = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS   = -c $(srcdir) -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(srcdir)
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext

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

latexpdf:
	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
	@echo "Running LaTeX files through pdflatex..."
	$(MAKE) -C $(BUILDDIR)/latex all-pdf
	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
yoogx's avatar
yoogx committed
95

96 97
###############################################################################
# Building manpages
98 99

build_man: $(top_srcdir)/ocarina-config.in
yoogx's avatar
yoogx committed
100 101 102 103
	chmod 755 $(top_builddir)/ocarina-config
	help2man --no-discard-stderr $(top_builddir)/ocarina-config >  $(top_builddir)/doc/ocarina-config.1
	echo ".HEAD \"<link rel=\"\"stylesheet\"\" type=\"\"text/css\"\" href=\"\"ocarina.css\"\" >\"" >> $(top_builddir)/doc/ocarina-config.1
	groff -man -Thtml $(top_builddir)/doc/ocarina-config.1 > $(top_builddir)/doc/ocarina-config.html
yoogx's avatar
yoogx committed
104
	-help2man --no-discard-stderr --help-option="-help" --version-option="-V" `which ocarina` >  $(top_builddir)/doc/ocarina.1
yoogx's avatar
yoogx committed
105 106
	echo ".HEAD \"<link rel=\"\"stylesheet\"\" type=\"\"text/css\"\" href=\"\"ocarina.css\"\" >\"" >> $(top_builddir)/doc/ocarina.1
	groff -man -Thtml $(top_builddir)/doc/ocarina.1 > $(top_builddir)/doc/ocarina_man.html