Makefile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. index.html part1.html part2.html part3.html longindex.html
  21. cd $(BASEDIR)/; sed -i -e "s@../images@images@g" \
  22. index.html part1.html part2.html part3.html longindex.html
  23. sh goTidy $(BASEDIR)/
  24. for filename in `find $(BASEDIR) -name "*.html"`; do \
  25. sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \
  26. done;
  27. #
  28. # This is the old "pdf" target. The old "print" target below has been
  29. # renamed to "pdf" and will be used. This commented out previous_pdf
  30. # target can be removed eventually. It'll remain here for a bit for
  31. # historical reasons
  32. #
  33. #previous_pdf:
  34. # xsltproc --xinclude --nonet --output $(BASEDIR)/lfs.fo stylesheets/lfs-pdf.xsl \
  35. # index.xml
  36. # sed -i -e "s/inherit/all/" $(BASEDIR)/lfs.fo
  37. # fop.sh $(BASEDIR)/lfs.fo $(BASEDIR)/$(PDF_OUTPUT)
  38. # rm lfs.fo
  39. pdf:
  40. xsltproc --xinclude --nonet --stringparam profile.condition print \
  41. --output $(BASEDIR)/lfs-pdf.xml stylesheets/lfs-profile.xsl index-pdf.xml
  42. xsltproc --nonet --output $(BASEDIR)/lfs-pdf.fo stylesheets/lfs-pdf.xsl \
  43. $(BASEDIR)/lfs-pdf.xml
  44. sed -i -e "s/inherit/all/" $(BASEDIR)/lfs-pdf.fo
  45. fop.sh $(BASEDIR)/lfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT)
  46. rm $(BASEDIR)/lfs-pdf.xml $(BASEDIR)/lfs-pdf.fo
  47. nochunks:
  48. xsltproc --xinclude --nonet --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
  49. stylesheets/lfs-nochunks.xsl index.xml
  50. tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
  51. validate:
  52. xmllint --noout --nonet --xinclude --postvalid index.xml