Makefile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. BASEDIR=~/lfs-book
  2. CHUNK_QUIET=0
  3. PDF_OUTPUT=LFS-BOOK.pdf
  4. PRINT_OUTPUT=LFS-BOOK-PRINTABLE.pdf
  5. NOCHUNKS_OUTPUT=LFS-BOOK.html
  6. XSLROOTDIR=/usr/share/xml/docbook/xsl-stylesheets-current
  7. lfs:
  8. xsltproc --xinclude --nonet -stringparam chunk.quietly $(CHUNK_QUIET) \
  9. -stringparam base.dir $(BASEDIR)/ stylesheets/lfs-chunked.xsl \
  10. index.xml
  11. if [ ! -e $(BASEDIR)/stylesheets ]; then \
  12. mkdir -p $(BASEDIR)/stylesheets; \
  13. fi;
  14. cp stylesheets/*.css $(BASEDIR)/stylesheets
  15. if [ ! -e $(BASEDIR)/images ]; then \
  16. mkdir -p $(BASEDIR)/images; \
  17. fi;
  18. cp $(XSLROOTDIR)/images/*.png \
  19. $(BASEDIR)/images
  20. cd $(BASEDIR)/; sed -i -e "s@../stylesheets@stylesheets@g" \
  21. index.html part1.html part2.html part3.html longindex.html
  22. cd $(BASEDIR)/; sed -i -e "s@../images@images@g" \
  23. index.html part1.html part2.html part3.html longindex.html
  24. sh goTidy $(BASEDIR)/
  25. pdf:
  26. xsltproc --xinclude --nonet --output lfs.fo stylesheets/lfs-pdf.xsl \
  27. index.xml
  28. sed -i -e "s/inherit/all/" lfs.fo
  29. fop.sh lfs.fo $(PDF_OUTPUT)
  30. print:
  31. xsltproc --xinclude --nonet --output lfs-print.fo \
  32. stylesheets/lfs-print.xsl index.xml
  33. sed -i -e "s/inherit/all/" lfs-print.fo
  34. fop.sh lfs-print.fo $(PRINT_OUTPUT)
  35. nochunks:
  36. xsltproc --xinclude --nonet --output $(NOCHUNKS_OUTPUT) \
  37. stylesheets/lfs-nochunks.xsl index.xml
  38. tidy -config tidy.conf $(NOCHUNKS_OUTPUT) || true
  39. validate:
  40. xmllint --noout --nonet --xinclude --postvalid index.xml