doc/Makefile: Add clean rule.
[oweals/gnunet.git] / doc / Makefile.am
1 # This Makefile.am is in the public domain
2 SUBDIRS = man doxygen
3
4 docdir = $(datadir)/doc/gnunet/
5
6 infoimagedir = $(infodir)/images
7
8 DOT_FILES = images/$(wildcard *.dot)
9
10 DOT_VECTOR_GRAPHICS =                                                           \
11         $(DOT_FILES:%.dot=%.eps)                                                \
12         $(DOT_FILES:%.dot=%.pdf)
13
14 dist_infoimage_DATA =                                                           \
15         images/$(wildcard *.png)                                                \
16         images/$(wildcard *.svg)                                                \
17         $(DOT_FILES:%.dot=%.png)
18
19 DOT_OPTIONS =                                                                   \
20         -Gratio=.9 -Gnodesep=.005 -Granksep=.00005                              \
21         -Nfontsite=9 -Nheight=.1 -Nwidth=.1
22
23 .dot.png:
24         $(AM_V_DOT)$(DOT) -Tpng $(DOT_OPTIONS) < "$<" > "$(srcdir)/$@.tmp"; \
25         mv "$(srcdir)/$@.tmp" "$(srcdir)/$@"
26
27 .dot.pdf:
28         $(AM_V_DOT)$(DOT) -Tpdf $(DOT_OPTIONS) < "$<" > "$(srcdir)/$@.tmp"; \
29         mv "$(srcdir)/$@.tmp" "$(srcdir)/$@"
30
31 .dot.eps:
32         $(AM_V_DOT)$(DOT) -Teps $(DOT_OPTIONS) < "$<" > "$(srcdir)/$@.tmp"; \
33         mv "$(srcdir)/$@.tmp" "$(srcdir)/$@"
34
35 .png.eps:
36         $(AM_V_GEN)convert "$<" "$@-tmp.eps"; \
37         mv "$@-tmp.eps" "$@"
38
39 pdf-local: $(DOT_FILES=%.dot=$(top_srcdir)/%.pdf)
40 info-local: $(DOT_FILES=%.dot=$(top_srcdir)/%.png)
41 ps-local: $(DOT_FILES=%.dot=$(top_srcdir)/%.eps)                \
42         $(top_srcdir)/%D%/images/coreutils-size-map.eps
43 dvi-local: ps-local
44
45 gnunet_tutorial_examples =                                      \
46         001.c                                                   \
47         002.c                                                   \
48         003.c                                                   \
49         004.c                                                   \
50         005.c                                                   \
51         006.c                                                   \
52         007.c                                                   \
53         008.c                                                   \
54         009.c                                                   \
55         010.c                                                   \
56         011.c                                                   \
57         012.c                                                   \
58         013.c                                                   \
59         014.c                                                   \
60         015.c                                                   \
61         016.c                                                   \
62         017.c                                                   \
63         018.c                                                   \
64         019.c                                                   \
65         020.c                                                   \
66         021.c                                                   \
67         022.c                                                   \
68         023.c                                                   \
69         024.c                                                   \
70         025.c                                                   \
71         026.c
72
73 info_TEXINFOS = \
74         gnunet.texi
75
76 # It seems as if either we still have gnunet-c-tutorial markup issues
77 # or we have issues that can only occur in systems which are not using Guix
78 # or we have version incompabilities.
79 #       gnunet-c-tutorial.texi
80
81 gnunet_TEXINFOS = \
82         chapters/developer.texi \
83         chapters/installation.texi \
84         chapters/philosophy.texi \
85         chapters/user.texi \
86         fdl-1.3.texi \
87         gpl-3.0.texi
88
89 EXTRA_DIST =                                                                    \
90         $(gnunet_TEXINFOS)                                                      \
91         $(gnunet_tutorial_examples)                                             \
92         $(DOT_FILES)                                                            \
93         $(DOT_VECTOR_GRAPHICS)                                                  \
94         outdated-and-old-installation-instructions.txt                          \
95         gnunet-c-tutorial-v1.pdf                                                \
96         README.txt
97
98 daemon_lego_block.png: images/daemon_lego_block.svg
99         convert images/daemon_lego_block.svg images/daemon_lego_block.png &&
100         pngcrush images/daemon_lego_block.png images/daemon_lego_block.png
101
102 service_lego_block.png: images/service_lego_block.svg
103         convert images/service_lego_block.svg images/service_lego_block.png &&
104         pngcrush images/service_lego_block.png images/serivce_lego_block.png
105
106 lego_stack.png: images/lego_stack.svg
107         convert images/lego_stack.svg images/lego_stack.png &&
108         pngcrush images/lego_stack.png images/lego_stack.png
109
110 version.texi:
111         echo "@set UPDATED $(date +'%d %B %Y')" > $@
112         echo "@set UPDATED-MONTH $(date +'%B %Y')" >> $@
113         echo "@set EDITION $(PACKAGE_VERSION)" >> $@
114         echo "@set VERSION $(PACKAGE_VERSION)" >> $@ 
115
116 doc-pdf: version.texi
117         @makeinfo --pdf --quiet gnunet.texi
118 doc-pdf-tutorial: version.texi
119         @makeinfo --pdf --quiet gnunet-c-tutorial.texi
120
121 doc-html: version.texi
122         @makeinfo --html gnunet.texi
123 doc-html-tutorial: version.texi
124         @makeinfo --html gnunet-c-tutorial.texi
125
126 doc-info: version.texi
127         @makeinfo --no-split gnunet.texi
128 doc-info-tutorial: version.texi
129         @makeinfo --no-split gnunet-c-tutorial.texi
130
131 # FIXME: rm *.html and *.pdf
132 doc-clean:
133         @rm *.aux *.log *.toc *.cp *.cps
134
135 doc-all: doc-pdf doc-html doc-info doc-pdf-tutorial doc-html-tutorial doc-info-tutorial
136
137 doc-pdf-noise: version.texi
138         @makeinfo --pdf gnunet.texi
139 doc-pdf-tutorial-noise: version.texi
140         @makeinfo --pdf gnunet-c-tutorial.texi
141
142 doc-html-noise: version.texi
143         @makeinfo --html gnunet.texi
144 doc-html-tutorial-noise: version.texi
145         @makeinfo --html gnunet-c-tutorial.texi
146
147 doc-info-noise: version.texi
148         @makeinfo --no-split gnunet.texi
149 doc-info-tutorial-noise: version.texi
150         @makeinfo --no-split gnunet-c-tutorial.texi
151
152 doc-all-give-me-the-noise: doc-pdf-noise doc-html-noise doc-info-noise doc-pdf-tutorial-noise doc-html-tutorial-noise doc-info-tutorial-noise
153
154 doc-all-install: doc-all-give-me-the-noise
155         @mkdir -p $(DESTDIR)/$(docdir)
156         @mkdir -p $(DESTDIR)/$(infoimagedir)
157         @mkdir -p $(DESTDIR)/$(infodir)
158         @install -m 0755 gnunet.pdf $(DESTDIR)/$(docdir)
159         @install -m 0755 gnunet-c-tutorial.pdf $(DESTDIR)/$(docdir)
160         @install -m 0755 gnunet-c-tutorial.info $(DESTDIR)/$(infodir)
161         @install -m 0755 gnunet.info $(DESTDIR)/$(infodir)
162         @cp -r gnunet $(DESTDIR)/$(docdir)
163         @cp -r gnunet-c-tutorial $(DESTDIR)/$(docdir)
164         @cp -r images $(DESTDIR)/$(infoimagedir)
165
166 # TODO: Add more to clean.
167 clean:
168         @rm gnunet.pdf
169         @rm gnunet-c-tutorial.pdf
170         @rm gnunet.info
171         @rm gnunet-c-tutorial.info
172
173 CLEANFILES =                                            \
174         gnunet.log                                      \
175         gnunet-c-tutorial.log                           \
176         $(wildcard *.aux)                               \
177         $(wildcard *.toc)                               \
178         $(wildcard *.cp)                                \
179         $(wildcard *.cps)
180
181 .PHONY: version.texi