Makefile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. BASEDIR=~/lfs-book
  2. DUMPDIR=~/lfs-commands
  3. CHUNK_QUIET=0
  4. PDF_OUTPUT=LFS-BOOK.pdf
  5. NOCHUNKS_OUTPUT=LFS-BOOK.html
  6. XSLROOTDIR=/usr/share/xml/docbook/xsl-stylesheets-current
  7. lfs:
  8. xsltproc --xinclude --nonet -stringparam profile.condition html \
  9. -stringparam chunk.quietly $(CHUNK_QUIET) -stringparam base.dir $(BASEDIR)/ \
  10. stylesheets/lfs-chunked.xsl 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. *.html
  22. cd $(BASEDIR)/; sed -i -e "s@../images@images@g" \
  23. *.html
  24. for filename in `find $(BASEDIR) -name "*.html"`; do \
  25. tidy -config tidy.conf $$filename; \
  26. true; \
  27. sh obfuscate.sh $$filename; \
  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. nochunks:
  40. xsltproc --xinclude --nonet -stringparam profile.condition html \
  41. --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
  42. stylesheets/lfs-nochunks.xsl index.xml
  43. tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
  44. sh obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT)
  45. sed -i -e "s@text/html@application/xhtml+xml@g" \
  46. $(BASEDIR)/$(NOCHUNKS_OUTPUT)
  47. dump-commands:
  48. xsltproc --xinclude --nonet --output $(DUMPDIR)/ \
  49. stylesheets/dump-commands.xsl index.xml
  50. validate:
  51. xmllint --noout --nonet --xinclude --postvalid index.xml