[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: DDP CVS commit by pmachard: ddp/manuals.sgml/repository-howto/fr



On Wed, Apr 13, 2005 at 10:25:54PM +0200, Pierre Machard wrote:
> sorry for making the work on my side our emails arrive with a 2 minute
> delay...;-(

Don't worry. So it's now your fault when building fails :-))

> On Wed, Apr 13, 2005 at 10:04:33PM +0200, Jens Seidel wrote:
> > all: html pdf # dvi ps # god damn dvi and ps don't work
> > 
> > $(manual).en.xml: $(manual).xml
> > 	ln -sf $(manual).xml $@
> 
> Not a bad idea.

But it used an ugly link and changes files from .pdf to .en.pdf. Your
version is better.

> > 
> > publish: all
> > 	test -d $(PUBLISHDIR)/$(manual) || install -d -m 755 $(PUBLISHDIR)/$(manual)
> > 	rm -f $(PUBLISHDIR)/$(manual)/*.html
> > 	@$(foreach fmt,.html .pdf .dvi .ps,\
> > 	   $(foreach lang,$(LANGS),\
> > 	     install -p -m 644 $(manual).$(lang).html $(PUBLISHDIR)/$(manual);\
> > 	     install -p -m 644 $(manual).pdf $(PUBLISHDIR)/$(manual);\
> > 	     install -p -m 644 $(manual).dvi $(PUBLISHDIR)/$(manual);\
> >  	     install -p -m 644 $(manual).ps $(PUBLISHDIR)/$(manual)))
> 
> The problem here is that you only clean html files for an unknown
> reason. I've cleaned it in the Makefile I commited.
> 
> Why do not you use $fmt instead of .pdf,.dvi. etc ?

A mistake on my side. Please note that your code uses bashism
 rm -f $(PUBLISHDIR)/$(manualdir)/*.{html,pdf,dvi,ps}
which I removed (you will find this version attached, please check and
commit).

> > validate:
> > 	xmllint --noout --loaddtd --catalogs $(sources)
> 
> With that rule you only validate the first file. Anyway I am unsure that
> this rule is ran.

I wasn't sure about this.

> My clean target is really dirty.

Maybe you want to use my approach? It's your decision, both work.

PS: I know that my hack is not perfect but it allows a clean build. I don't
know why passivetex has problems to calculate differences of lengths
but according to the bug report it's not easy to fix.
Maybe it's possible to use perl script to preprocess the xml file and
to calculate these differences but this would be very ugly.

Jens

Index: Makefile
===================================================================
RCS file: /cvs/debian-doc/ddp/manuals.sgml/repository-howto/Makefile,v
retrieving revision 1.12
diff -u -r1.12 Makefile
--- Makefile	13 Apr 2005 20:00:34 -0000	1.12
+++ Makefile	13 Apr 2005 20:38:59 -0000
@@ -17,7 +17,8 @@
 
 publish: all
 	test -d $(PUBLISHDIR)/$(manualdir) || install -d -m 755 $(PUBLISHDIR)/$(manualdir)
-	rm -f $(PUBLISHDIR)/$(manualdir)/*.{html,pdf,dvi,ps}
+	dir="$(PUBLISHDIR)/$(manualdir)" && \
+	rm -f "$$dir"/*.html "$$dir"/*.pdf "$$dir"/*.ps "$$dir"/*.dvi
 	for built in $(manual); do \
 	install -p -m 644 $$built.html $(PUBLISHDIR)/$(manualdir) ; \
 	install -p -m 644 $$built.pdf $(PUBLISHDIR)/$(manualdir) ; \
@@ -31,13 +32,14 @@
 	xmllint --noout --loaddtd --catalogs $$checking ;\
 	done
 
-html:  $(addsuffix .html,$(manual))
+html fo dvi ps pdf: %: $(addsuffix .%,$(manual))
+
+
 %.html: %.xml
 	xsltproc --catalogs -o $@ \
 	/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/docbook.xsl \
 	$<
 
-fo: $(addsuffix .fo,$(manual))
 %.fo:  %.xml
 	xsltproc --catalogs -o $@ \
 	/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/fo/docbook.xsl \
@@ -47,17 +49,14 @@
 	# /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/fo/pagesetup.xsl
 	sed 's/margin-left="1in - -4pc"/margin-left="1in"/g' $@ > $@.tmp && mv $@.tmp $@
 
-dvi: $(addsuffix .dvi,$(manual))
 %.dvi:  %.fo
 	# needs being run twice to generate toc
 	xmltex --interaction=batchmode $<
 	xmltex --interaction=batchmode $<
 
-ps: $(addsuffix .ps,$(manual))
 %.ps:  %.dvi
 	dvips $<
 
-pdf: $(addsuffix .pdf,$(manual))
 %.pdf: %.fo
 	# needs being run twice to generate toc
 	# yes, this is suboptimal but it's the easiest way
@@ -66,7 +65,9 @@
 
 clean distclean:
 	for removal in $(manual); do \
-	 rm -f $$removal.{aux,html,dvi,fo,log,pdf,ps,out,toc} ; \
+	  for suf in aux html dvi fo log pdf ps out toc; do \
+	    rm -f $$removal.$$suf; \
+	  done \
 	done
 	rm -f *~ .*~ core tsa* ;
 	

Reply to: