Makefile 2.0 KB

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