Makefile.am 4.01 KB
Newer Older
yoogx's avatar
yoogx committed
1
2
SUBDIRS=real

3
4
GUIDE=ocarina

yoogx's avatar
yoogx committed
5
6
man_MANS = ocarina-config.1 ocarina.1

7
8
9
10
11
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
12
EXTRA_DIST= $(GUIDE_TEXIFILES)	\
yoogx's avatar
yoogx committed
13
	$(ALL_IMAGES) $(man_MANS) $(srcdir)/ocarina-config.html	\
yoogx's avatar
yoogx committed
14
	 $(srcdir)/ocarina_man.html $(srcdir)/ocarina.css
yoogx's avatar
yoogx committed
15

yoogx's avatar
yoogx committed
16
docs: $(GUIDE).html $(GUIDE).pdf
yoogx's avatar
yoogx committed
17

yoogx's avatar
yoogx committed
18
all-local: @DOC_TARGETS@
19

20
21
$(GUIDE).html: $(GUIDE_RSTFILES)
	make  html
22

23
24
$(GUIDE).pdf: $(IMAGES) $(GUIDE_RSTFILES)
	make  latexpdf
25
26

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

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); \
43
44
	fi
	if [ -r $(srcdir)/$(GUIDE).pdf ]; then \
45
46
47
48
49
50
51
52
53
54
55
	  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
56
57
	if [ -r $(builddir)/_build/latex/$(GUIDE).pdf ]; then \
	  $(INSTALL_DATA) $(builddir)/_build/latex/$(GUIDE).pdf $(DESTDIR)$(datadir)/doc/ocarina; \
58
	  $(INSTALL) -d $(DESTDIR)$(datadir)/doc/ocarina/$(GUIDE).html; \
59
	  $(CP) -r $(builddir)/_build/html/* $(DESTDIR)$(datadir)/doc/ocarina/$(GUIDE).html; \
60
	fi
61
62
	$(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
63
	$(INSTALL_DATA)	$(srcdir)/ocarina.css $(DESTDIR)$(datadir)/doc/ocarina
64
65
66
67

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

yoogx's avatar
yoogx committed
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
95
96
# 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
97

98
99
###############################################################################
# Building manpages
100
101

build_man: $(top_srcdir)/ocarina-config.in
yoogx's avatar
yoogx committed
102
	chmod 755 $(top_builddir)/ocarina-config
yoogx's avatar
yoogx committed
103
104
105
106
107
108
	help2man --no-discard-stderr $(top_builddir)/ocarina-config >  $(top_srcdir)/doc/ocarina-config.1
	echo ".HEAD \"<link rel=\"\"stylesheet\"\" type=\"\"text/css\"\" href=\"\"ocarina.css\"\" >\"" >> $(top_srcdir)/doc/ocarina-config.1
	groff -man -Thtml $(top_srcdir)/doc/ocarina-config.1 > $(top_srcdir)/doc/ocarina-config.html
	-help2man --no-discard-stderr `which ocarina` >  $(top_srcdir)/doc/ocarina.1
	echo ".HEAD \"<link rel=\"\"stylesheet\"\" type=\"\"text/css\"\" href=\"\"ocarina.css\"\" >\"" >> $(top_srcdir)/doc/ocarina.1
	groff -man -Thtml $(top_srcdir)/doc/ocarina.1 > $(top_srcdir)/doc/ocarina_man.html
109
110
111
	groff -man -Thtml $(top_srcdir)/doc/ocarina.1 > $(top_srcdir)/doc/ocarina_man.html
	ocarina -h >  $(top_srcdir)/doc/ocarina_man.txt
	-ocarina-config -h 2>  $(top_srcdir)/doc/ocarina_config.txt