git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4106 4a8a32a2...
[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 $(DESTDIR)$(docdir)
13         cp -rf *.txt z80 avr $(DESTDIR)$(docdir)
14         if [ -f $(MANUAL).html/index.html ]; then cp -rf $(MANUAL).html $(DESTDIR)$(docdir); fi
15         if [ -f $(TSS).html/index.html    ]; then cp -rf $(TSS).html    $(DESTDIR)$(docdir); fi
16         if [ -f $(CDB).html/index.html    ]; then cp -rf $(CDB).html    $(DESTDIR)$(docdir); fi
17         if [ -f $(MANUAL).pdf             ]; then cp -rf $(MANUAL).pdf  $(DESTDIR)$(docdir); fi
18         if [ -f $(TSS).pdf                ]; then cp -rf $(TSS).pdf     $(DESTDIR)$(docdir); fi
19         if [ -f $(CDB).pdf                ]; then cp -rf $(CDB).pdf     $(DESTDIR)$(docdir); fi
20         rm -rf `find $(DESTDIR)$(docdir) -name .svn -type d`
21         rm -f $(DESTDIR)$(docdir)/*/WARNINGS $(DESTDIR)$(docdir)/*/*.pl $(DESTDIR)$(docdir)/*/images.*
22
23 uninstall:
24         rm -rf $(DESTDIR)$(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 -info "" -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 -info "" -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 -info "" -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 archive: all
85         rm -rf sdcc-doc sdcc-doc.tar.bz2
86         mkdir sdcc-doc
87         rsync -rCt avr z80 *.pdf *.txt sdcc-doc
88
89         for doc in $(MANUAL) $(TSS) $(CDB); do \
90           rsync -Rt $$doc.html/*.html $$doc.html/*.png $$doc.html/*.css sdcc-doc/; \
91         done
92
93         mkdir sdcc-doc/as
94         rsync -rCt ../as/doc/* sdcc-doc/as/
95
96         mkdir sdcc-doc/ucsim
97         cd ../sim/ucsim/doc; rsync *.html *.jpg *.gif *.fig ../../../doc/sdcc-doc/ucsim/
98
99         tar -c sdcc-doc | bzip2 -9 > sdcc-doc.tar.bz2
100
101 include clean.mk