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