small fix
[fw/sdcc] / doc / Makefile
index ccfb08be35ec609114a7e8f108e64d7715a1b88f..6c3970440944bbff58bee29a415148b28691577f 100644 (file)
@@ -1,29 +1,64 @@
-# 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)
 
-all: $(PS) $(PDF) $(HTML)
+uninstall:
+       rm -rf $(docdir)
 
-%.ps: %.dvi
-       dvips -f.ps $< > $@
 
-%.pdf: %.dvi
-       dvipdf $< $@
+$(MANUAL).html: $(MANUAL).tex $(MANUAL).ind ;#$(MANUAL).glo
+       mkdir -p $@
+       latex2html -split 5 -show_section_numbers -dir $(MANUAL).html $(MANUAL)
 
-%.html: %.tex
-       latex2html -no_subdir -split 0 $<
+$(TSS).html: $(TSS).tex
+       mkdir -p $@
+       latex2html -split 0 -dir $(TSS).html $(TSS)
 
-install:
-       $(INSTALL) -d $(docdir)
-       cp -rf *.html SDCCUdoc.* *.txt *.tex z80 avr $(docdir)
+%.txt: %.lyx
+       lyx -e text $<
+
+%.pdf: %.tex %.dvi
+       which pdflatex > /dev/null && pdflatex $* || dvipdf $*
+
+%.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 $@ $<
+
+# Deleting all files created by building the program
+# --------------------------------------------------
 clean:
-       rm -f $(PS) $(PDF) *.log *.aux *~
+# The directories are still in CVS, so don't delete them
+#      rm -rf $(MANUAL).html $(TSS).html
+       rm -f $(MANUAL).html/* $(TSS).html/*
+       rm -f $(MANUAL).txt $(TSS).txt *.pdf *.dvi *.tex *.ind *.glo *.aux *.idx *.ilg *.log *.toc
+
+# Deleting all files created by configuring or building the program
+# -----------------------------------------------------------------
+distclean: clean
+
+# Like clean but some files may still exist
+# -----------------------------------------
+mostlyclean: clean
+
+# Deleting everything that can reconstructed by this Makefile. It deletes
+# everything deleted by distclean plus files created by bison, etc.
+# -----------------------------------------------------------------------
+realclean: distclean
+