Makefile 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. # Makefile for Copyleft Tutorial -*- GNUMakefile -*-
  2. ifndef BOOK_BASE
  3. BOOK_BASE=comprehensive-gpl-guide
  4. endif
  5. ifndef WEB_INSTALL_DIR
  6. WEB_INSTALL_DIR = /path/to/html/install/directory
  7. endif
  8. LATEX_INPUT_FILES = $(BOOK_BASE).tex compliance-guide.tex license-texts.tex enforcement-case-studies.tex gpl-lgpl.tex third-party-citations.tex
  9. BOOK_CLASS_FILE = gpl-book.cls
  10. CSS_FILES = css/*.css
  11. JAVASCRIPT_FILES = js/*.js
  12. WEB_CONFIG_FILE = webhacks.cfg
  13. HTML_OUTPUT_DIR = public_html
  14. TEX4HT=tex4ht
  15. T4HT=t4ht
  16. HTLATEX=htlatex
  17. PDFLATEX = pdflatex
  18. LATEX = latex
  19. BIBTEX = bibtex
  20. FIG2DEV = fig2dev
  21. DVIPS=dvips
  22. all: err $(BOOK_BASE).pdf $(BOOK_BASE).ps html
  23. pdf: err $(BOOK_BASE).pdf
  24. html: $(HTML_OUTPUT_DIR)/monolithic/$(BOOK_BASE).html $(HTML_OUTPUT_DIR)/$(BOOK_BASE).html pdf $(BOOK_BASE).ps jscssmonolitic jscss
  25. /bin/ln -f $(BOOK_BASE).ps $(HTML_OUTPUT_DIR)/$(BOOK_BASE).ps
  26. /bin/ln -f $(BOOK_BASE).pdf $(HTML_OUTPUT_DIR)/$(BOOK_BASE).pdf
  27. .SUFFIXES: .fig .postscript .eps .pdf .pstex_t .pstex .ps .dvi .tex
  28. .postscript.pdf:
  29. ps2pdf $< $@
  30. .postscript.eps:
  31. ps2epsi $< $@
  32. .dvi.ps:
  33. $(DVIPS) $< -o $@
  34. .tex.dvi:
  35. $(LATEX) $<
  36. .fig.pdf:
  37. $(FIG2DEV) -L pdf -p "portrait" -c $< > $@
  38. .fig.pstex_t:
  39. $(FIG2DEV) -L pstex_t $< > $@
  40. .fig.pstex:
  41. $(FIG2DEV) -L pstex $< > $@
  42. $(BOOK_BASE).pdf: $(PDF_FIGS) $(LATEX_INPUT_FILES)
  43. $(PDFLATEX) $(BOOK_BASE)
  44. $(PDFLATEX) $(BOOK_BASE)
  45. $(PDFLATEX) $(BOOK_BASE)
  46. $(HTML_OUTPUT_DIR)/monolithic/$(BOOK_BASE).html: $(LATEX_INPUT_FILES) $(WEB_CONFIG_FILE)
  47. mkdir -p $(HTML_OUTPUT_DIR)/monolithic/js
  48. mkdir -p $(HTML_OUTPUT_DIR)/monolithic/css
  49. /bin/rm -f $(BOOK_BASE)*.html
  50. /bin/rm -f $(BOOK_BASE)*.js
  51. $(HTLATEX) comprehensive-gpl-guide.tex "webhacks,xhtml,mouseover,fn-in,monolith"
  52. $(HTLATEX) comprehensive-gpl-guide.tex "webhacks,xhtml,mouseover,fn-in,monolith"
  53. mv ${BOOK_BASE}*js $(HTML_OUTPUT_DIR)/monolithic/js
  54. /bin/rm -f $(BOOK_BASE)*.html
  55. /bin/rm -f $(BOOK_BASE)*.js
  56. $(HTLATEX) comprehensive-gpl-guide.tex "webhacks,xhtml,fn-in,monolith"
  57. mv $(BOOK_BASE)*html $(HTML_OUTPUT_DIR)/monolithic
  58. mv cm*png $(HTML_OUTPUT_DIR)/monolithic
  59. mv ${BOOK_BASE}*css $(HTML_OUTPUT_DIR)/monolithic
  60. /bin/rm -f ${BOOK_BASE}*aux ${BOOK_BASE}*dvi ${BOOK_BASE}*idv ${BOOK_BASE}*lg ${BOOK_BASE}*tmp ${BOOK_BASE}*4ct ${BOOK_BASE}*4tc ${BOOK_BASE}*toc ${BOOK_BASE}*out ${BOOK_BASE}*xref
  61. jscssmonolitic: $(CSS_FILES) $(JAVASCRIPT_FILES)
  62. cp -pa js/*js $(HTML_OUTPUT_DIR)/monolithic/js
  63. cp -pa css/*css $(HTML_OUTPUT_DIR)/monolithic/css
  64. $(HTML_OUTPUT_DIR)/$(BOOK_BASE).html: $(LATEX_INPUT_FILES) $(WEB_CONFIG_FILE)
  65. mkdir -p $(HTML_OUTPUT_DIR)/js
  66. mkdir -p $(HTML_OUTPUT_DIR)/css
  67. /bin/rm -f $(BOOK_BASE)*.html
  68. /bin/rm -f $(BOOK_BASE)*.js
  69. $(HTLATEX) comprehensive-gpl-guide.tex "webhacks,xhtml,2,next,mouseover,fn-in"
  70. mv ${BOOK_BASE}*js $(HTML_OUTPUT_DIR)/js
  71. /bin/rm -f $(BOOK_BASE)*.html
  72. /bin/rm -f $(BOOK_BASE)*.js
  73. $(HTLATEX) comprehensive-gpl-guide.tex "webhacks,2,next,fn-in"
  74. mv ${BOOK_BASE}*css $(HTML_OUTPUT_DIR)
  75. mv ${BOOK_BASE}*html $(HTML_OUTPUT_DIR)
  76. mv cm*png $(HTML_OUTPUT_DIR)
  77. /bin/rm -f ${BOOK_BASE}*aux ${BOOK_BASE}*dvi ${BOOK_BASE}*idv ${BOOK_BASE}*lg ${BOOK_BASE}*tmp ${BOOK_BASE}*4ct ${BOOK_BASE}*4tc ${BOOK_BASE}*toc ${BOOK_BASE}*out ${BOOK_BASE}*xref
  78. jscss: $(CSS_FILE) $(JAVASCRIPT_FILES)
  79. cp -pa js/*js $(HTML_OUTPUT_DIR)/js
  80. cp -pa css/*css $(HTML_OUTPUT_DIR)/css
  81. $(BOOK_BASE).dvi: $(LATEX_INPUT_FILES) $(EPS_FIGS)
  82. $(LATEX) $(BOOK_BASE).tex
  83. $(LATEX) $(BOOK_BASE).tex
  84. install: all
  85. chmod -R oug+r $(HTML_OUTPUT_DIR)
  86. find $(HTML_OUTPUT_DIR) -type d -exec chmod gou+rx {} \;
  87. rsync -HavP --delete --delay-updates $(HTML_OUTPUT_DIR)/ $(WEB_INSTALL_DIR)/
  88. chmod -R oug+r $(WEB_INSTALL_DIR)
  89. find $(WEB_INSTALL_DIR) -type d -exec chmod gou+rx {} \;
  90. cd $(WEB_INSTALL_DIR); /bin/ln -sf comprehensive-gpl-guide.html index.html
  91. cd $(WEB_INSTALL_DIR)/monolithic/; /bin/ln -sf comprehensive-gpl-guide.html index.html
  92. clean:
  93. /bin/rm -f $(BOOK_BASE).ps $(BOOK_BASE).pdf $(BOOK_BASE).log texput.log $(BOOK_BASE).lg $(BOOK_BASE).tmp $(BOOK_BASE).xref *.4ct *.4tc *.aux *.dvi $(BOOK_BASE)*.html *.idv *.lg *.tmp $(BOOK_BASE).css $(BOOK_BASE).log $(BOOK_BASE).out $(BOOK_BASE)-js.* cm*png
  94. /bin/rm -rf public_html
  95. err: ; $(ERR)