824fad974c4f7cc76e1f4ee26a35c952dde54f7c
[rrdtool.git] / doc / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2
3 SUFFIXES = .pod .1 .man .html .txt .pm .pdf .src .inc
4
5 #AUTOMAKE_OPTIONS        =  foreign
6
7 #ACLOCAL_M4 = $(top_srcdir)/config/aclocal.m4
8
9 CLEANFILES = *.1 *.html *.txt *-dircache *.pm *.pdf *~ core *itemcache *.rej *.orig rrdgraph_*.pod
10
11 SRC = rrdgraph.src rrdgraph_examples.src  rrdgraph_rpn.src \
12       rrdgraph_data.src rrdgraph_graph.src    
13
14 POD = rrdtool.pod rrdlast.pod rrdcreate.pod rrdupdate.pod  rrdtutorial.es.pod \
15         cdeftutorial.pod rpntutorial.pod rrdgraph-old.pod  bin_dec_hex.pod \
16         rrdfetch.pod rrdrestore.pod rrddump.pod rrdtune.pod rrdresize.pod \
17         rrdcgi.pod rrdtutorial.pod rrdinfo.pod $(SRC:.src=.pod)
18
19 PMP = RRDs.pm RRDp.pm
20
21 MAN = $(POD:.pod=.1) $(PMP:.pm=.1) 
22 TXT = $(MAN:.1=.txt)
23 HTML = $(POD:.pod=.html) $(PMP:.pm=.html) 
24 PDF = $(MAN:.1=.pdf)
25
26 # what should go into the distribution
27 EXTRA_DIST= $(POD) $(HTML) $(TXT)
28
29 # some install rules
30 idocdir = $(prefix)/doc
31 idoc_DATA = $(POD) $(TXT)
32 ihtmldir = $(prefix)/html
33 ihtml_DATA = $(HTML)
34 imandir = $(prefix)/man/man1
35 iman_DATA = $(MAN)
36
37 all-local: link txt man html
38
39 .src.pod:
40         perl -n -e 'if (/^=include\s+(\S+)/){open F,"$$1.inc" || die $$?;print <F>; close F} else {print}'  $<  > $@ 
41
42 .pod.1 .pm.1 .pl.1:
43         pod2man --release=$(VERSION) --center=rrdtool $<  > $@
44
45 .1.txt:
46         @NROFF@ -man -Tlp $< > $@
47
48 .1.pdf:
49         @TROFF@ -man $< | ps2pdf - $@
50
51 .pm.html .pod.html .pl.html:
52         pod2html --infile=$< --outfile=$@ --noindex --htmlroot=. --podpath=. --title=$*
53
54 RRDs.pm:
55         ln -s ../bindings/perl-shared/RRDs.pm .
56
57 RRDp.pm:
58         ln -s ../bindings/perl-piped/RRDp.pm .
59
60 index.html:
61         rm -f index.html; ln -s rrdtool.html index.html
62
63 link: RRDp.pm RRDs.pm index.html
64
65 man: $(MAN)
66
67 html: $(HTML)
68
69 txt: $(TXT)
70
71 pdf: $(PDF)
72