From 9e9cd12db900742ac4dd1b23f1375da3b39dbc5a Mon Sep 17 00:00:00 2001 From: John Mandereau Date: Thu, 21 Feb 2008 19:40:37 +0100 Subject: [PATCH] Fix docs building - use $(OUT_PNG_IMAGES) and $(OUT_PDF_IMAGES) prerequisites more appropriately; - fix $(INFO_IMAGES_DIR) stuff with a .dep file and rules in texinfo-vars.rules; - define .texi/.nexi ly rules depending of out==www, instead of disable them later in main makefile. --- Documentation/user/GNUmakefile | 33 ++++------------------------ make/ly-rules.make | 6 +++++ stepmake/stepmake/texinfo-rules.make | 32 +++++++++++++++++++++++++-- 3 files changed, 40 insertions(+), 31 deletions(-) diff --git a/Documentation/user/GNUmakefile b/Documentation/user/GNUmakefile index 5994526b73..f94800161c 100644 --- a/Documentation/user/GNUmakefile +++ b/Documentation/user/GNUmakefile @@ -43,7 +43,6 @@ export TEXINPUTS include $(depth)/make/stepmake.make info: $(INFO_FILES) - @echo export LILYPOND_DATADIR=$(LILYPOND_DATADIR) @echo export PYTHONPATH=$(PYTHONPATH) @@ -55,23 +54,6 @@ ifeq ($(out),www) # This builds all .info targets with images, in out-www. # Viewable with a recent Emacs, doing: C-u C-h i out-www/lilypond.info -# Cancel the special, non-image info generation rule that skips images: -$(outdir)/%.info: $(outdir)/%.nexi - -# "makeinfo --info" MUST be able to read PNGs from CWD for info images -# to work, hence lilypond/ -> $(outdir)/ symlink. -# $(outdir)/lilypond/*.png symlinks are only needed to view -# out-www/*.info with Emacs -- HTML docs no longer need these -# symlinks, see replace_symlinks_urls in -# buildscripts/add_html_footer.py. -$(outdir)/%.info: lilypond -lilypond: $(OUT_PNG_IMAGES) - rm -f lilypond - ln -s $(outdir) lilypond - mkdir -p $(outdir)/lilypond - find $(outdir)/lilypond/ -name '*'.png | xargs rm -f - (cd $(outdir)/lilypond/ ; ln -sf ../*.png . ) - local-install-info: info -$(INSTALL) -d $(DESTDIR)$(infodir) ifneq ($(patsubst %/local,%,$(DESTDIR)$(prefix)),/usr) @@ -105,9 +87,6 @@ local-uninstall-WWW: else # out!=www -# Cancel the default info generation rule that generates images: -$(outdir)/%.info: $(outdir)/%.texi - local-install-info: info -$(INSTALL) -d $(DESTDIR)$(package_infodir) ifneq ($(patsubst %/local,%,$(DESTDIR)$(prefix)),/usr) @@ -152,7 +131,7 @@ local-uninstall-WWW: local-uninstall-info default: local-clean: - rm -f lilypond + rm -f $(INFO_IMAGES_DIR) local-help: extra-local-help @@ -172,16 +151,13 @@ $(outdir)/lilypond.nexi: $(outdir)/lilypond-internals.texi # Split manuals in HTML # $(outdir)/lilypond/index.html: $(OUT_PNG_IMAGES) $(OUT_EPS_IMAGES) -$(outdir)/lilypond-program/index.html: $(OUT_PNG_IMAGES) $(OUT_EPS_IMAGES) $(outdir)/lilypond-learning/index.html: $(OUT_PNG_IMAGES) $(OUT_EPS_IMAGES) -$(outdir)/music-glossary/index.html: $(OUT_PNG_IMAGES) $(OUT_EPS_IMAGES) # # Manuals in one big HTML page # $(outdir)/lilypond-big-page.html: $(OUT_PNG_IMAGES) -$(outdir)/lilypond-program-big-page.html: $(OUT_PNG_IMAGES) $(outdir)/lilypond-learning-big-page.html: $(OUT_PNG_IMAGES) $(outdir)/lilypond.xml: $(outdir)/lilypond.texi @@ -192,8 +168,7 @@ $(outdir)/lilypond-internals/lilypond-internals.xml: $(outdir)/lilypond-internal mkdir -p $(dir $@) $(MAKEINFO) --output=$(outdir)/lilypond-internals --docbook $< -$(outdir)/lilypond.pdf $(outdir)/lilypond-program.pdf: $(OUT_PDF_IMAGES) $(OUT_PNG_IMAGES) -$(outdir)/lilypond-learning.pdf $(outdir)/music-glossary.pdf: $(OUT_PDF_IMAGES) $(OUT_PNG_IMAGES) +$(outdir)/lilypond.pdf $(outdir)/lilypond-learning.pdf: $(OUT_PDF_IMAGES) $(outdir)/%.png: %.png convert -depth 8 -geometry 50x50% $< $@ @@ -238,8 +213,8 @@ $(outdir)/%.bib: %.bib $(top-build-dir)/mf/$(outconfbase)/feta16list.ly: $(MAKE) -C $(top-src-dir)/mf -$(outdir)/lilypond.texi $(outdir)/lilypond-program.texi $(outdir)/lilypond-learning.texi: $(ITELY_FILES) $(ITEXI_FILES) -$(outdir)/lilypond.nexi $(outdir)/lilypond-program.nexi $(outdir)/lilypond-learning.nexi: $(ITELY_FILES) $(ITEXI_FILES) +$(outdir)/lilypond.texi $(outdir)/lilypond-program.texi $(outdir)/lilypond-learning.texi $(outdir)/music-glossary.texi: $(ITELY_FILES) $(ITEXI_FILES) +$(outdir)/lilypond.nexi $(outdir)/lilypond-program.nexi $(outdir)/lilypond-learning.nexi $(outdir)/music-glossary.nexi: $(ITELY_FILES) $(ITEXI_FILES) # Rules for the automatically generated documentation diff --git a/make/ly-rules.make b/make/ly-rules.make index 2e9e5ff022..1f63f9e4a2 100644 --- a/make/ly-rules.make +++ b/make/ly-rules.make @@ -4,6 +4,8 @@ $(outdir)/%.latex: %.doc $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND_BINARY) $(LILYPOND_BOOK_INCLUDES)' --output=$(outdir) $(LILYPOND_BOOK_FLAGS) $< +ifeq ($(out),www) + # don't do ``cd $(outdir)'', and assume that $(outdir)/.. is the src dir. # it is not, for --srcdir builds $(outdir)/%.texi: %.tely @@ -16,6 +18,8 @@ $(outdir)/%.texi: $(outdir)/%.tely # DON'T REMOVE SOURCE FILES, otherwise the .TEXI ALWAYS OUT OF DATE. # rm -f $< +else # out != www + # nexi: n[o-lilypond t]exi # for plain info doco: don't run lilypond $(outdir)/%.nexi: %.tely @@ -26,6 +30,8 @@ $(outdir)/%.nexi: %.tely $(outdir)/%.info: $(outdir)/%.nexi $(MAKEINFO) -I $(outdir) --output=$(outdir)/$(*F).info $< +endif # out != www + $(outdir)/%.html.omf: %.tely $(call GENERATE_OMF,html) diff --git a/stepmake/stepmake/texinfo-rules.make b/stepmake/stepmake/texinfo-rules.make index c373562079..fbf05402d6 100644 --- a/stepmake/stepmake/texinfo-rules.make +++ b/stepmake/stepmake/texinfo-rules.make @@ -1,8 +1,36 @@ .SUFFIXES: .html .info .texi .texinfo -$(outdir)/%.info: $(outdir)/%.texi -# makeinfo MUST have PNGs in cwd for info images to work +# "makeinfo --info" MUST be able to read PNGs from CWD for info images +# to work, hence $(INFO_IMAGES_DIR) -> $(outdir)/ symlink. +# $(outdir)/$(INFO_IMAGES_DIR)/*.png symlinks are only needed to view +# out-www/*.info with Emacs -- HTML docs no longer need these +# symlinks, see replace_symlinks_urls in +# buildscripts/add_html_footer.py. + +ifneq ($(INFO_IMAGES_DIR),) + +# make dereferences symlinks, and $(INFO_IMAGES_DIR) is a symlink +# to $(outdir), so we can't use directly $(INFO_IMAGES_DIR) as a +# prerequisite, otherwise %.info are always outdated (because older +# than $(outdir), hence this .dep file + +$(outdir)/%.info-images-dir.dep: $(outdir)/%.texi + rm -f $* + ln -s $(outdir) $* + mkdir -p $(outdir)/$* + find $(outdir)/$*/ -name '*'.png | xargs rm -f + (cd $(outdir)/$*/ ; ln -sf ../*.png . ) + touch $@ + +else + +$(outdir)/.info-images-dir.dep: + true + +endif + +$(outdir)/%.info: $(outdir)/%.texi $(outdir)/$(INFO_IMAGES_DIR).info-images-dir.dep $(MAKEINFO) -I$(outdir) --output=$@ $< $(outdir)/%-big-page.html: $(outdir)/%.texi -- 2.39.5