Makefile 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. sh obfuscate.sh $$filename; \
  25. done;
  26. for filename in `find $(BASEDIR) -name "*.html"`; do \
  27. tidy -config tidy.conf $$filename; \
  28. true; \
  29. done;
  30. for filename in `find $(BASEDIR) -name "*.html"`; do \
  31. sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \
  32. done;
  33. # Uncomment this for testing and stable versions
  34. #pdf:
  35. # xsltproc --xinclude --nonet --stringparam profile.condition pdf \
  36. # --output $(BASEDIR)/lfs-pdf.xml stylesheets/lfs-profile.xsl index.xml
  37. # xsltproc --nonet --output $(BASEDIR)/lfs-pdf.fo stylesheets/lfs-pdf.xsl \
  38. # $(BASEDIR)/lfs-pdf.xml
  39. # sed -i -e "s/inherit/all/" $(BASEDIR)/lfs-pdf.fo
  40. # fop.sh $(BASEDIR)/lfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT)
  41. # rm $(BASEDIR)/lfs-pdf.xml $(BASEDIR)/lfs-pdf.fo
  42. # Remove this for testing and stable versions
  43. pdf:
  44. xsltproc --xinclude --nonet --output $(BASEDIR)/lfs-pdf.fo \
  45. stylesheets/lfs-pdf.xsl index.xml
  46. sed -i -e "s/inherit/all/" $(BASEDIR)/lfs-pdf.fo
  47. fop.sh $(BASEDIR)/lfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT)
  48. rm $(BASEDIR)/lfs-pdf.fo
  49. nochunks:
  50. xsltproc --xinclude --nonet -stringparam profile.condition html \
  51. --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
  52. stylesheets/lfs-nochunks.xsl index.xml
  53. sh obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT)
  54. tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
  55. sed -i -e "s@text/html@application/xhtml+xml@g" \
  56. $(BASEDIR)/$(NOCHUNKS_OUTPUT)
  57. validate:
  58. xmllint --noout --nonet --xinclude --postvalid index.xml