Makefile 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. LATEX_CMD?=xelatex
  2. MKIDX_CMD?=makeindex
  3. BIBTEX_CMD?=bibtex
  4. LATEX_COUNT?=8
  5. MANUAL_FILE?=refman
  6. all: $(MANUAL_FILE).dvi
  7. ps: $(MANUAL_FILE).ps
  8. pdf: $(MANUAL_FILE).pdf
  9. ps_2on1: $(MANUAL_FILE).ps
  10. pdf_2on1: $(MANUAL_FILE).pdf
  11. $(MANUAL_FILE).ps: $(MANUAL_FILE).dvi
  12. dvips -o $(MANUAL_FILE).ps $(MANUAL_FILE).dvi
  13. $(MANUAL_FILE).pdf: $(MANUAL_FILE).ps
  14. ps2pdf $(MANUAL_FILE).ps $(MANUAL_FILE).pdf
  15. $(MANUAL_FILE).dvi: clean $(MANUAL_FILE).tex doxygen.sty
  16. echo "Running latex..."
  17. $(LATEX_CMD) $(MANUAL_FILE).tex || \
  18. if [ $$? != 0 ] ; then \
  19. \echo "Please consult $(MANUAL_FILE).log to see the error messages" ; \
  20. false; \
  21. fi
  22. echo "Running makeindex..."
  23. $(MKIDX_CMD) $(MANUAL_FILE).idx
  24. echo "Rerunning latex...."
  25. $(LATEX_CMD) $(MANUAL_FILE).tex
  26. latex_count=$(LATEX_COUNT) ; \
  27. while grep -E -s 'Rerun (LaTeX|to get cross-references right|to get bibliographical references right)' $(MANUAL_FILE).log && [ $$latex_count -gt 0 ] ;\
  28. do \
  29. echo "Rerunning latex...." ;\
  30. $(LATEX_CMD) $(MANUAL_FILE).tex ; \
  31. $(LATEX_CMD) $(MANUAL_FILE).tex || \
  32. if [ $$? != 0 ] ; then \
  33. \echo "Please consult $(MANUAL_FILE).log to see the error messages" ; \
  34. false; \
  35. fi; \
  36. latex_count=`expr $$latex_count - 1` ;\
  37. done
  38. $(MKIDX_CMD) $(MANUAL_FILE).idx
  39. $(LATEX_CMD) $(MANUAL_FILE).tex || \
  40. if [ $$? != 0 ] ; then \
  41. \echo "Please consult $(MANUAL_FILE).log to see the error messages" ; \
  42. false; \
  43. fi
  44. $(MANUAL_FILE).ps: $(MANUAL_FILE).ps
  45. psnup -2 $(MANUAL_FILE).ps >$(MANUAL_FILE).ps
  46. $(MANUAL_FILE).pdf: $(MANUAL_FILE).ps
  47. ps2pdf $(MANUAL_FILE).ps $(MANUAL_FILE).pdf
  48. clean:
  49. rm -f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out *.brf *.blg *.bbl $(MANUAL_FILE).pdf