aboutsummaryrefslogtreecommitdiff
path: root/doc/api/python/Makefile.am
blob: d78da95d4549731f3931b7e4cf8b911eaaf2c505 (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/*/* *.epicfail
MAINTAINERCLEANFILES = Makefile.in

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

EXTRA_DIST = epydoc.css \
	     python_syntax.css \
	     $(examples)

dist_noinst_SCRIPTS = create_python_examples.py

if ENABLE_PYTHON_DOC

all-local : epydoc

epydoc : python

python : $(top_builddir)/python/paludis.so epydoc.css python_syntax.css create_python_examples.py $(examples)
	rm -fr python
	mkdir 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/" \
	    epydoc --name Paludis -o python --url http://paludis.exherbo.org --no-frames --css $(srcdir)/epydoc.css \
	        $(top_builddir)/python/paludis.so
	$(PYTHON) $(srcdir)/create_python_examples.py $(srcdir) $(examples)
	find python/ -type f | xargs sed -i -e 's@http://###EX###@@'
	cp $(srcdir)/python_syntax.css python/


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

else

epydoc :
	@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