]> git.decadent.org.uk Git - ion3-doc.git/blob - Makefile
[svn-upgrade] Integrating new upstream version, ion3-doc (20080207)
[ion3-doc.git] / Makefile
1 # Settings
2 ######################################
3
4 TOPDIR=../ion-3
5
6 include $(TOPDIR)/build/system-inc.mk
7
8 L2H=latex2html -show_section_numbers -short_index -local_icons -noaddress \
9     -up_url http://iki.fi/tuomov/ion/ -up_title "Ion homepage" -nofootnode\
10 ##    -style greyviolet.css
11
12
13 # Function documentation to build
14 ######################################
15
16 DOCS=ionconf ionnotes
17
18 FNTEXES=ioncore.exports mod_tiling.exports \
19         mod_query.exports de.exports mod_menu.exports \
20         mod_dock.exports mod_sp.exports mod_statusbar.exports
21
22 RUBBER_DVI=rubber
23 RUBBER_PS=rubber -p
24 RUBBER_PDF=rubber -d
25
26 TARGETS = ionconf ionnotes
27
28 # Generic rules
29 ######################################
30
31 nothing:
32         @ echo "Please read the README first."
33
34 %-dvi:
35         $(RUBBER_DVI) $*
36         
37 %-ps:
38         $(RUBBER_PS) $*
39
40 %-pdf:
41         $(RUBBER_PDF) $*
42
43 # Install
44 ######################################
45
46 install:
47         $(INSTALLDIR) $(DOCDIR); \
48         for d in $(DOCS); do \
49             for e in ps pdf dvi; do \
50               test -f $$d.$$e && $(INSTALL) -m $(DATA_MODE) $$d.$$e $(DOCDIR); \
51             done; \
52             $(INSTALLDIR) $(DOCDIR)/$$d; \
53             for i in $$d/*; do \
54                 $(INSTALL) -m $(DATA_MODE) $$i $(DOCDIR)/$$i; \
55             done; \
56         done
57
58 # ionconf rules
59 ######################################
60
61 ionconf-dvi: fnlist.tex
62 ionconf-ps: fnlist.tex
63 ionconf-pdf: fnlist.tex
64
65 ionconf-html: $(FNTEXES)
66         $(L2H) -split 3 ionconf
67
68 # ionnotes rules
69 ######################################
70
71 ionnotes-html: 
72         $(L2H) -split 4 ionnotes
73
74 # More generic rules
75 ######################################
76
77 .PHONY: all all-dvi all-ps all-pdf all-html
78
79 all: all-dvi all-ps all-pdf all-html
80
81 all-dvi: $(patsubst %,%-dvi,$(TARGETS))
82
83 all-ps: $(patsubst %, %-ps, $(TARGETS))
84
85 all-pdf: $(patsubst %, %-pdf, $(TARGETS))
86
87 all-html: $(patsubst %, %-html, $(TARGETS))
88
89
90 # Clean
91 ######################################
92
93 clean:
94         rm -f $(FNTEXES) fnlist.tex
95         rm -f *.aux *.toc *.log
96         rm -f *.idx *.ild *.ilg *.ind
97         
98 realclean: clean
99         rm -f *.ps *.pdf *.dvi
100         rm -rf $(DOCS)
101
102
103 # Function reference rules
104 ######################################
105
106 include $(TOPDIR)/libmainloop/rx.mk
107
108 $(TOPDIR)/%/exports.tex:
109         $(MAKE) -C $$(dirname $@) _exports_doc
110
111 %.exports: $(TOPDIR)/%/exports.tex
112         cp $< $@
113
114 # Function list
115 ######################################
116
117 fnlist.tex: $(FNTEXES)
118         grep hyperlabel $+ | \
119         sed 's/.*fn:\([^}]*\).*/\\fnlisti{\1}/;'|sort -d -f \
120         > $@