[Clfs-commits] [Cross-LFS]Cross-LFS Book branch, master, updated. 879785b301d55636dce86b7a66bc8b96cd74ede3

git git at cross-lfs.org
Sat Feb 26 09:24:48 PST 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Cross-LFS Book".

The branch, master has been updated
       via  879785b301d55636dce86b7a66bc8b96cd74ede3 (commit)
      from  b47a4a1d93d92208ef3ed33694b28a4eda285fe2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 879785b301d55636dce86b7a66bc8b96cd74ede3
Author: Joe Ciccone <jciccone at gmail.com>
Date:   Sat Feb 26 12:16:25 2011 -0500

    Rework the Makefile to be cleaner top-down. Also we now have the ability
    to specificy output directories for each target individually. Restructure
    the output to be much more segregated and neater.

diff --git a/.gitignore b/.gitignore
index 8944128..26f0418 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
-BOOK/render-output
+/BOOK/render-output
+/render/
diff --git a/BOOK/Makefile b/BOOK/Makefile
index 59032e7..025eed2 100644
--- a/BOOK/Makefile
+++ b/BOOK/Makefile
@@ -1,17 +1,21 @@
 TOP		:= $(PWD)
+RENDERDIR	:= $(TOP)/../render
 
-WORKDIR		:= $(TOP)/render-output
+VALIDATEDIR	:= $(RENDERDIR)/validate
+PROFILEDIR	:= $(RENDERDIR)/profile
 
-BASEDIR		:= $(WORKDIR)/cross-lfs-book
-DUMPDIR		:= $(WORKDIR)/cross-lfs-commands
-DLLISTDIR	:= $(WORKDIR)/cross-lfs-dllist
-RENDERTMP       := $(WORKDIR)/tmp
-CHUNK_QUIET	:= 1
-ROOT_ID	 :=
+HTMLDIR		:= $(RENDERDIR)/html
+NOCHUNKDIR	:= $(RENDERDIR)/nochunk
+
+FODIR		:= $(RENDERDIR)/fo
+PDFDIR		:= $(RENDERDIR)/pdf
+
+TROUBLEDIR	:= $(RENDERDIR)/trouble
+DUMPDIR		:= $(RENDERDIR)/commands
+DLLISTDIR	:= $(RENDERDIR)/download-list
 
-FG_GREEN	:= $(shell echo -e '\e[0;32m')
-FG_BLUE		:= $(shell echo -e '\e[0;34m')
-FG_DEFAULT	:= $(shell echo -e '\e[0;0m')
+CHUNK_QUIET	:= 1
+ROOT_ID		:=
 
 ARCHS		:= x86 x86_64 x86_64-64 \
 		   sparc sparc64 sparc64-64 \
@@ -19,41 +23,19 @@ ARCHS		:= x86 x86_64 x86_64-64 \
 		   ppc ppc64 \
 		   alpha
 
-ARCHS_VD_XML	:= $(ARCHS:%=%-validate_dump-xml)
-ARCHS_P_XML	:= $(ARCHS:%=%-profiled-xml)
-
-ARCHS_HTML	:= $(ARCHS:%=%-html)
-ARCHS_NOCHUNKS	:= $(ARCHS:%=%-nochunks)
-ARCHS_PDF	:= $(ARCHS:%=%-pdf)
-ARCHS_VALIDATE	:= $(ARCHS:%=%-validate)
-ARCHS_TROUBLE	:= $(ARCHS:%=%-trouble)
-ARCHS_DUMP	:= $(ARCHS:%=%-dump)
-ARCHS_DLLIST	:= $(ARCHS:%=%-dllist)
-
 ifdef V
   Q =
 else
   Q = @
 endif
 
-.PHONY: clfs lfs render nochunks pdf validate trouble dump-commands download-list
-clfs lfs: tmpdir render
-render: $(ARCHS_HTML) titlepage
-nochunks: tmpdir $(ARCHS_NOCHUNKS)
-pdf: tmpdir $(ARCHS_PDF)
-validate: $(ARCHS_VALIDATE)
-trouble: tmpdir $(ARCHS_TROUBLE)
-dump-commands: $(ARCHS_DUMP)
-download-list: $(ARCHS_DLLIST)
-
-.PHONY: tmpdir
-tmpdir:
-	$(Q)mkdir -p $(RENDERTMP)
+.PHONY: clfs lfs
+clfs lfs: html
 
 .PHONY: tidy tidy-f tidy-d
 ifeq ($(shell which tidy >/dev/null 2>&1 && echo yes),yes)
 tidy:
-	@$(MAKE) --no-print-directory tidy-d TIDY_DIR=$(BASEDIR)
+	@$(MAKE) --no-print-directory tidy-d TIDY_DIR=$(HTMLDIR)
 
 tidy-f:
 	@echo "Running tidy on F:$(shell basename $(TIDY_FILE))"
@@ -70,118 +52,163 @@ endif
 .PHONY: titlepage
 titlepage:
 	@echo "Rendering the top-level index..."
-	$(Q)xsltproc --nonet --output $(BASEDIR)/index.html \
-	  $(PWD)/stylesheets/top-index.xsl $(PWD)/index.xml
-	@$(MAKE) --no-print-directory tidy-f TIDY_FILE=$(BASEDIR)/index.html
-
+	$(Q)xsltproc --nonet --output $(HTMLDIR)/index.html \
+	  $(PWD)/stylesheets/top-index.xsl \
+	  $(PWD)/index.xml
+	@$(MAKE) --no-print-directory tidy-f TIDY_FILE=$(HTMLDIR)/index.html
 
+ARCHS_VD_XML := $(ARCHS:%=%-validate_dump-xml)
 .PHONY: $(ARCHS_VD_XML)
 $(ARCHS_VD_XML): override arch = $(@:%-validate_dump-xml=%)
-$(ARCHS_VD_XML): tmpdir
+$(ARCHS_VD_XML):
 	@echo "Validating $(arch) book..."
+	$(Q)mkdir -p $(VALIDATEDIR)
 	$(Q)xmllint --nonet --noent --xinclude --postvalid \
-	  -o $(RENDERTMP)/$(arch)-full.xml $(PWD)/$(arch)-index.xml
+	  -o $(VALIDATEDIR)/$(arch)-full.xml \
+	  $(PWD)/$(arch)-index.xml
 
+ARCHS_P_XML := $(ARCHS:%=%-profiled-xml)
 .PHONY: $(ARCHS_P_XML)
 $(ARCHS_P_XML): override arch = $(@:%-profiled-xml=%)
-$(ARCHS_P_XML): tmpdir
+$(ARCHS_P_XML):
 	@$(MAKE) --no-print-directory $(arch)-validate_dump-xml
-
-	@echo "Generating profiled $(arch) book for XHTML..."
+	@echo "Generating profiled $(arch) book..."
+	$(Q)mkdir -p $(PROFILEDIR)
 	$(Q)xsltproc --nonet --stringparam profile.condition html \
-	  --output $(RENDERTMP)/$(arch)-html.xml \
-	  $(PWD)/stylesheets/lfs-xsl/profile.xsl $(RENDERTMP)/$(arch)-full.xml
+	  --output $(PROFILEDIR)/$(arch)-html.xml \
+	  $(PWD)/stylesheets/lfs-xsl/profile.xsl \
+	  $(VALIDATEDIR)/$(arch)-full.xml
 
-.PHONY: $(ARCHS_HTML)
+ARCHS_HTML := $(ARCHS:%=%-html)
+.PHONY: html render $(ARCHS_HTML)
+html render: $(ARCHS_HTML) titlepage
 $(ARCHS_HTML): override arch = $(@:%-html=%)
-$(ARCHS_HTML): tmpdir
+$(ARCHS_HTML):
 	@$(MAKE) --no-print-directory $(arch)-profiled-xml
 
 	@echo "Rendering chunked XHTML of $(arch)..."
-	$(Q)mkdir -p $(BASEDIR)/$(arch)
+	$(Q)mkdir -p $(HTMLDIR)/$(arch)
 	$(Q)xsltproc --nonet -stringparam chunk.quietly $(CHUNK_QUIET) \
 	  -stringparam rootid "$(ROOT_ID)" \
-	  -stringparam base.dir $(BASEDIR)/$(arch)/ \
-	  $(PWD)/stylesheets/clfs-chunked.xsl $(RENDERTMP)/$(arch)-html.xml
+	  -stringparam base.dir $(HTMLDIR)/$(arch)/ \
+	  $(PWD)/stylesheets/clfs-chunked.xsl \
+	  $(PROFILEDIR)/$(arch)-html.xml
 
 	@echo "Copying CSS code and images for $(arch)..."
-	$(Q)mkdir -p $(BASEDIR)/$(arch)/stylesheets
-	$(Q)cp $(PWD)/stylesheets/lfs-xsl/*.css $(BASEDIR)/$(arch)/stylesheets
-	$(Q)sed -i -e "s at ../stylesheets at stylesheets@g" $(BASEDIR)/$(arch)/*.html
-	$(Q)mkdir -p $(BASEDIR)/$(arch)/images
-	$(Q)cp $(PWD)/images/*.png $(BASEDIR)/$(arch)/images
-	$(Q)sed -i -e "s at ../images at images@g" $(BASEDIR)/$(arch)/*.html
-
-	@$(MAKE) --no-print-directory tidy-d TIDY_DIR=$(BASEDIR)/$(arch)
-
-.PHONY: $(ARCHS_NOCHUNKS)
+	$(Q)mkdir -p $(HTMLDIR)/$(arch)/stylesheets
+	$(Q)cp $(PWD)/stylesheets/lfs-xsl/*.css $(HTMLDIR)/$(arch)/stylesheets
+	$(Q)sed -i -e "s at ../stylesheets at stylesheets@g" $(HTMLDIR)/$(arch)/*.html
+	$(Q)mkdir -p $(HTMLDIR)/$(arch)/images
+	$(Q)cp $(PWD)/images/*.png $(HTMLDIR)/$(arch)/images
+	$(Q)sed -i -e "s at ../images at images@g" $(HTMLDIR)/$(arch)/*.html
+
+	@$(MAKE) --no-print-directory tidy-d TIDY_DIR=$(HTMLDIR)/$(arch)
+
+ARCHS_NOCHUNKS := $(ARCHS:%=%-nochunks)
+.PHONY: nochunks $(ARCHS_NOCHUNKS)
+nochunks: $(ARCHS_NOCHUNKS)
 $(ARCHS_NOCHUNKS): override arch = $(@:%-nochunks=%)
-$(ARCHS_NOCHUNKS): tmpdir
+$(ARCHS_NOCHUNKS):
 	@$(MAKE) --no-print-directory $(arch)-profiled-xml
 
 	@echo "Rendering Single File HTML of $(arch)..."
-	$(Q)mkdir -p $(BASEDIR)
+	$(Q)mkdir -p $(NOCHUNKDIR)
 	$(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \
-	  --output $(BASEDIR)/CLFS-$(arch).html \
-	  $(PWD)/stylesheets/clfs-nochunks.xsl $(RENDERTMP)/$(arch)-html.xml
+	  --output $(NOCHUNKDIR)/CLFS-$(arch).html \
+	  $(PWD)/stylesheets/clfs-nochunks.xsl \
+	  $(PROFILEDIR)/$(arch)-html.xml
 
-	@$(MAKE) --no-print-directory tidy-f TIDY_FILE=$(BASEDIR)/CLFS-$(arch).html
+	@$(MAKE) --no-print-directory tidy-f TIDY_FILE=$(NOCHUNKDIR)/CLFS-$(arch).html
 
-.PHONY: $(ARCHS_PDF)
-$(ARCHS_PDF): override arch =  $(@:%-pdf=%)
-$(ARCHS_PDF): tmpdir
+ARCHS_FO := $(ARCHS:%=%-fo)
+.PHONY: fo $(ARCHS_FO)
+fo: $(ARCHS_FO)
+$(ARCHS_FO): override arch = $(@:%-fo=%)
+$(ARCHS_FO):
 	@$(MAKE) --no-print-directory $(arch)-profiled-xml
 
 	@echo "Generating FO file of $(arch)..."
+	@mkdir -p $(FODIR)
 	$(Q)xsltproc --nonet -stringparam rootid "$(ROOT_ID)" \
-	  --output $(RENDERTMP)/$(arch).fo $(PWD)/stylesheets/clfs-pdf.xsl \
-	  $(RENDERTMP)/$(arch)-html.xml
-	$(Q)sed -i -e 's/span="inherit"/span="all"/' $(RENDERTMP)/$(arch).fo
+	  --output $(FODIR)/$(arch).fo \
+	  $(PWD)/stylesheets/clfs-pdf.xsl \
+	  $(PROFILEDIR)/$(arch)-html.xml
+	$(Q)sed -i -e 's/span="inherit"/span="all"/' $(FODIR)/$(arch).fo
+
+ARCHS_PDF := $(ARCHS:%=%-pdf)
+.PHONY: pdf $(ARCHS_PDF)
+pdf: $(ARCHS_PDF)
+$(ARCHS_PDF): override arch = $(@:%-pdf=%)
+$(ARCHS_PDF):
+	@$(MAKE) --no-print-directory $(arch)-fo
 
 	@echo "Rendering PDF of $(arch)..."
-	$(Q)mkdir -p $(BASEDIR)
-	$(Q)fop $(RENDERTMP)/$(arch).fo $(BASEDIR)/CLFS-$(arch).pdf
+	$(Q)mkdir -p $(PDFDIR)
+	$(Q)fop $(FODIR)/$(arch).fo $(PDFDIR)/CLFS-$(arch).pdf
 
-.PHONY: $(ARCHS_VALIDATE)
+ARCHS_VALIDATE := $(ARCHS:%=%-validate)
+.PHONY: validate $(ARCHS_VALIDATE)
+validate: $(ARCHS_VALIDATE)
 $(ARCHS_VALIDATE): override arch =  $(@:%-validate=%)
 $(ARCHS_VALIDATE):
 	@echo "Validating $(arch)..."
-	$(Q)xmllint --xinclude --noout --nonet --postvalid $(PWD)/$(arch)-index.xml
-
-.PHONY: $(ARCHS_TROUBLE)
-$(ARCHS_TROUBLE): override trouble_arch =  $(@:%-trouble=%)
-$(ARCHS_TROUBLE): tmpdir
-	@echo "Troubleshooting $(trouble_arch)..."
+	$(Q)xmllint --xinclude --noout \
+	  --nonet --postvalid \
+	  $(PWD)/$(arch)-index.xml
+
+ARCHS_TROUBLE := $(ARCHS:%=%-trouble)
+.PHONY: trouble $(ARCHS_TROUBLE)
+trouble: $(ARCHS_TROUBLE)
+$(ARCHS_TROUBLE): override arch = $(@:%-trouble=%)
+$(ARCHS_TROUBLE):
+	@echo "Troubleshooting $(arch)..."
+	@mkdir -p $(TROUBLEDIR)
 	$(Q)xmllint --xinclude --nonet --postvalid \
-	  -o $(RENDERTMP)/dump-$(arch) $(PWD)/$(arch)-index.xml
-	$(Q)xmllint --xinclude --noout --nonet --valid $(RENDERTMP)/dump-$(arch)
-	@echo "You can now look at $(RENDERTMP)/dump-$(arch) to see the errors"
-
-.PHONY: $(ARCHS_DUMP)
-$(ARCHS_DUMP): override arch =  $(@:%-dump=%)
+	  -o $(TROUBLEDIR)/dump-$(arch) \
+	  $(PWD)/$(arch)-index.xml
+	$(Q)xmllint --xinclude --noout --nonet --valid \
+	  $(TROUBLEDIR)/dump-$(arch)
+	@echo "You can now look at $(TROUBLEDIR)/dump-$(arch) to see the errors"
+
+ARCHS_DUMP := $(ARCHS:%=%-dump)
+.PHONY: dump-commands $(ARCHS_DUMP)
+dump-commands: $(ARCHS_DUMP)
+$(ARCHS_DUMP): override arch = $(@:%-dump=%)
 $(ARCHS_DUMP):
 	@echo "Extracting commands from $(arch)..."
 	$(Q)mkdir -p $(DUMPDIR)/$(arch)
-	$(Q)xsltproc --xinclude --nonet --output $(DUMPDIR)/$(arch)/ \
-	  $(PWD)/stylesheets/dump-commands.xsl $(PWD)/$(arch)-index.xml
+	$(Q)xsltproc --xinclude --nonet \
+	  --output $(DUMPDIR)/$(arch)/ \
+	  $(PWD)/stylesheets/dump-commands.xsl \
+	  $(PWD)/$(arch)-index.xml
 
-.PHONY: $(ARCHS_DLLIST)
+ARCHS_DLLIST := $(ARCHS:%=%-dllist)
+.PHONY: download-list $(ARCHS_DLLIST)
+download-list: $(ARCHS_DLLIST)
 $(ARCHS_DLLIST): override arch = $(@:%-dllist=%)
 $(ARCHS_DLLIST):
 	@echo "Creating download list for $(arch)..."
 	$(Q)mkdir -p $(DLLISTDIR)
-	$(Q)xsltproc --xinclude --nonet --output $(DLLISTDIR)/$(arch)/dl.list \
-	  $(PWD)/stylesheets/wget.xsl $(PWD)/$(arch)-index.xml
-
+	$(Q)xsltproc --xinclude --nonet \
+	  --output $(DLLISTDIR)/$(arch).list \
+	  $(PWD)/stylesheets/wget.xsl \
+	  $(PWD)/$(arch)-index.xml
+
+FG_GREEN := $(shell echo -e '\e[0;32m')
+FG_BLUE := $(shell echo -e '\e[0;34m')
+FG_DEFAULT := $(shell echo -e '\e[0;0m')
 help:
-	@echo "Output: $(WORKDIR)"
+	@echo "Output: $(RENDERDIR)"
 	@echo
 	@echo "HTML Targets"
-	@echo "  $(FG_GREEN)clfs lfs tidy render titlepage $(FG_BLUE)$(ARCHS_HTML)$(FG_DEFAULT)"
+	@echo "  $(FG_GREEN)clfs lfs tidy html render titlepage $(FG_BLUE)$(ARCHS_HTML)$(FG_DEFAULT)"
 	@echo
 	@echo "NoChunks Targets"
 	@echo "  $(FG_GREEN)nochunks tidy $(FG_BLUE)$(ARCHS_NOCHUNKS)$(FG_DEFAULT)"
 	@echo
+	@echo "FO Targets"
+	@echo "  $(FG_GREEN)fo $(FG_BLUE)$(ARCHS_FO)$(FG_DEFAULT)"
+	@echo
 	@echo "PDF Targets"
 	@echo "  $(FG_GREEN)pdf $(FG_BLUE)$(ARCHS_PDF)$(FG_DEFAULT)"
 	@echo

-----------------------------------------------------------------------

Summary of changes:
 .gitignore    |    3 +-
 BOOK/Makefile |  217 ++++++++++++++++++++++++++++++++-------------------------
 2 files changed, 124 insertions(+), 96 deletions(-)


hooks/post-receive
-- 
Cross-LFS Book



More information about the Clfs-commits mailing list