Makefile 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. 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 images/*.png $(BASEDIR)/images
  18. cd $(BASEDIR)/; sed -i -e "s@../stylesheets@stylesheets@g" \
  19. *.html
  20. cd $(BASEDIR)/; sed -i -e "s@../images@images@g" \
  21. *.html
  22. for filename in `find $(BASEDIR) -name "*.html"`; do \
  23. tidy -config tidy.conf $$filename; \
  24. true; \
  25. sh obfuscate.sh $$filename; \
  26. sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \
  27. done;
  28. $(MAKE) wget-list
  29. wget-list:
  30. mkdir -p $(BASEDIR)
  31. xsltproc --xinclude --nonet stylesheets/wget-list.xsl chapter03/chapter03.xml > $(BASEDIR)/wget-list
  32. # Uncomment this for testing and stable versions
  33. #pdf:
  34. # xsltproc --xinclude --nonet --stringparam profile.condition pdf \
  35. # --output $(BASEDIR)/lfs-pdf.xml stylesheets/lfs-profile.xsl index.xml
  36. # xsltproc --nonet --output $(BASEDIR)/lfs-pdf.fo stylesheets/lfs-pdf.xsl \
  37. # $(BASEDIR)/lfs-pdf.xml
  38. # sed -i -e "s/inherit/all/" $(BASEDIR)/lfs-pdf.fo
  39. # fop.sh $(BASEDIR)/lfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT)
  40. # rm $(BASEDIR)/lfs-pdf.xml $(BASEDIR)/lfs-pdf.fo
  41. # Remove this for testing and stable versions
  42. pdf-orig:
  43. xsltproc --xinclude --nonet --output $(BASEDIR)/fop-lfs-pdf.fo \
  44. stylesheets/lfs-pdf.xsl index.xml
  45. sed -i -e 's/span="inherit"/span="all"/' $(BASEDIR)/fop-lfs-pdf.fo
  46. fop.sh $(BASEDIR)/fop-lfs-pdf.fo $(BASEDIR)/fop-$(PDF_OUTPUT)
  47. # rm $(BASEDIR)/fop-lfs-pdf.fo
  48. pdf:
  49. xsltproc --xinclude --nonet --output $(BASEDIR)/fop1-lfs-pdf.fo \
  50. stylesheets/lfs-pdf.xsl index.xml
  51. sed -i -e 's/span="inherit"/span="all"/' $(BASEDIR)/fop1-lfs-pdf.fo
  52. FOP_HOME=~/cosas/fop-0,93 && ~/cosas/fop-0.93/fop $(BASEDIR)/fop1-lfs-pdf.fo $(BASEDIR)/fop1-$(PDF_OUTPUT)
  53. # rm $(BASEDIR)/fop1-lfs-pdf.fo
  54. nochunks:
  55. xsltproc --xinclude --nonet -stringparam profile.condition html \
  56. --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
  57. stylesheets/lfs-nochunks.xsl index.xml
  58. tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
  59. sh obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT)
  60. sed -i -e "s@text/html@application/xhtml+xml@g" \
  61. $(BASEDIR)/$(NOCHUNKS_OUTPUT)
  62. dump-commands:
  63. xsltproc --xinclude --nonet --output $(DUMPDIR)/ \
  64. stylesheets/dump-commands.xsl index.xml
  65. validate:
  66. xmllint --noout --nonet --xinclude --postvalid index.xml