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