Makefile 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. # Makefile Fun SS 2012
  2. destdir=$(HOME)/public_html
  3. bibliography=medium.bib
  4. # commands
  5. bibtool=bibtool -- 'preserve.key.case = ON' \
  6. -- 'sort = ON' \
  7. -- 'check.double = ON' \
  8. -- 'check.double.delete = ON' \
  9. -- 'delete.field = { abstract }' \
  10. -- 'delete.field = { dvi }' \
  11. -- 'delete.field = { postscript }' \
  12. -- 'delete.field = { pdf }' \
  13. -- 'delete.field = { url }'
  14. catcfg=sed -e "s/%.*//g" <
  15. latex=latex
  16. pdflatex=pdflatex
  17. lhs2tex=lhs2TeX --verbatim-comments
  18. .PHONY : default debugMake
  19. .PRECIOUS : %.dvi %.pdf %.tex
  20. default : haskell-style.pdf
  21. # # haskell-style
  22. # ##################################################################
  23. # # initially, run latex once to create an .aux file
  24. # # mark .aux file as fresh by creating a stamp _aux
  25. # haskell-style_aux : haskell-style.tex
  26. # -$(latex) haskell-style.tex;
  27. # touch $@;
  28. # # then, run bibtex
  29. # haskell-style.bbl : haskell-style_aux auto-haskell-style.bib
  30. # -bibtex haskell-style;
  31. # # finally, finish by running latex twice again
  32. # # this will update .aux, but leave the stamp _aux intact
  33. # # (otherwise we would not converge and make would never
  34. # # return a "Nothing to do")
  35. # haskell-style.dvi : haskell-style.bbl
  36. # -$(latex) haskell-style.tex;
  37. # -$(latex) haskell-style.tex;
  38. # haskell-style.pdf : haskell-style.dvi
  39. # $(pdflatex) haskell-style.tex
  40. # ## pdflatex does not work since we are including a .ps file
  41. # #haskell-style.pdf : haskell-style.bbl
  42. # # pdflatex haskell-style.tex;
  43. # # pdflatex haskell-style.tex;
  44. # # auto-haskell-style.bib is only defined if bibtool is present and all.bib exists
  45. # ifneq ($(shell which bibtool),)
  46. # ifneq ($(shell ls $(bibliography)),)
  47. # auto-haskell-style.bib : haskell-style_aux $(bibliography)
  48. # echo "%%%% WARNING! AUTOMATICALLY CREATED BIBFILE" > $@;
  49. # echo "%%%% DO NOT EDIT! ALL CHANGES WILL BE LOST!" >> $@ ;
  50. # echo "" >> $@ ;
  51. # $(bibtool) -x haskell-style.aux -i $(bibliography) >> $@;
  52. # endif
  53. # endif
  54. # Templates
  55. %.tex : %.lagda
  56. lhs2TeX --agda $< > $@
  57. %.tex : %.lhs
  58. $(lhs2tex) $< > $@
  59. % : %.pdf
  60. cp -p $? $(destdir)/;
  61. touch $@;
  62. %.dvi : %.tex
  63. $(latex) $<;
  64. -bibtex $*;
  65. $(latex) $<;
  66. $(latex) $<;
  67. %.pdf : %.tex
  68. -pdflatex $*.tex;
  69. pdflatex $*.tex;
  70. %.ps : %.dvi
  71. dvips -o $@ $<;
  72. %.gz : %
  73. cat $< | gzip > $@
  74. clean :
  75. -rm *.aux *.log *.out *.ptb haskell-style.tex haskell-style.pdf
  76. #EOF