Reshaped doc's
[fw/sdcc] / doc / Makefile
index ccfb08be35ec609114a7e8f108e64d7715a1b88f..a715ec29bdee8e88c41799ef6912523d1bd0cd3d 100644 (file)
@@ -1,29 +1,52 @@
-# Very simple Makefile for converting the design doc into something useful.
-TOPDIR = ..
+include ../Makefile.common
 
-include $(TOPDIR)/Makefile.common
+MANUAL = sdccman
+TSS = test_suite_spec
 
-TEX = latex
+all: $(MANUAL).html $(MANUAL).pdf $(MANUAL).txt \
+       $(TSS).html $(TSS).pdf $(TSS).txt
 
-S = test_suite_spec.tex
-PDF = $(S:.tex=.pdf)
-PS = $(S:.tex=.ps)
-HTML = $(S:.tex=.html)
+install:
+       $(INSTALL) -d $(docdir)
+       cp -rf *.html *.txt *.pdf $(MANUAL).html $(TSS).html z80 avr $(docdir)
+
+uninstall:
+       rm -rf $(docdir)
+
+
+$(MANUAL).html: $(MANUAL).tex $(MANUAL).ind ;#$(MANUAL).glo
+       latex2html -split 5 -show_section_numbers -dir $(MANUAL).html $(MANUAL)
 
-all: $(PS) $(PDF) $(HTML)
+$(TSS).html: $(TSS).tex
+       latex2html -split 0 -dir $(TSS).html $(TSS)
 
-%.ps: %.dvi
-       dvips -f.ps $< > $@
+%.txt: %.lyx
+       lyx -e text $<
 
 %.pdf: %.dvi
-       dvipdf $< $@
+       pdflatex $*
 
-%.html: %.tex
-       latex2html -no_subdir -split 0 $<
+%.dvi: %.tex
+       latex $<
+
+%.tex: %.lyx
+       lyx -e latex $<
+
+%.ind: %.dvi
+       makeindex -s l2hidx.ist $*
+
+%.glo: %.dvi
+       # the glossary, not implemented yet
+       # makeindex -s l2hglo.ist -o $@ $<
 
-install:
-       $(INSTALL) -d $(docdir)
-       cp -rf *.html SDCCUdoc.* *.txt *.tex z80 avr $(docdir)
 
 clean:
-       rm -f $(PS) $(PDF) *.log *.aux *~
+       # remove intermediate file, not the final pdf's and html's
+       # because these are needed for the distribution
+       rm -rf *.tex *.aux *.dvi *.idx *.ilg *.ind *.log *.toc *~ \#* \
+               *.ps */*.css */*.pl *.gif core
+
+superclean:
+       $(MAKE) clean
+       # now get rid of the generated pdf's and html's as well
+       rm -rf *.pdf $(MANUAL).html $(TSS).html
\ No newline at end of file