diff GNUmakefile @ 734:99ea52dbb4d4

Moved all rules to the main makefile leaving language specific makefiles with only the lists of translated documents.
author Ruslan Ermilov <ru@nginx.com>
date Wed, 17 Oct 2012 14:30:05 +0000
parents 76e876c58dc0
children 9f2953d854fd
line wrap: on
line diff
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -83,8 +83,38 @@ arx:		$(OUT)/2011.html $(OUT)/2010.html 
 404:		$(OUT)/404.html
 
 
-include 	$(foreach lang, $(LANGS), xml/$(lang)/GNUmakefile)
+define lang-specific
+
+TOP=
+DOCS=
+REFS=
+FAQ=
+include xml/$(lang)/GNUmakefile
+
+$(lang):								\
+		$$(foreach f,index $$(TOP),$(OUT)/$(lang)/$$(f).html)	\
+		$$(foreach f,index $$(DOCS) $$(REFS) $$(FAQ),		\
+		$(OUT)/$(lang)/docs/$$(f).html)
 
+$(OUT)/$(lang)/docs/index.html:						\
+		$$(foreach f,$$(DOCS) $$(REFS),				\
+		$(OUT)/$(lang)/docs/$$(f).html)
+
+$(OUT)/$(lang)/docs/faq.html:						\
+		$$(foreach f,$$(FAQ),$(OUT)/$(lang)/docs/$$(f).html)
+
+xml/$(lang)/docs/dirindex.xml:						\
+		$$(foreach f,$$(REFS),xml/$(lang)/docs/$$(f).xml)	\
+		xslt/dirindex.xslt
+	echo "<modules>$$(patsubst %,					\
+	<module name=\"%\"/>, $$(filter %.xml,$$^))</modules>" |	\
+	xsltproc -o - --stringparam LANG $(lang)			\
+	xslt/dirindex.xslt - |						\
+	sed 's;xml/[^/]*/docs/;;g' > $$@
+
+endef
+
+$(foreach lang, $(LANGS), $(eval $(call lang-specific)))
 
 $(OUT)/index.html:							\
 		xml/index.xml						\