Makefile 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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-1.69.1
  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. $(MAKE) wget-list
  31. wget-list:
  32. xsltproc --xinclude --nonet stylesheets/wget-list.xsl index.xml > $(BASEDIR)/wget-list
  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. tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
  54. sh obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT)
  55. sed -i -e "s@text/html@application/xhtml+xml@g" \
  56. $(BASEDIR)/$(NOCHUNKS_OUTPUT)
  57. dump-commands:
  58. xsltproc --xinclude --nonet --output $(DUMPDIR)/ \
  59. stylesheets/dump-commands.xsl index.xml
  60. validate:
  61. xmllint --noout --nonet --xinclude --postvalid index.xml