changeset 11883:51e14a023339

Structure rewritten, to allow single language build and some simplifications.
author wight
date Thu, 29 Jan 2004 23:23:01 +0000
parents 3d605c60ba8e
children 923e6d2c7623
files DOCS/xml/Makefile
diffstat 1 files changed, 28 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/DOCS/xml/Makefile	Thu Jan 29 21:24:17 2004 +0000
+++ b/DOCS/xml/Makefile	Thu Jan 29 23:23:01 2004 +0000
@@ -18,29 +18,25 @@
 	@echo "********"
 	@echo "all               : Build everything (default)."
 	@echo "html-single       : Build HTML documentation (single file)."
+	@echo "html-single-LANG  : As above, but only one language."
 	@echo "html-chunked      : Build HTML documentation (multiple files)."
+	@echo "html-chunked-LANG : As above, but only one language."
 	@echo "clean-html-single : Purge the 'HTML-single' directory."
 	@echo "clean-html-chunked: Purge the 'HTML' directory."
 	@echo "clean             : Purge the 'HTML' and 'HTML-single' directories."
 	@echo "distclean         : Remove ALL generated files."
+	@echo "distclean-LANG    : Remove ALL generated files for one language."
+	@echo "Substitute LANG for one of $(SUBDIRS)"
 
-.PHONY: html-chunked
-html-chunked: xsltproc.sh xmllint.sh
+.PHONY: html-chunked chunked-dir
+html-chunked: xsltproc.sh xmllint.sh chunked-dir $(addprefix html-chunked-,$(SUBDIRS))
+chunked-dir:
 	test -d $(HTML_CHUNKED) || mkdir $(HTML_CHUNKED)
-	for dir in $(SUBDIRS); do\
-		test -f $$dir/Makefile &&\
-		(test -d $(HTML_CHUNKED)/$$dir || mkdir $(HTML_CHUNKED)/$$dir) &&\
-		if $(MAKE) HTMLDIR=../$(HTML_CHUNKED)/$$dir -C $$dir html-chunked; then :; else exit 1; fi;\
-	done
 
-.PHONY: html-single
-html-single: xsltproc.sh xmllint.sh
+.PHONY: html-single single-dir
+html-single: xsltproc.sh xmllint.sh single-dir $(addprefix html-single-,$(SUBDIRS))
+single-dir:
 	test -d $(HTML_SINGLE) || mkdir $(HTML_SINGLE)
-	for dir in $(SUBDIRS); do\
-		test -f $$dir/Makefile &&\
-		(test -d $(HTML_SINGLE)/$$dir || mkdir $(HTML_SINGLE)/$$dir) &&\
-		if $(MAKE) HTMLFILE=../$(HTML_SINGLE)/$$dir/MPlayer.html -C $$dir html-single; then :; else exit 1; fi;\
-	done
 
 .PHONY: clean-html-chunked
 clean-html-chunked:
@@ -51,14 +47,27 @@
 	-rm -rf $(HTML_SINGLE)
 
 .PHONY: distclean
-distclean: clean-html-chunked clean-html-single
-	for dir in $(SUBDIRS); do\
-		test -f $$dir/Makefile &&\
-		if $(MAKE) HTMLDIR=../$(HTML_CHUNKED)/$$dir -C $$dir distclean ; then :; else exit 1; fi;\
-	done
+distclean: clean-html-chunked clean-html-single $(addprefix distclean-,$(SUBDIRS))
 	-rm -f html-chunk.xsl html-single.xsl xsltproc.sh xmllint.sh
 
 xsltproc.sh xmllint.sh:
 	sh configure
 
 clean: clean-html-chunked clean-html-single
+
+define lang-def
+.PHONY: html-chunked-$(1) html-single-$(1) distclean-$(1)
+html-chunked-$(1): xsltproc.sh xmllint.sh chunked-dir
+	(test -d $(HTML_CHUNKED)/$(1) || mkdir $(HTML_CHUNKED)/$(1))
+	$(MAKE) HTMLDIR=../$(HTML_CHUNKED)/$(1) -C $(1) html-chunked
+
+html-single-$(1): xsltproc.sh xmllint.sh single-dir
+	(test -d $(HTML_SINGLE)/$(1) || mkdir $(HTML_SINGLE)/$(1))
+	$(MAKE) HTMLFILE=../$(HTML_SINGLE)/$(1)/MPlayer.html -C $(1) html-single
+
+distclean-$(1):
+	-rm -rf $(HTML_SINGLE)/$(1) $(HTML_CHUNKED)/$(1)
+	$(MAKE) HTMLDIR=../$(HTML_CHUNKED)/$(1) -C $(1) distclean
+endef
+
+$(foreach lang, $(SUBDIRS),$(eval $(call lang-def,$(lang))))