r7358 - trunk/BOOK

Dan Nicholson dbn.lists at gmail.com
Mon Apr 14 06:25:20 PDT 2008


On Mon, Apr 14, 2008 at 01:28:35PM +0600, Alexander E. Patrakov wrote:
> 2008/4/14, Dan Nicholson <dbn.lists at gmail.com>:
> >  Personally, I think this is a worthwhile optimization even if there
> >  are corner cases where you have to run `make clean' first.
> >
> >  If this is really not something people want, I can easily change it so
> >  that validxml is always run. I certainly didn't introduce these
> >  changes to make people's lives more difficult.
>
> I think it is still possible to avoid both running validxml
> unconditionally and an outdated list of dependencies, at the cost of
> running the equivalent of "find" unconditionally. Something like this
> quick and dirty solution:
>
> Index: Makefile
> ===================================================================
> --- Makefile	(revision 7380)
> +++ Makefile	(working copy)
> @@ -13,6 +13,8 @@
>  PDF_OUTPUT = BLFS-BOOK.pdf
>  NOCHUNKS_OUTPUT = BLFS-BOOK.html
>
> +ALLXML := $(filter-out $(RENDERTMP)/%, $(wildcard *.xml */*.xml
> */*/*.xml */*/*/*.xml))

Oh, that's nice. Although, it'd be nice to ignore .svn directories and
it'd be nice to add .xsl files so that you get rebuilds on stylesheet
changes. I suppose that part could be in a separate ALLXSL variable, but
I don't know how to handle the .svn part. Oh, it looks like $(wildcard)
won't descend into hidden directories. So, I think this is good with an
addition to look up the *.xsl files, too.

Here's is what I have after noticing that one deeper level in
stylesheets had .xml and .xsl files. It seems to be working for me.

--
Dan

diff --git a/BOOK/Makefile b/BOOK/Makefile
index b25a286..9f5bb43 100644
--- a/BOOK/Makefile
+++ b/BOOK/Makefile
@@ -13,6 +13,11 @@ ROOT_ID =
 PDF_OUTPUT = BLFS-BOOK.pdf
 NOCHUNKS_OUTPUT = BLFS-BOOK.html
 
+ALLXML := $(filter-out $(RENDERTMP)/%, \
+	$(wildcard *.xml */*.xml */*/*.xml */*/*/*.xml */*/*/*/*.xml))
+ALLXSL := $(filter-out $(RENDERTMP)/%, \
+	$(wildcard *.xsl */*.xsl */*/*.xsl */*/*/*.xsl */*/*/*/*.xsl))
+
 ifdef V
   Q =
 else
@@ -97,7 +102,7 @@ clean:
 	$(Q)rmdir $(RENDERTMP) 2>/dev/null || :
 
 validxml: $(RENDERTMP)/blfs-full.xml
-$(RENDERTMP)/blfs-full.xml: index.xml general.ent
+$(RENDERTMP)/blfs-full.xml: general.ent $(ALLXML) $(ALLXSL)
 	@echo "Validating the book..."
 	$(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP)
 	$(Q)xmllint --nonet --noent --xinclude --postvalid \



More information about the blfs-dev mailing list