From 438a648b1446ba09e54ac14b8ab67a4554d691bf Mon Sep 17 00:00:00 2001 From: Ted Pavlic Date: Thu, 8 Jan 2009 17:25:26 -0500 Subject: [PATCH] Makefile.doc cleanup. Also made Makefile build t2t's too with doc target. --- common/Makefile.common | 29 +++---------- common/Makefile.doc | 70 ++++++++++++++++++++++++++++++++ muttator/locale/en-US/Makefile | 2 +- vimperator/locale/en-US/Makefile | 19 +-------- 4 files changed, 78 insertions(+), 42 deletions(-) create mode 100644 common/Makefile.doc mode change 100644 => 120000 vimperator/locale/en-US/Makefile diff --git a/common/Makefile.common b/common/Makefile.common index c630005e..f3fbc038 100644 --- a/common/Makefile.common +++ b/common/Makefile.common @@ -5,9 +5,8 @@ OS = $(shell uname -s) BUILD_DATE = $(shell date "+%Y/%m/%d %H:%M:%S") BASE = $(TOP)/../common -DOC_SRC_FILES = $(wildcard locale/*/*.txt) -DOC_FILES = ${DOC_SRC_FILES:%.txt=%.html} -DOC_DEPS = $(wildcard locale/*/asciidoc.conf) +DOC_SRC_FILES = $(wildcard locale/*/*.txt) $(wildcard locale/*/*.t2t) +LOCALES = $(wildcard locale/*) MAKE_JAR = VERSION="$(VERSION)" DATE="$(BUILD_DATE)" sh $(BASE)/make_jar.sh @@ -64,8 +63,6 @@ info: @echo -e "jar files $(shell echo ${JAR_FILES} | sed 's/ /\\n /g' )" @echo "xpi files ${XPI_FILES}" -.PHONY: check-asciidoc -doc: check-asciidoc ${DOC_FILES} xpi: ${XPI} jar: ${JAR} @@ -85,7 +82,7 @@ clean: distclean: clean @echo "More cleanup..." - rm -f ${DOC_FILES} + @set -e; for locale in $(LOCALES); do $(MAKE) -C clean; doc; done rm -rf ${BUILD_DIR} #### xpi @@ -104,21 +101,7 @@ $(JAR): doc $(MAKE_JAR) "$(JAR)" "$(JAR_BASES)" "$(JAR_DIRS)" "$(JAR_TEXTS)" "$(JAR_BINS)" "$(JAR_FILES)" @echo "SUCCESS: $@" -#### doc - -check-asciidoc: - @$(ASCIIDOC) --version | awk '{ exit $$2 !~ /^8\.2\./ }' || \ - echo >&2 "Warning: asciidoc versions other than 8.2.x are unsupported" - -${DOC_FILES}: %.html: %.txt $(BASE)/Makefile.common $(DOC_DEPS) - @echo "DOC $@" - $(ASCIIDOC) --unsafe -a linkcss -a quirks! -a doctitle="$(shell basename $@)" -o $@ $< - -T2T = $(wildcard locale/*/*.t2t) -t2t: $(T2T:%.t2t=%.xhtml) -$(T2T:%.t2t=%.xhtml): locale/en-US/config.t2t - -%.xhtml: %.t2t - @echo "T2T $@" - txt2tags --quiet $< +#### doc (see Makefile.doc) +doc: + @set -e; for locale in $(LOCALES); do $(MAKE) -C $$locale doc; done diff --git a/common/Makefile.doc b/common/Makefile.doc new file mode 100644 index 00000000..2d41d3ac --- /dev/null +++ b/common/Makefile.doc @@ -0,0 +1,70 @@ +# Symlink me to locale/*/Makefile + +#### configuration + +BASE = ../../../common + +THIS_LOCALE = $(notdir $(shell pwd)) + +ADC_SRC_FILES = $(wildcard *.txt) +ADC_FILES = $(ADC_SRC_FILES:%.txt=%.html) +ADC_DEPS = asciidoc.conf + +T2T_SRC_FILES = $(wildcard *.t2t) +T2T_FILES = $(T2T_SRC_FILES:%.t2t=%.xhtml) +T2T_DEPS = config.t2t + +DOC_FILES = $(ADC_FILES) $(T2T_FILES) + +ASCIIDOC = asciidoc +TXT2TAGS = txt2tags +AWK = awk + +.SILENT: + +#### rules + +.PHONY: all help doc asciidoc check-asciidoc clean distclean +all: doc + +doc: asciidoc + +help: + @echo "${NAME} ${VERSION} build" + @echo + @echo " make help - display this help" + @echo " make doc - build doc files" + @echo " make asciidoc - build asciidoc'd files only" + @echo " make t2t - build txt2tags'd files only" + @echo " make clean - clean up" + @echo " make distclean - clean up more" + +clean: + @echo "Cleanup..." + find . -name '*~' -exec rm -f {} \; + +distclean: clean + @echo "More cleanup..." + rm -f $(DOC_FILES) + +#### asciidoc + +asciidoc: check-asciidoc $(ADC_FILES) + +check-asciidoc: + @$(ASCIIDOC) --version | $(AWK) '{ exit $$2 !~ /^8\.2\./ }' || \ + echo >&2 "Warning: asciidoc versions other than 8.2.x are unsupported" + +$(ADC_FILES): %.html: %.txt $(BASE)/Makefile.doc $(ADC_DEPS) + @echo "DOC locale/$(THIS_LOCALE)/$@" + $(ASCIIDOC) --unsafe -a linkcss -a quirks! -a doctitle="$(shell basename $@)" -o $@ $< + +#### txt2tags + +$(T2T_FILES): %.xhtml: %.t2t $(BASE)/Makefile.doc $(T2T_DEPS) + @echo "T2T locale/$(THIS_LOCALE)/$@" + txt2tags --quiet $< + +%.xhtml: %.t2t + @echo "T2T $@" + $(TXT2TAGS) --quiet $< diff --git a/muttator/locale/en-US/Makefile b/muttator/locale/en-US/Makefile index e1e706f9..85510a12 120000 --- a/muttator/locale/en-US/Makefile +++ b/muttator/locale/en-US/Makefile @@ -1 +1 @@ -../../../vimperator/locale/en-US/Makefile \ No newline at end of file +../../../common/Makefile.doc \ No newline at end of file diff --git a/vimperator/locale/en-US/Makefile b/vimperator/locale/en-US/Makefile deleted file mode 100644 index 2d2deab1..00000000 --- a/vimperator/locale/en-US/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -THIS_LOCALE = $(notdir $(shell pwd)) -DOC_FILES = $(addsuffix .html,$(basename $(wildcard *.txt))) - -.PHONY: all doc clean distclean - -doc: $(DOC_FILES) - -clean: - find . -name '*~' -exec rm -f {} \; - -distclean: clean - rm -f $(DOC_FILES) - -%: %.html %.txt - @ - -%.html: %.txt ../../../common/Makefile.common asciidoc.conf - @make -C ../../ locale/$(THIS_LOCALE)/$@ diff --git a/vimperator/locale/en-US/Makefile b/vimperator/locale/en-US/Makefile new file mode 120000 index 00000000..85510a12 --- /dev/null +++ b/vimperator/locale/en-US/Makefile @@ -0,0 +1 @@ +../../../common/Makefile.doc \ No newline at end of file