Makefile 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 profile.condition html \
  8. -stringparam chunk.quietly $(CHUNK_QUIET) -stringparam base.dir $(BASEDIR)/ \
  9. stylesheets/lfs-chunked.xsl 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. *.html
  21. cd $(BASEDIR)/; sed -i -e "s@../images@images@g" \
  22. *.html
  23. for filename in `find $(BASEDIR) -name "*.html"`; do \
  24. tidy -config tidy.conf $$filename; \
  25. true; \
  26. done;
  27. for filename in `find $(BASEDIR) -name "*.html"`; do \
  28. sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \
  29. done;
  30. # Uncomment this for testing and stable versions
  31. #pdf:
  32. # xsltproc --xinclude --nonet --stringparam profile.condition pdf \
  33. # --output $(BASEDIR)/lfs-pdf.xml stylesheets/lfs-profile.xsl index.xml
  34. # xsltproc --nonet --output $(BASEDIR)/lfs-pdf.fo stylesheets/lfs-pdf.xsl \
  35. # $(BASEDIR)/lfs-pdf.xml
  36. # sed -i -e "s/inherit/all/" $(BASEDIR)/lfs-pdf.fo
  37. # fop.sh $(BASEDIR)/lfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT)
  38. # rm $(BASEDIR)/lfs-pdf.xml $(BASEDIR)/lfs-pdf.fo
  39. # Remove this for testing and stable versions
  40. pdf:
  41. xsltproc --xinclude --nonet --output $(BASEDIR)/lfs-pdf.fo \
  42. stylesheets/lfs-pdf.xsl index.xml
  43. sed -i -e "s/inherit/all/" $(BASEDIR)/lfs-pdf.fo
  44. fop.sh $(BASEDIR)/lfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT)
  45. rm $(BASEDIR)/lfs-pdf.fo
  46. nochunks:
  47. xsltproc --xinclude --nonet -stringparam profile.condition html \
  48. --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
  49. stylesheets/lfs-nochunks.xsl index.xml
  50. tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
  51. sed -i -e "s@text/html@application/xhtml+xml@g" \
  52. $(BASEDIR)/$(NOCHUNKS_OUTPUT)
  53. if [ ! -e $(BASEDIR)/images ]; then \
  54. mkdir -p $(BASEDIR)/images; \
  55. fi;
  56. cp $(XSLROOTDIR)/images/*.png \
  57. $(BASEDIR)/images
  58. cd $(BASEDIR)/; sed -i -e "s@../images@images@g" \
  59. *.html
  60. validate:
  61. xmllint --noout --nonet --xinclude --postvalid index.xml