build: config.mk: Fix python-config switch
[gfxprim/pasky.git] / doc / Makefile
blobc07d94a9a514f9b43493c6028a1f40702150d020
1 SOURCES=general.txt context.txt loaders.txt filters.txt basic_types.txt \
2 drawing_api.txt backends.txt gamma.txt grabbers.txt \
3 environment_variables.txt debug.txt core.txt api.txt input.txt \
4 gen.txt pixels.txt coordinate_system.txt coding_style.txt \
5 get_put_pixel.txt blits.txt progress_callback.txt text_api.txt \
6 event_queue.txt compilation.txt filters_resize.txt \
7 filters_dithering.txt filters_python.txt
9 SOURCES+=core_python.txt gfx_python.txt loaders_python.txt backends_python.txt
11 EXAMPLE_SOURCES=$(wildcard example_*.txt)
13 ASCIIDOC_PARAMS=--conf-file asciidoc.conf
16 # Names of generated images for cleanup
18 GENIMAGES=discrete_linear_1D_convolution_alg1 discrete_linear_1D_convolution_alg2 \
19 discrete_linear_convolution discrete_linear_convolution_alg1 \
20 discrete_linear_convolution_alg2 laplacian_edge_sharpening laplacian_kernel
22 PAGES=$(subst .txt,.html,$(SOURCES))
23 PAGES+=$(subst .txt,.html,$(EXAMPLE_SOURCES))
25 .PHONY: toolcheck clean
27 all: toolcheck examples.html $(PAGES) api.html
29 $(PAGES): asciidoc.conf
32 # Dependencies
34 IMG_INCLUDES=images/blur/images.txt images/median/images.txt\
35 images/edge_sharpening/images.txt images/gaussian_noise/images.txt
37 filters_python.html: $(IMG_INCLUDES)
38 filters.html: $(IMG_INCLUDES)
41 # Check if we have all the needed tools
43 toolcheck:
44 @if [ -z `which asciidoc 2>/dev/null` ] ; then \
45 echo "ERROR: Could not find 'asciidoc'" ; exit 127 ; fi
46 @if [ -z `which source-highlight 2>/dev/null` ] ; then \
47 echo "ERROR: Could not find 'source-highlight'" ; exit 127 ; fi
48 @if [ ! -d "/usr/share/graphviz" ] ; then \
49 echo "ERROR: Could not find 'graphviz'" ; exit 127 ; fi
50 @if [ -z `which latex 2>/dev/null` ] ; then \
51 echo "error: could not find 'latex'" ; exit 127 ; fi
52 @if [ -z `which dvipng 2>/dev/null` ] ; then \
53 echo "error: could not find 'dvipng'" ; exit 127 ; fi
56 # Create page for each part of API description
58 $(PAGES): %.html: %.txt
59 asciidoc $(ASCIIDOC_PARAMS) $<
61 examples.html: examples.txt ../demos/c_simple/*.c ../demos/py_simple/*.py asciidoc.conf
62 asciidoc $(ASCIIDOC_PARAMS) -a toc examples.txt
65 # Clean up generated images
67 CLEAN+=$(patsubst %,%.md5,$(GENIMAGES))
68 CLEAN+=$(patsubst %,%.png,$(GENIMAGES))
71 # Clean up generated pages
73 CLEAN+=$(PAGES)
75 clean:
76 rm -f $(CLEAN)
77 rm -f api_links.html api.html examples.html
78 rm -f api.xml api.fo api.pdf