>From eeadbebd9e1be5a08c7d202e9a70707faa016e2d Mon Sep 17 00:00:00 2001 From: Julien Rioux Date: Sun, 2 Oct 2011 08:36:46 -0400 Subject: [PATCH] Makeify the website build. --- make/website.make | 85 +++++++++++++++++++++++++++++++--------------------- 1 files changed, 51 insertions(+), 34 deletions(-) diff --git a/make/website.make b/make/website.make index ba646b2..54b3738 100644 --- a/make/website.make +++ b/make/website.make @@ -54,11 +54,17 @@ endif ################################################################ OUT=out-website -WEB_LANGS = $(shell MAKEWEB=1 $(PYTHON) $(top-src-dir)/python/langdefs.py) +WEB_LANGS := $(shell MAKEWEB=1 $(PYTHON) $(top-src-dir)/python/langdefs.py) TEXI2HTML=ONLY_WEB=1 TOP_SRC_DIR=$(top-src-dir) DEPTH=$(depth) PERL_UNICODE=SD $(TEXI2HTML_PROGRAM) -EXTRACT_TEXI_FILENAMES=python $(script-dir)/extract_texi_filenames.py +EXTRACT_TEXI_FILENAMES=echo Generating $@ from $< && \ + $(PYTHON) $(script-dir)/extract_texi_filenames.py $(quiet-flag) \ + --known-missing-files=$(top-src-dir)/scripts/build/website-known-missing-files.txt \ + -I $(top-src-dir)/Documentation \ + -I $(dir $<) \ + -I $(OUT) \ + -o $(OUT) CREATE_VERSION=python $(script-dir)/create-version-itexi.py CREATE_WEBLINKS=python $(script-dir)/create-weblinks-itexi.py MASS_LINK=python $(script-dir)/mass-link.py @@ -68,46 +74,56 @@ WEB_BIBS=python $(script-dir)/bib2texi.py SERVER_FILES=$(top-src-dir)/Documentation/web/server # don't include web -MANUALS=$(wildcard $(top-src-dir)/Documentation/*.tely) -MANUALS+=$(top-src-dir)/Documentation/contributor.texi +MANUALS=$(MANUALS-tely) $(MANUALS-texi) $(MANUALS-lang) +MANUALS-tely:=$(notdir $(wildcard $(top-src-dir)/Documentation/*.tely)) +MANUALS-texi:=contributor.texi + +# harvest the translated manuals +$(eval $(foreach l,$(WEB_LANGS),\ + $(eval MANUALS-$(l) := $(notdir $(wildcard $(top-src-dir)/Documentation/$(l)/*.tely))) \ + $(eval MANUALS-lang += $(subst .tely,.$(l).tely,$(MANUALS-$(l)))) \ +)) + +WEB_MANUALS := web.texi $(addprefix web.,$(addsuffix .texi,$(WEB_LANGS))) +xref-map-files = $(addsuffix .xref-map,$(basename $(MANUALS))) \ + $(addsuffix .xref-map,$(basename $(WEB_MANUALS))) website-test: echo $(TEXI2HTML) -website-version: +website-version: $(OUT) $(OUT)/version.itexi $(OUT)/weblinks.itexi + +$(OUT): mkdir -p $(OUT) + +$(OUT)/version.itexi: #FIXME: add dep $(CREATE_VERSION) $(top-src-dir) > $(OUT)/version.itexi + +$(OUT)/weblinks.itexi: #FIXME: add dep $(CREATE_WEBLINKS) $(top-src-dir) > $(OUT)/weblinks.itexi -website-xrefs: website-version - for l in '' $(WEB_LANGS); do \ - len="$${#l}" ; \ - r="$$l"; \ - if [ "$$len" -gt "0" ] ; then \ - r="$$r"/; \ - fi ; \ - $(EXTRACT_TEXI_FILENAMES) \ - -I $(top-src-dir)/Documentation \ - -I $(top-src-dir)/Documentation/"$$l" \ - -I $(OUT) -o $(OUT) --split=node \ - --known-missing-files=$(top-src-dir)/scripts/build/website-known-missing-files.txt \ - $(quiet-flag) \ - $(top-src-dir)/Documentation/"$$l"/web.texi ;\ - for m in $(MANUALS); do \ - n=`echo "$$m" | sed 's/Documentation/Documentation\/'$$l'/'` ; \ - b=`basename "$$n" .texi`; \ - d=`basename "$$b" .tely`; \ - if [ -e "$$n" ] ; then \ - $(EXTRACT_TEXI_FILENAMES) \ - -I $(top-src-dir)/Documentation \ - -I $(top-src-dir)/Documentation/"$$l" \ - -I $(top-src-dir)/Documentation/"$$r""$$d" \ - --known-missing-files=$(top-src-dir)/scripts/build/website-known-missing-files.txt \ - $(quiet-flag) \ - -I $(OUT) -o $(OUT) "$$n" ; \ - fi ; \ - done; \ - done; +# english tely manuals +$(addprefix $(OUT)/,$(subst .tely,.xref-map,$(MANUALS-tely))): $(OUT)/%.xref-map: $(top-src-dir)/Documentation/%.tely; \ + $(EXTRACT_TEXI_FILENAMES) $< ) + +# english texi manuals +$(addprefix $(OUT)/,$(subst .texi,.xref-map,$(MANUALS-texi))): $(OUT)/%.xref-map: $(top-src-dir)/Documentation/%.texi + $(EXTRACT_TEXI_FILENAMES) $< + +# translated tely manuals +$(eval $(foreach l,$(WEB_LANGS),\ +$(eval $(addprefix $(OUT)/,$(subst .tely,.$(l).xref-map,$(MANUALS-$(l)))): $(OUT)/%.$(l).xref-map: $(top-src-dir)/Documentation/$(l)/%.tely; \ + $$(EXTRACT_TEXI_FILENAMES) $$< ) \ +)) + +# web is a little bit special... or is it? +$(OUT)/web.xref-map: $(top-src-dir)/Documentation/web.texi + $(EXTRACT_TEXI_FILENAMES) --split=node $< + +$(OUT)/web.%.xref-map: $(top-src-dir)/Documentation/%/web.texi + $(EXTRACT_TEXI_FILENAMES) --split=node $< + +website-xrefs: website-version $(addprefix $(OUT)/,$(xref-map-files)) website-bibs: website-version BSTINPUTS=$(top-src-dir)/Documentation/web \ @@ -172,3 +188,4 @@ website: website-texinfo website-css website-pictures website-examples web-post cp $(dir-htaccess) $(OUT)/website/.htaccess +.DUMMY: $(OUT) website website-examples website-test website-version website-xrefs -- 1.7.5.1