Makefile 2.1 KB

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