Makefile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. BASEDIR=~/lfs-book
  2. CHUNK_QUIET=0
  3. PDF_OUTPUT=LFS-BOOK.pdf
  4. NOCHUNKS_OUTPUT=LFS-BOOK.html
  5. XSLROOTDIR=/usr/share/xml/docbook/xsl-stylesheets-current
  6. lfs:
  7. xsltproc --xinclude --nonet -stringparam chunk.quietly $(CHUNK_QUIET) \
  8. -stringparam base.dir $(BASEDIR)/ stylesheets/lfs-chunked.xsl \
  9. index.xml
  10. if [ ! -e $(BASEDIR)/stylesheets ]; then \
  11. mkdir -p $(BASEDIR)/stylesheets; \
  12. fi;
  13. cp stylesheets/*.css $(BASEDIR)/stylesheets
  14. if [ ! -e $(BASEDIR)/images ]; then \
  15. mkdir -p $(BASEDIR)/images; \
  16. fi;
  17. cp $(XSLROOTDIR)/images/*.png \
  18. $(BASEDIR)/images
  19. cd $(BASEDIR)/; sed -i -e "s@../stylesheets@stylesheets@g" \
  20. *.html
  21. cd $(BASEDIR)/; sed -i -e "s@../images@images@g" \
  22. *.html
  23. for filename in `find $(BASEDIR) -name "*.html"`; do \
  24. tidy -config tidy.conf $$filename; \
  25. true; \
  26. done;
  27. for filename in `find $(BASEDIR) -name "*.html"`; do \
  28. sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \
  29. done;
  30. #
  31. # This is the old "pdf" target. The old "print" target below has been
  32. # renamed to "pdf" and will be used. This commented out previous_pdf
  33. # target can be removed eventually. It'll remain here for a bit for
  34. # historical reasons
  35. #
  36. #previous_pdf:
  37. # xsltproc --xinclude --nonet --output $(BASEDIR)/lfs.fo stylesheets/lfs-pdf.xsl \
  38. # index.xml
  39. # sed -i -e "s/inherit/all/" $(BASEDIR)/lfs.fo
  40. # fop.sh $(BASEDIR)/lfs.fo $(BASEDIR)/$(PDF_OUTPUT)
  41. # rm lfs.fo
  42. pdf:
  43. xsltproc --xinclude --nonet --stringparam profile.condition print \
  44. --output $(BASEDIR)/lfs-pdf.xml stylesheets/lfs-profile.xsl index.xml
  45. xsltproc --nonet --output $(BASEDIR)/lfs-pdf.fo stylesheets/lfs-pdf.xsl \
  46. $(BASEDIR)/lfs-pdf.xml
  47. sed -i -e "s/inherit/all/" $(BASEDIR)/lfs-pdf.fo
  48. fop.sh $(BASEDIR)/lfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT)
  49. rm $(BASEDIR)/lfs-pdf.xml $(BASEDIR)/lfs-pdf.fo
  50. nochunks:
  51. xsltproc --xinclude --nonet --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
  52. stylesheets/lfs-nochunks.xsl index.xml
  53. tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
  54. validate:
  55. xmllint --noout --nonet --xinclude --postvalid index.xml