changeset 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 7f8e85a50845
children e1593207d1cb
files GNUmakefile xml/cn/GNUmakefile xml/en/GNUmakefile xml/he/GNUmakefile xml/ja/GNUmakefile xml/ru/GNUmakefile xml/tr/GNUmakefile
diffstat 7 files changed, 42 insertions(+), 166 deletions(-) [+]
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						\
--- a/xml/cn/GNUmakefile
+++ b/xml/cn/GNUmakefile
@@ -1,5 +1,3 @@
-DOC_LANG =	cn
-
 DOCS =									\
 		faq							\
 		windows							\
@@ -11,16 +9,10 @@ DOCS =									\
 		debugging_log						\
 		http/converting_rewrite_rules				\
 
-DOCS_XML =	$(foreach name, $(DOCS), xml/$(DOC_LANG)/docs/$(name).xml)
-DOCS_HTML =	$(foreach name, $(DOCS), $(OUT)/$(DOC_LANG)/docs/$(name).html)
-
 FAQ =									\
 		welcome_nginx_facebook					\
 		sys_errlist						\
 
-FAQ_XML =	$(foreach name, $(FAQ), xml/$(DOC_LANG)/docs/$(name).xml)
-FAQ_HTML =	$(foreach name, $(FAQ), $(OUT)/$(DOC_LANG)/docs/$(name).html)
-
 REFS =									\
 		http/ngx_http_access_module				\
 		http/ngx_http_addition_module				\
@@ -30,30 +22,3 @@ REFS =									\
 		http/ngx_http_gzip_static_module			\
 		http/ngx_http_index_module				\
 		http/ngx_http_limit_conn_module				\
-
-REFS_XML =	$(foreach name, $(REFS), xml/$(DOC_LANG)/docs/$(name).xml)
-REFS_HTML =	$(foreach name, $(REFS), $(OUT)/$(DOC_LANG)/docs/$(name).html)
-
-$(DOC_LANG):								\
-		$(OUT)/$(DOC_LANG)/index.html				\
-		$(OUT)/$(DOC_LANG)/docs/index.html			\
-		$(DOCS_HTML)						\
-		$(REFS_HTML)						\
-		$(FAQ_HTML)						\
-
-$(OUT)/$(DOC_LANG)/docs/index.html:					\
-		$(DOCS_XML)						\
-		$(REFS_XML)						\
-
-xml/$(DOC_LANG)/docs/dirindex.xml:					\
-		$(REFS_XML)						\
-		xslt/dirindex.xslt
-	echo "<modules>$(patsubst %,					\
-	<module name=\"%\"/>, $(filter %.xml,$^))</modules>" |		\
-	xsltproc -o -							\
-	--stringparam LANG $(patsubst xml/%/docs/dirindex.xml,%,$@)	\
-	xslt/dirindex.xslt - |						\
-	sed 's;xml/[^/]*/docs/;;g' > $@
-
-$(OUT)/$(DOC_LANG)/docs/faq.html:					\
-		$(FAQ_XML)						\
--- a/xml/en/GNUmakefile
+++ b/xml/en/GNUmakefile
@@ -1,5 +1,3 @@
-DOC_LANG =	en
-
 DOCS =									\
 		faq							\
 		install							\
@@ -19,9 +17,6 @@ DOCS =									\
 		howto_setup_development_environment_on_ec2		\
 		nginx_dtrace_pid_provider				\
 
-DOCS_XML =	$(foreach name, $(DOCS), xml/$(DOC_LANG)/docs/$(name).xml)
-DOCS_HTML =	$(foreach name, $(DOCS), $(OUT)/$(DOC_LANG)/docs/$(name).html)
-
 FAQ =									\
 		welcome_nginx_facebook					\
 		faq/license_copyright					\
@@ -31,9 +26,6 @@ FAQ =									\
 		faq/chunked_encoding_from_backend			\
 		sys_errlist						\
 
-FAQ_XML =	$(foreach name, $(FAQ), xml/$(DOC_LANG)/docs/$(name).xml)
-FAQ_HTML =	$(foreach name, $(FAQ), $(OUT)/$(DOC_LANG)/docs/$(name).html)
-
 REFS =									\
 		ngx_core_module						\
 		http/ngx_http_access_module				\
@@ -83,36 +75,11 @@ REFS =									\
 		mail/ngx_mail_smtp_module				\
 		mail/ngx_mail_ssl_module				\
 
-REFS_XML =	$(foreach name, $(REFS), xml/$(DOC_LANG)/docs/$(name).xml)
-REFS_HTML =	$(foreach name, $(REFS), $(OUT)/$(DOC_LANG)/docs/$(name).html)
-
-$(DOC_LANG):								\
-		$(OUT)/$(DOC_LANG)/index.html				\
-		$(OUT)/$(DOC_LANG)/download.html			\
-		$(OUT)/$(DOC_LANG)/security_advisories.html		\
-		$(OUT)/$(DOC_LANG)/docs/index.html			\
-		$(DOCS_HTML)						\
-		$(REFS_HTML)						\
-		$(OUT)/$(DOC_LANG)/pgp_keys.html			\
-		$(FAQ_HTML)						\
-		$(OUT)/$(DOC_LANG)/links.html				\
-		$(OUT)/$(DOC_LANG)/books.html				\
-		$(OUT)/$(DOC_LANG)/support.html				\
-		$(OUT)/$(DOC_LANG)/donation.html			\
-
-$(OUT)/$(DOC_LANG)/docs/index.html:					\
-		$(DOCS_XML)						\
-		$(REFS_XML)						\
-
-xml/$(DOC_LANG)/docs/dirindex.xml:					\
-		$(REFS_XML)						\
-		xslt/dirindex.xslt
-	echo "<modules>$(patsubst %,					\
-	<module name=\"%\"/>, $(filter %.xml,$^))</modules>" |		\
-	xsltproc -o -							\
-	--stringparam LANG $(patsubst xml/%/docs/dirindex.xml,%,$@)	\
-	xslt/dirindex.xslt - |						\
-	sed 's;xml/[^/]*/docs/;;g' > $@
-
-$(OUT)/$(DOC_LANG)/docs/faq.html:					\
-		$(FAQ_XML)						\
+TOP =									\
+		download						\
+		security_advisories					\
+		pgp_keys						\
+		links							\
+		books							\
+		support							\
+		donation						\
--- a/xml/he/GNUmakefile
+++ b/xml/he/GNUmakefile
@@ -1,17 +1,4 @@
-DOC_LANG =	he
-
 DOCS =									\
 		windows							\
 		http/server_names					\
 		http/converting_rewrite_rules				\
-
-DOCS_XML =	$(foreach name, $(DOCS), xml/$(DOC_LANG)/docs/$(name).xml)
-DOCS_HTML =	$(foreach name, $(DOCS), $(OUT)/$(DOC_LANG)/docs/$(name).html)
-
-$(DOC_LANG):								\
-		$(OUT)/$(DOC_LANG)/index.html				\
-		$(OUT)/$(DOC_LANG)/docs/index.html			\
-		$(DOCS_HTML)						\
-
-$(OUT)/$(DOC_LANG)/docs/index.html:					\
-		$(DOCS_XML)						\
--- a/xml/ja/GNUmakefile
+++ b/xml/ja/GNUmakefile
@@ -1,5 +1,3 @@
-DOC_LANG =	ja
-
 DOCS =									\
 		faq							\
 		http/request_processing					\
@@ -8,23 +6,5 @@ DOCS =									\
 		debugging_log						\
 		http/converting_rewrite_rules				\
 
-DOCS_XML =	$(foreach name, $(DOCS), xml/$(DOC_LANG)/docs/$(name).xml)
-DOCS_HTML =	$(foreach name, $(DOCS), $(OUT)/$(DOC_LANG)/docs/$(name).html)
-
 FAQ =									\
 		sys_errlist						\
-
-FAQ_XML =	$(foreach name, $(FAQ), xml/$(DOC_LANG)/docs/$(name).xml)
-FAQ_HTML =	$(foreach name, $(FAQ), $(OUT)/$(DOC_LANG)/docs/$(name).html)
-
-$(DOC_LANG):								\
-		$(OUT)/$(DOC_LANG)/index.html				\
-		$(OUT)/$(DOC_LANG)/docs/index.html			\
-		$(DOCS_HTML)						\
-		$(FAQ_HTML)						\
-
-$(OUT)/$(DOC_LANG)/docs/index.html:					\
-		$(DOCS_XML)						\
-
-$(OUT)/$(DOC_LANG)/docs/faq.html:					\
-		$(FAQ_XML)						\
--- a/xml/ru/GNUmakefile
+++ b/xml/ru/GNUmakefile
@@ -1,5 +1,3 @@
-DOC_LANG =	ru
-
 DOCS =									\
 		faq							\
 		install							\
@@ -16,15 +14,9 @@ DOCS =									\
 		http/configuring_https_servers				\
 		debugging_log						\
 
-DOCS_XML =	$(foreach name, $(DOCS), xml/$(DOC_LANG)/docs/$(name).xml)
-DOCS_HTML =	$(foreach name, $(DOCS), $(OUT)/$(DOC_LANG)/docs/$(name).html)
-
 FAQ =									\
 		sys_errlist						\
 
-FAQ_XML =	$(foreach name, $(FAQ), xml/$(DOC_LANG)/docs/$(name).xml)
-FAQ_HTML =	$(foreach name, $(FAQ), $(OUT)/$(DOC_LANG)/docs/$(name).html)
-
 REFS =									\
 		ngx_core_module						\
 		http/ngx_http_access_module				\
@@ -75,31 +67,6 @@ REFS =									\
 		mail/ngx_mail_smtp_module				\
 		mail/ngx_mail_ssl_module				\
 
-REFS_XML =	$(foreach name, $(REFS), xml/$(DOC_LANG)/docs/$(name).xml)
-REFS_HTML =	$(foreach name, $(REFS), $(OUT)/$(DOC_LANG)/docs/$(name).html)
-
-$(DOC_LANG):								\
-		$(OUT)/$(DOC_LANG)/index.html				\
-		$(OUT)/$(DOC_LANG)/download.html			\
-		$(OUT)/$(DOC_LANG)/docs/index.html			\
-		$(DOCS_HTML)						\
-		$(REFS_HTML)						\
-		$(FAQ_HTML)						\
-		$(OUT)/$(DOC_LANG)/support.html				\
-
-$(OUT)/$(DOC_LANG)/docs/index.html:					\
-		$(DOCS_XML)						\
-		$(REFS_XML)						\
-
-xml/$(DOC_LANG)/docs/dirindex.xml:					\
-		$(REFS_XML)						\
-		xslt/dirindex.xslt
-	echo "<modules>$(patsubst %,					\
-	<module name=\"%\"/>, $(filter %.xml,$^))</modules>" |		\
-	xsltproc -o -							\
-	--stringparam LANG $(patsubst xml/%/docs/dirindex.xml,%,$@)	\
-	xslt/dirindex.xslt - |						\
-	sed 's;xml/[^/]*/docs/;;g' > $@
-
-$(OUT)/$(DOC_LANG)/docs/faq.html:					\
-		$(FAQ_XML)						\
+TOP =									\
+		download						\
+		support							\
--- a/xml/tr/GNUmakefile
+++ b/xml/tr/GNUmakefile
@@ -1,5 +1,3 @@
-DOC_LANG =	tr
-
 DOCS =									\
 		faq							\
 		windows							\
@@ -9,23 +7,5 @@ DOCS =									\
 		debugging_log						\
 		http/converting_rewrite_rules				\
 
-DOCS_XML =	$(foreach name, $(DOCS), xml/$(DOC_LANG)/docs/$(name).xml)
-DOCS_HTML =	$(foreach name, $(DOCS), $(OUT)/$(DOC_LANG)/docs/$(name).html)
-
 FAQ =									\
 		sys_errlist						\
-
-FAQ_XML =	$(foreach name, $(FAQ), xml/$(DOC_LANG)/docs/$(name).xml)
-FAQ_HTML =	$(foreach name, $(FAQ), $(OUT)/$(DOC_LANG)/docs/$(name).html)
-
-$(DOC_LANG):								\
-		$(OUT)/$(DOC_LANG)/index.html				\
-		$(OUT)/$(DOC_LANG)/docs/index.html			\
-		$(DOCS_HTML)						\
-		$(FAQ_HTML)						\
-
-$(OUT)/$(DOC_LANG)/docs/index.html:					\
-		$(DOCS_XML)						\
-
-$(OUT)/$(DOC_LANG)/docs/faq.html:					\
-		$(FAQ_XML)						\