# Symlink or me to (or include me from) locale/*/Makefile #### configuration ASCIIDOC = asciidoc AWK = awk LOCALE = $(shell basename `pwd`) LANG = $(shell basename `pwd` | $(AWK) -F- '{ print ($$1 ~ /^[a-z][a-z]$$/) ? $$1 : "en" }') ADC_SRC_FILES = $(wildcard *.txt) ADC_FILES = $(ADC_SRC_FILES:%.txt=%.html) ADC_DEPS = $(wildcard asciidoc.conf lang-$(LANG).conf) DOC_FILES = $(ADC_FILES) $(T2T_FILES) .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 clean - clean up" @echo " make distclean - clean up more" clean: @echo " Cleanup of $(LOCALE) documentation..." distclean: clean @echo " More cleanup of $(LOCALE) documentation..." rm -f $(DOC_FILES) #### Makes single-file makes easier to type %: %.html %.txt ; #### 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/$(LOCALE)/$@" $(ASCIIDOC) --unsafe -a linkcss -a quirks! -a lang=$(LANG) -a doctitle="$(shell basename $@)" -o $@ $<