lilypond-devel
[Top][All Lists]
Advanced

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

Build: Dependencies for make website (issue 2027). (issue 5493074)


From: julien . rioux
Subject: Build: Dependencies for make website (issue 2027). (issue 5493074)
Date: Sun, 18 Dec 2011 23:13:12 +0000

Reviewers: ,

Description:
Build: Dependencies for make website (issue 2027).

Please review this at http://codereview.appspot.com/5493074/

Affected files:
  M make/website.make


Index: make/website.make
diff --git a/make/website.make b/make/website.make
index d6d9ef7a12a09b921b922214370820e51edae311..fd92e52857cba63981b759c10291b92f664003e2 100644
--- a/make/website.make
+++ b/make/website.make
@@ -98,6 +98,32 @@ MANUALS_WEB := web.texi $(WEB_LANGS:%=web.%.texi)
 MANUALS_BASE = $(basename $(MANUALS) $(MANUALS_WEB))


+#######################
+### Dependency tracking
+
+# Find the file $(1) within the texinfo include dirs and return its path.
+# If not found, i.e. it is a generated file, then the file is ignored.
+find-texi = \
+$(firstword \
+       $(wildcard $(dir $<)$(1)) \
+       $(wildcard $(top-src-dir)/Documentation/$(1)) \
+)
+
+# Recursively scan the file $(1) for @include, search for included files
+# within the texinfo include dirs, and return all dependencies.
+scan-texi = \
+ $(foreach f, $(shell echo | sed -ne "/address@hidden:space:]]/s/@include//p" $(1)), \
+       $(call find-texi,$(f)) \
+       $(call scan-texi,$(call find-texi,$(f))) \
+)
+
+# Find dependencies for the target $@, based on the texinfo source file $<,
+# and write the dependencies to a .dep file.
+DO_TEXI_DEP = ( mkdir -p $(dir $@) && echo ./$@: $(call scan-texi,$<) > address@hidden ) &&
+
+-include dummy.dep $(wildcard $(OUT)/*.dep) $(wildcard $(OUT)/*/*.dep)
+
+
 ###################
 ### Generated files

@@ -135,7 +161,7 @@ xref-files = $(MANUALS_BASE:%=$(OUT)/%.xref-map)

 check-setup:
 ifeq ($(LILYPOND_WEB_MEDIA_GIT),)
-       echo "Need a $LILYPOND_WEB_MEDIA_GIT environment variable!"
+       echo "Need a LILYPOND_WEB_MEDIA_GIT environment variable!"
        exit 1
 endif

@@ -160,7 +186,7 @@ website-texinfo: website-version website-xrefs website-bibs $(texinfo-files)

 website-version: $(OUT) $(version-files)

-website-xrefs: website-version $(OUT) $(xref-files)
+website-xrefs: website-version website-bibs $(OUT) $(xref-files)


 #########
@@ -174,10 +200,10 @@ $(OUT)/pictures: $(OUT)/website/pictures
        ln -sf website/pictures $(OUT)/pictures

 # Generated itexi files
-$(OUT)/version.itexi: #FIXME: add dependencies
+$(OUT)/version.itexi: $(top-src-dir)/VERSION
        $(CREATE_VERSION) $(top-src-dir) > $(OUT)/version.itexi

-$(OUT)/weblinks.itexi: #FIXME: add dependencies
+$(OUT)/weblinks.itexi: $(top-src-dir)/VERSION
        $(CREATE_WEBLINKS) $(top-src-dir) > $(OUT)/weblinks.itexi

 $(bib-files): $(OUT)/%.itexi: $(top-src-dir)/Documentation/web/%.bib
@@ -211,12 +237,12 @@ $(OUT)/web.%.xref-map: $(top-src-dir)/Documentation/%/web.texi
        $(DO_TEXI_DEP) $(EXTRACT_TEXI_FILENAMES) --split=node $<

 # Build the English website
-$(OUT)/index.html: $(top-src-dir)/Documentation/web.texi
+$(OUT)/index.html: $(top-src-dir)/Documentation/web.texi $(xref-files)
        $(DO_TEXI_DEP) $(TEXI2HTML) $<

 # Build translated websites
 $(eval $(foreach l,$(WEB_LANGS),\
-$(eval $(OUT)/$(l)/index.html: $(top-src-dir)/Documentation/$(l)/web.texi; \ +$(eval $(OUT)/$(l)/index.html: $(top-src-dir)/Documentation/$(l)/web.texi $(xref-files); \
        $$(DO_TEXI_DEP) $$(TEXI2HTML) --lang="$(l)" $$<; ) \
 ))






reply via email to

[Prev in Thread] Current Thread [Next in Thread]