X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=make%2Fwebsite.make;h=59ac71d8184cb555a4911aea631898320eea0aae;hb=e885a8cabc8335f1c46c48e92d4048e9d258cd10;hp=36fd7a55a57f7a2910cc09653979d00ad4e81339;hpb=4615135bf10e1a78b3658162575c46aca2f73a38;p=lilypond.git diff --git a/make/website.make b/make/website.make index 36fd7a55a5..59ac71d818 100644 --- a/make/website.make +++ b/make/website.make @@ -7,7 +7,7 @@ ifeq ($(WEBSITE_ONLY_BUILD),1) ### for lilypond.org - TOP_SRC_DIR=$(HOME)/lilypond/lilypond-git + TOP_SRC_DIR=$(LILYPOND_GIT) TRUSTED_DIR=$(HOME)/lilypond/trusted-scripts top-src-dir=$(TOP_SRC_DIR) depth=. @@ -16,7 +16,8 @@ ifeq ($(WEBSITE_ONLY_BUILD),1) texi2html-init-file=$(trusted-dir)/lilypond-texi2html.init top-htaccess=$(trusted-dir)/lilypond.org.htaccess dir-htaccess=$(trusted-dir)/website-dir.htaccess - TEXI2HTML_PROGRAM=$(HOME)/usr/bin/texi2html + # grab it from PATH + TEXI2HTML_PROGRAM=texi2html PYTHON=python PYTHONPATH=$(TRUSTED_DIR) else @@ -73,6 +74,7 @@ WEB_BIBS=python $(script-dir)/bib2texi.py EXAMPLES=$(LILYPOND_WEB_MEDIA_GIT)/ly-examples PICTURES=$(LILYPOND_WEB_MEDIA_GIT)/pictures +PDFS=$(LILYPOND_WEB_MEDIA_GIT)/pdf SERVER_FILES=$(top-src-dir)/Documentation/web/server @@ -98,6 +100,34 @@ 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 "/^@include[[: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,$<) > $@.dep ) && + +# This is where we import the .dep files so that `make' knows about +# the various dependencies. +-include dummy.dep $(wildcard $(OUT)/*.dep) $(wildcard $(OUT)/*/*.dep) + + ################### ### Generated files @@ -117,6 +147,9 @@ misc-files = $(OUT)/.htaccess \ picture-src-files := $(notdir $(wildcard $(PICTURES)/*)) picture-files = $(picture-src-files:%=$(OUT)/website/pictures/%) +pdf-src-files := $(notdir $(wildcard $(PDFS)/*)) +pdf-files = $(pdf-src-files:%=$(OUT)/website/pdf/%) + post-files = $(OUT)/website/index.html texinfo-files = $(OUT)/index.html $(WEB_LANGS:%=$(OUT)/%/index.html) @@ -131,7 +164,7 @@ xref-files = $(MANUALS_BASE:%=$(OUT)/%.xref-map) .PHONY: website website-bibs website-css website-examples website-misc \ website-pictures website-post website-test website-texinfo \ - website-version website-xrefs check-setup + website-version website-xrefs check-setup website-pdf check-setup: ifeq ($(LILYPOND_WEB_MEDIA_GIT),) @@ -139,7 +172,7 @@ ifeq ($(LILYPOND_WEB_MEDIA_GIT),) exit 1 endif -website: check-setup website-post website-examples website-pictures website-css website-misc +website: check-setup website-post website-examples website-pictures website-css website-misc website-pdf website-bibs: website-version $(OUT) $(bib-files) @@ -151,6 +184,8 @@ website-misc: $(OUT)/website $(misc-files) website-pictures: $(OUT)/website/pictures $(OUT)/pictures $(picture-files) +website-pdf: $(OUT)/website/pdf $(pdf-files) + website-post: website-texinfo $(post-files) website-test: @@ -167,17 +202,17 @@ website-xrefs: website-version $(OUT) $(xref-files) ### Rules # Directories -$(OUT) $(OUT)/website $(OUT)/website/css $(OUT)/website/ly-examples $(OUT)/website/pictures: %: +$(OUT) $(OUT)/website $(OUT)/website/css $(OUT)/website/ly-examples $(OUT)/website/pictures $(OUT)/website/pdf: %: mkdir -p $@ $(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 +246,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)" $$<; ) \ )) @@ -237,6 +272,9 @@ $(example-files): $(OUT)/website/ly-examples/%: $(EXAMPLES)/% $(picture-files): $(OUT)/website/pictures/%: $(PICTURES)/% cp $< $@ +$(pdf-files): $(OUT)/website/pdf/%: $(PDFS)/% + cp $< $@ + $(OUT)/website/favicon.ico: $(SERVER_FILES)/favicon.ico cp $< $@