Makefile 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. #
  25. # This is the old "pdf" target. The old "print" target below has been
  26. # renamed to "pdf" and will be used. This commented out previous_pdf
  27. # target can be removed eventually. It'll remain here for a bit for
  28. # historical reasons
  29. #
  30. #previous_pdf:
  31. # xsltproc --xinclude --nonet --output $(BASEDIR)/lfs.fo stylesheets/lfs-pdf.xsl \
  32. # index.xml
  33. # sed -i -e "s/inherit/all/" $(BASEDIR)/lfs.fo
  34. # fop.sh $(BASEDIR)/lfs.fo $(BASEDIR)/$(PDF_OUTPUT)
  35. # rm lfs.fo
  36. pdf:
  37. xsltproc --xinclude --nonet --stringparam profile.condition print \
  38. --output $(BASEDIR)/lfs-pdf.xml stylesheets/lfs-profile.xsl index-pdf.xml
  39. xsltproc --nonet --output $(BASEDIR)/lfs-pdf.fo stylesheets/lfs-pdf.xsl \
  40. $(BASEDIR)/lfs-pdf.xml
  41. sed -i -e "s/inherit/all/" $(BASEDIR)/lfs-pdf.fo
  42. fop.sh $(BASEDIR)/lfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT)
  43. rm $(BASEDIR)/lfs-pdf.xml $(BASEDIR)/lfs-pdf.fo
  44. nochunks:
  45. xsltproc --xinclude --nonet --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
  46. stylesheets/lfs-nochunks.xsl index.xml
  47. tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
  48. validate:
  49. xmllint --noout --nonet --xinclude --postvalid index.xml