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

Bug#542129: release-notes: etch Makefile builds regardless of the source status



On Tue, Aug 18, 2009 at 02:20:38AM +0200, Simon Paillard wrote:
> Package: release-notes
> 
> As noticed on www-master.d.o and reproduced locally, the Etch
> release-notes Makefile unconditionnaly rebuilds all the files everytime.
> 
> This takes a huge amount of time to build all languages then.
> 
> Same with PHONY targets commented.

Makefile partially reworked to build only if necessary:
* only a arch specific entity file triggers a new build
* output files names are now tagged with the arch

See patch attached, will be commited soon, if someone with more makefile
skills can review it (though tested sucessfully, except pdf/ps build
that I did not test).

-- 
Simon Paillard
Index: Makefile.common
===================================================================
--- Makefile.common	(révision 6929)
+++ Makefile.common	(copie de travail)
@@ -16,7 +16,7 @@
 # this can and will be overriden by a higher level makefile
 PUBLISHDIR := /org/www.debian.org/www/releases/$(release)
 
-sources := $(manual).$(currentlang).sgml ../$(manual).ent ../dynamic.ent
+sources := $(manual).$(currentlang).sgml ../$(manual).ent ../dynamic_$(architecture).ent
 
 export LANG=C
 # stupid debiandoc stuff uses strings in another language otherwise
@@ -68,28 +68,32 @@
 validate: $(manual).$(currentlang).sgml
 	nsgmls -ges -wall $(manual).$(currentlang).sgml
 
-html: $(manual).$(currentlang).html/index.$(currentlangcn).html
-$(manual).$(currentlang).html/index.$(currentlangcn).html: $(sources)
+html: $(manual).$(currentlang).$(architecture).html/index.$(currentlangcn).html
+$(manual).$(currentlang).$(architecture).html/index.$(currentlangcn).html: $(sources)
 # debiandoc-sgml v1.2.8 supports -C (not installed on build host)
-	debiandoc2html -c -l $(ddencoding) $< && \
-  for i in $(manual).$(currentlang).html/*.html; do \
+	ln -sf dynamic_$(architecture).ent ../dynamic.ent
+	debiandoc2html -b $(manual).$(currentlang).$(architecture) -c -l $(ddencoding) $< && \
+  for i in $(manual).$(currentlang).$(architecture).html/*.html; do \
     sed 's/.utf-8.html/.html/' $$i > $$i.tmp && rm $$i && \
     mv $$i.tmp $$(echo $$i | sed 's/.utf-8//'); \
   done
 
-text: $(manual).$(currentlang).txt
-$(manual).$(currentlang).txt: $(sources)
-	debiandoc2text -l $(ddencoding) $<
+text: $(manual).$(currentlang).$(architecture).txt
+$(manual).$(currentlang).$(architecture).txt: $(sources)
+	ln -sf dynamic_$(architecture).ent ../dynamic.ent
+	debiandoc2text -b $(manual).$(currentlang).$(architecture) -l $(ddencoding) $<
 
-$(manual).$(currentlang).info: $(sources)
-	debiandoc2info -l $(ddencoding) $<
+$(manual).$(currentlang).$(architecture).info: $(sources)
+	ln -sf dynamic_$(architecture).ent ../dynamic.ent
+	debiandoc2info -b $(manual).$(currentlang).$(architecture) -l $(ddencoding) $<
 # TODO: rename to .$(currentlang).info?
 
-$(manual).$(currentlang).ps $(manual).$(currentlang).dvi $(manual).$(currentlang).pdf: \
-  $(manual).$(currentlang).%: $(sources)
-	debiandoc2latex$* -l $(ddencoding) $<
+$(manual).$(currentlang).$(architecture).ps $(manual).$(currentlang).$(architecture).dvi $(manual).$(currentlang).$(architecture).pdf: \
+  $(manual).$(currentlang).$(architecture).%: $(sources)
+	ln -sf dynamic_$(architecture).ent ../dynamic.ent
+	debiandoc2latex$* -b $(manual).$(currentlang).$(architecture) -l $(ddencoding) $<
 
-ps dvi pdf info: %: $(manual).$(currentlang).%
+ps dvi pdf info: %: $(manual).$(currentlang).$(architecture).%
 
 # generate entities which are dynamically defined by the settings of this
 # build run
@@ -102,13 +106,9 @@
 	echo "<!entity architecture     \"$(architecture)\">" >> $@
 	echo "<!entity % $(architecture) \"INCLUDE\">" >> $@
 
-.PHONY: ../dynamic.ent
-../dynamic.ent: ../dynamic_$(architecture).ent
-	rm -f $@
-	ln -s $(notdir $<) $@
 
 clean distclean:
-	rm -rf $(manual)*.$(currentlang).html
+	rm -rf $(manual)*.$(currentlang).*html
 	for ext in txt ps dvi pdf out tex-in info\* aux log man tex toc sasp\* tpt; do rm -f $(manual)*.$$ext; done
 	rm -f head.tmp body.tmp
 	rm -f *~ .*~ core tsa* $(patsubst %.po,%.sgml,$(wildcard *.??*.po))
Index: Makefile
===================================================================
--- Makefile	(révision 6929)
+++ Makefile	(copie de travail)
@@ -41,13 +41,13 @@
 	  $(makedir) release-notes-$$arch; \
 	  for lang in $(LANGUAGES); do \
 	    $(makedir) release-notes-$$arch/$$lang; \
-            $(install_file) $$lang/release-notes.$$lang.html/* $(PUBLISHDIR)/$$arch/release-notes/; \
-            $(install_file) $$lang/release-notes.$$lang.txt $(PUBLISHDIR)/$$arch/; \
-            $(install_file) $$lang/release-notes.$$lang.pdf $(PUBLISHDIR)/$$arch/; \
-            $(install_file) $$lang/release-notes.$$lang.ps $(PUBLISHDIR)/$$arch/; \
-            $(install_file) $$lang/release-notes.$$lang.html/* release-notes-$$arch/$$lang; \
-            $(install_file) $$lang/release-notes.$$lang.txt release-notes-$$arch/$$lang; \
-            $(install_file) $$lang/release-notes.$$lang.pdf release-notes-$$arch/$$lang; \
+            $(install_file) $$lang/release-notes.$$lang.$$arch.html/* $(PUBLISHDIR)/$$arch/release-notes/; \
+            $(install_file) $$lang/release-notes.$$lang.$$arch.txt $(PUBLISHDIR)/$$arch/release-notes.$$lang.txt; \
+            $(install_file) $$lang/release-notes.$$lang.$$arch.pdf $(PUBLISHDIR)/$$arch/release-notes.$$lang.pdf; \
+            $(install_file) $$lang/release-notes.$$lang.$$arch.ps $(PUBLISHDIR)/$$arch/release-notes.$$lang.ps; \
+            $(install_file) $$lang/release-notes.$$lang.$$arch.html/* release-notes-$$arch/$$lang; \
+            $(install_file) $$lang/release-notes.$$lang.$$arch.txt release-notes-$$arch/$$lang/release-notes.$$lang.txt; \
+            $(install_file) $$lang/release-notes.$$lang.$$arch.pdf release-notes-$$arch/$$lang/release-notes.$$lang.txt; \
 	  done; \
           for i in $(PUBLISHDIR)/$$arch/release-notes/*.en.html; do \
             ln -sf `basename $$i` $${i%.en.html}.html; \
@@ -61,9 +61,9 @@
 	  $(MAKE) architecture=$$arch; \
 	  $(makedir) upgrade-$$arch; \
 	  for lang in $(LANGUAGES); do \
-	    $(install_file) $$lang/release-notes.$$lang.html/* upgrade-$$arch; \
-	    $(install_file) $$lang/release-notes.$$lang.txt upgrade-$$arch; \
-	    $(install_file) $$lang/release-notes.$$lang.pdf upgrade-$$arch; \
+	    $(install_file) $$lang/release-notes.$$lang.$$arch.html/* upgrade-$$arch; \
+	    $(install_file) $$lang/release-notes.$$lang.$$arch.txt upgrade-$$arch/release-notes.$$lang.txt; \
+	    $(install_file) $$lang/release-notes.$$lang.$$arch.pdf upgrade-$$arch/release-notes.$$lang.pdf; \
 	  done; \
 	  ln -sf index.en.html upgrade-$$arch/index.html; \
 	  ln -sf release-notes.en.txt upgrade-$$arch/Release-Notes; \

Reply to: