aboutsummaryrefslogtreecommitdiff
path: root/doc/api/python/Makefile.am
blob: 65723a57d7060062b2497545a81432bcc47c5faa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
SUBDIRS = .

CLEANFILES = *~ python/*/* doctrees/* *.epicfail
MAINTAINERCLEANFILES = Makefile.in

examples = \
	example_about.py \
	example_command_line.py \
	example_version_spec.py

rst_docs = \
	example_about.rst \
	example_command_line.rst \
	example_version_spec.rst \
	index.rst \
	paludis.rst

EXTRA_DIST = conf.py \
	     $(rst_docs) \
	     $(examples)

if ENABLE_PYTHON_DOC

all-local : sphinx

sphinx : python

python : $(top_builddir)/python/paludis.so $(examples) $(rst_docs)
	mkdir -p $(builddir)/python && \
	env \
	    LD_LIBRARY_PATH="`echo $$LD_LIBRARY_PATH: | sed -e 's,^:,,'`` \
		    $(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/.libs/ \
		    `:`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/util/.libs/ \
		    `:`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/ruby/.libs/ \
		    `:`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/python/.libs/ \
		    `:`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories/e/.libs/`" \
	    PYTHONPATH="$(top_builddir)/python/:$(top_builddir)/python/.libs/" \
	    $(SPHINX_BUILD) -c $(builddir) -b html -d $(builddir)/doctrees $(srcdir) $(builddir)/python


install-data-local :
	mkdir -p $(DESTDIR)$(htmldir)/api
	cp -R python/ $(DESTDIR)$(htmldir)/api/

else

sphinx :
	@echo "You don't have python-doc turned on!"
	exit 1

endif


built-sources : $(BUILT_SOURCES)
	for s in `echo $(SUBDIRS) | tr -d .` ; do $(MAKE) -C $$s built-sources || exit 1 ; done

htmldocs : htmldocs-subdirs

htmldocs-subdirs :
	for s in $(SUBDIRS) . ; do if test x$$s = x. ; then $(MAKE) htmldocs-local || exit 1 ; \
	    else $(MAKE) -C $$s htmldocs || exit 1 ; fi ; done

htmldocs-local : $(paludisapipythonhtml_DATA)

clean-local :
	rm -fr python/

uninstall-local :
	rm -fr $(DESTDIR)$(htmldir)/api/python