* sdcc.spec: updated
[fw/sdcc] / doc / Makefile
1 include ../Makefile.common
2
3 MANUAL = sdccman
4 TSS = test_suite_spec
5 CDB = cdbfileformat
6
7 all: $(MANUAL).pdf $(MANUAL).html/index.html $(MANUAL).txt \
8         $(TSS).pdf $(TSS).html/index.html $(TSS).txt \
9         $(CDB).pdf $(CDB).html/index.html $(CDB).txt
10
11 install:
12         $(INSTALL) -d $(docdir)
13         cp -rf *.txt z80 avr $(docdir)
14         if [ -f $(MANUAL).html/index.html ]; then cp -rf $(MANUAL).html $(docdir); fi
15         if [ -f $(TSS).html/index.html    ]; then cp -rf $(TSS).html    $(docdir); fi
16         if [ -f $(CDB).html/index.html    ]; then cp -rf $(CDB).html    $(docdir); fi
17         if [ -f $(MANUAL).pdf             ]; then cp -rf $(MANUAL).pdf  $(docdir); fi
18         if [ -f $(TSS).pdf                ]; then cp -rf $(TSS).pdf     $(docdir); fi
19         if [ -f $(CDB).pdf                ]; then cp -rf $(CDB).pdf     $(docdir); fi
20         find $(docdir) -name "CVS" -type d | xargs rm -r
21         rm -f $(docdir)/*/WARNINGS $(docdir)/*/*.pl $(docdir)/*/images.*
22
23 uninstall:
24         rm -rf $(docdir)
25
26 $(MANUAL).html/index.html: $(MANUAL).tex $(MANUAL).ind ;#$(MANUAL).glo
27         mkdir -p `dirname $@`
28         # fixes latex2html problems with two consecutive dashes for long-options: --stack-auto
29         # fixes latex2html problems with \tabularnewline
30         mv $< `basename $< .tex`.orig.tex
31         sed 's,-\\/-,-\\/-\\/-,g' < `basename $< .tex`.orig.tex | \
32         sed 's,\\tabularnewline$$,\\\\,g' > $<
33         -latex2html -split 5 -show_section_numbers -local_icons -dir $(MANUAL).html $(MANUAL)
34         mv `basename $< .tex`.orig.tex $<
35
36 $(TSS).html/index.html: $(TSS).tex
37         mkdir -p `dirname $@`
38         # fixes latex2html problems with two consecutive dashes for long-options: --stack-auto
39         # fixes latex2html problems with \tabularnewline
40         mv $< `basename $< .tex`.orig.tex
41         sed 's,-\\/-,-\\/-\\/-,g' < `basename $< .tex`.orig.tex | \
42         sed 's,\\tabularnewline$$,\\\\,g' > $<
43         -latex2html -split 0 -local_icons -dir $(TSS).html $(TSS)
44         mv `basename $< .tex`.orig.tex $<
45
46 $(CDB).html/index.html: $(CDB).tex
47         mkdir -p `dirname $@`
48         # fixes latex2html problems with two consecutive dashes for long-options: --stack-auto
49         # fixes latex2html problems with \tabularnewline
50         mv $< `basename $< .tex`.orig.tex
51         sed 's,-\\/-,-\\/-\\/-,g' < `basename $< .tex`.orig.tex | \
52         sed 's,\\tabularnewline$$,\\\\,g' > $<
53         -latex2html -split 0 -show_section_numbers -local_icons -dir $(CDB).html $(CDB)
54         mv `basename $< .tex`.orig.tex $<
55
56 %.txt: %.lyx
57         lyx -e text $<
58
59 %.pdf: %.tex %.dvi %.ind
60         dvipdf $*
61 # pdflatex creates documents for acrobat reader >= 5.0  
62 #       which pdflatex > /dev/null && pdflatex $* || dvipdf $*
63
64 %.ps:  %.pdf
65         dvips $*
66
67 %.dvi: %.tex
68         latex $<
69
70 %.tex: %.lyx
71         lyx -e latex $<
72
73 %.ind: %.dvi
74         latex $*
75         -makeindex $*
76 #       -makeindex -s l2hidx.ist $*
77         latex $*
78         latex $*
79
80 %.glo: %.dvi
81         # the glossary, not implemented yet
82         # makeindex -s l2hglo.ist -o $@ $<
83
84 include clean.mk