* configure,
[fw/sdcc] / doc / Makefile.in
1 VPATH  = @srcdir@
2 srcdir = @srcdir@
3
4 LYX        = @LYX@
5 LATEX      = @LATEX@
6 LATEX2HTML = @LATEX2HTML@
7 PDFLATEX   = @PDFLATEX@
8 DVIPDF     = @DVIPDF@
9 DVIPS      = @DVIPS@
10 MAKEINDEX  = @MAKEINDEX@
11
12 include ../Makefile.common
13
14 MANUAL = sdccman
15 TSS = test_suite_spec
16 CDB = cdbfileformat
17
18 all: $(MANUAL).pdf $(MANUAL).html/index.html $(MANUAL).txt \
19         $(TSS).pdf $(TSS).html/index.html $(TSS).txt \
20         $(CDB).pdf $(CDB).html/index.html $(CDB).txt
21
22 install:
23         $(INSTALL) -d $(DESTDIR)$(docdir)
24         cp -rf $(srcdir)/*.txt $(srcdir)/z80 $(srcdir)/avr $(DESTDIR)$(docdir)
25         txtfiles=`echo *.txt | grep -v '\*\.txt' || true`
26         if [    $(txtfiles)               ]; then cp     $(txtfiles)    $(DESTDIR)$(docdir); fi
27         if [ -f $(MANUAL).html/index.html ]; then cp -rf $(MANUAL).html $(DESTDIR)$(docdir); fi
28         if [ -f $(TSS).html/index.html    ]; then cp -rf $(TSS).html    $(DESTDIR)$(docdir); fi
29         if [ -f $(CDB).html/index.html    ]; then cp -rf $(CDB).html    $(DESTDIR)$(docdir); fi
30         if [ -f $(MANUAL).pdf             ]; then cp -rf $(MANUAL).pdf  $(DESTDIR)$(docdir); fi
31         if [ -f $(TSS).pdf                ]; then cp -rf $(TSS).pdf     $(DESTDIR)$(docdir); fi
32         if [ -f $(CDB).pdf                ]; then cp -rf $(CDB).pdf     $(DESTDIR)$(docdir); fi
33         rm -rf `find $(DESTDIR)$(docdir) -name .svn -type d`
34         rm -f $(DESTDIR)$(docdir)/*/WARNINGS $(DESTDIR)$(docdir)/*/*.pl $(DESTDIR)$(docdir)/*/images.*
35
36 uninstall:
37         rm -rf $(DESTDIR)$(docdir)
38
39 $(MANUAL).html/index.html: $(MANUAL).tex $(MANUAL).ind ;#$(MANUAL).glo
40         mkdir -p $(dir $@)
41         @# fixes $(LATEX2HTML) problems with two consecutive dashes for long-options: --stack-auto
42         @# fixes $(LATEX2HTML) problems with \tabularnewline
43         mv $< $(basename $<).orig.tex
44         sed -e 's,-\\/-,-\\/-\\/-,g' \
45             -e 's,\\tabularnewline$$,\\\\,g' < $(basename $<).orig.tex > $<
46         touch $< -r $(basename $<).orig.tex # avoid warning that *.tex is newer than *.aux
47         -$(LATEX2HTML) -split 5 -show_section_numbers -local_icons -info "" -dir $(MANUAL).html $(MANUAL)
48         mv $(basename $<).orig.tex $<
49
50 $(TSS).html/index.html: $(TSS).tex
51         mkdir -p $(dir $@)
52         @# fixes $(LATEX2HTML) problems with two consecutive dashes for long-options: --stack-auto
53         @# fixes $(LATEX2HTML) problems with \tabularnewline
54         mv $< $(basename $<).orig.tex
55         sed -e 's,-\\/-,-\\/-\\/-,g' \
56             -e 's,\\tabularnewline$$,\\\\,g' < $(basename $<).orig.tex > $<
57         touch $< -r $(basename $<).orig.tex # avoid warning that *.tex is newer than *.aux
58         -$(LATEX2HTML) -split 0 -local_icons -info "" -dir $(TSS).html $(TSS)
59         mv $(basename $<).orig.tex $<
60
61 $(CDB).html/index.html: $(CDB).tex
62         mkdir -p $(dir $@)
63         @# fixes $(LATEX2HTML) problems with two consecutive dashes for long-options: --stack-auto
64         @# fixes $(LATEX2HTML) problems with \tabularnewline
65         mv $< $(basename $<).orig.tex
66         sed -e 's,-\\/-,-\\/-\\/-,g' \
67             -e 's,\\tabularnewline$$,\\\\,g' < $(basename $<).orig.tex > $<
68         touch $< -r $(basename $<).orig.tex # avoid warning that *.tex is newer than *.aux
69         -$(LATEX2HTML) -split 0 -show_section_numbers -local_icons -info "" -dir $(CDB).html $(CDB)
70         mv $(basename $<).orig.tex $<
71
72 %.txt: %.lyx
73         @# $(LYX) will export the file in the directory of the $(LYX) file
74         @# if VPATH is used the $(LYX) file is copied first
75         if [ "$(srcdir)" != "." ]; then \
76           cp $< . ; \
77           $(LYX) -e text $(notdir $<) ; \
78           rm $(notdir $<) ; \
79         else \
80           $(LYX) -e text $< ; \
81         fi
82
83 %.pdf: %.tex %.dvi %.ind
84         $(DVIPDF) $*
85 # pdflatex creates documents for acrobat reader >= 5.0  
86 #       which $(PDFLATEX) > /dev/null && $(PDFLATEX) $* || $(DVIPDF) $*
87
88 %.ps:  %.pdf
89         $(DVIPS) $*
90
91 %.dvi: %.tex
92         $(LATEX) $<
93         @# rerun to in include aux
94         $(LATEX) $<
95
96 %.tex: %.lyx
97         if [ "$(srcdir)" != "." ] ; then \
98           cp $< . ; \
99           $(LYX) -e latex $(notdir $<) ; \
100           rm $(notdir $<) ; \
101         else \
102           $(LYX) -e latex $< ; \
103         fi
104
105 %.ind: %.dvi
106         $(LATEX) $*
107         # is there an index?
108         if [ -f $*.idx ] ; then \
109           $(MAKEINDEX) $*; \
110           $(LATEX) $*; \
111           $(LATEX) $*; \
112         fi
113 #         -$(MAKEINDEX) -s l2hidx.ist $*; \
114
115 %.glo: %.dvi
116         # the glossary, not implemented yet
117         # $(MAKEINDEX) -s l2hglo.ist -o $@ $<
118
119 archive: all
120         rm -rf sdcc-doc sdcc-doc.tar.bz2
121         mkdir sdcc-doc
122         rsync -rCt avr z80 *.pdf *.txt $(srcdir)/*.txt sdcc-doc
123
124         for doc in $(MANUAL) $(TSS) $(CDB); do \
125           rsync -Rt $$doc.html/*.html $$doc.html/*.png $$doc.html/*.css sdcc-doc/; \
126         done
127
128         mkdir sdcc-doc/as
129         rsync -rCt $(top_srcdir)/as/doc/* sdcc-doc/as/
130
131         mkdir sdcc-doc/ucsim
132         cd $(top_srcdir)/sim/ucsim/doc; rsync *.html *.jpg *.gif *.fig ../../../doc/sdcc-doc/ucsim/
133
134         tar -c sdcc-doc | bzip2 -9 > sdcc-doc.tar.bz2
135
136 include $(srcdir)/clean.mk