[MPlayer-DOCS] CVS: main/DOCS/xml Makefile,1.17,1.18

Gabucino gabucino at mplayerhq.hu
Thu Feb 5 08:30:52 CET 2004


D Richard Felker III wrote:
> > This is make 3.80-ism, doesn't work with 3.79. I'll send a patch which changes
> > it to a simple and portable for loop.
> Find another way. Flow control of a makefile does NOT belong in shell
> commands. It breaks make -n.
I know, make -n is broken by nature. Who cares? :o
Patch attached.

-- 
Gabucino
MPlayer Core Team
-------------- next part --------------
Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/DOCS/xml/Makefile,v
retrieving revision 1.18
diff -u -r1.18 Makefile
--- Makefile	29 Jan 2004 23:23:01 -0000	1.18
+++ Makefile	5 Feb 2004 07:30:30 -0000
@@ -29,12 +29,23 @@
 	@echo "Substitute LANG for one of $(SUBDIRS)"
 
 .PHONY: html-chunked chunked-dir
-html-chunked: xsltproc.sh xmllint.sh chunked-dir $(addprefix html-chunked-,$(SUBDIRS))
+
+html-chunked: xsltproc.sh xmllint.sh chunked-dir
+	for i in $(SUBDIRS); do \
+		(test -d $(HTML_CHUNKED)/$$i || mkdir $(HTML_CHUNKED)/$$i); \
+		$(MAKE) HTMLDIR=../$(HTML_CHUNKED)/$$i -C $$i html-chunked; \
+	done
+
 chunked-dir:
 	test -d $(HTML_CHUNKED) || mkdir $(HTML_CHUNKED)
 
 .PHONY: html-single single-dir
-html-single: xsltproc.sh xmllint.sh single-dir $(addprefix html-single-,$(SUBDIRS))
+html-single: xsltproc.sh xmllint.sh single-dir
+	for i in $(SUBDIRS); do \
+		(test -d $(HTML_SINGLE)/$$i || mkdir $(HTML_SINGLE)/$$i); \
+		$(MAKE) HTMLFILE=../$(HTML_SINGLE)/$$i/MPlayer.html -C $$i html-single; \
+	done
+
 single-dir:
 	test -d $(HTML_SINGLE) || mkdir $(HTML_SINGLE)
 
@@ -47,8 +58,12 @@
 	-rm -rf $(HTML_SINGLE)
 
 .PHONY: distclean
-distclean: clean-html-chunked clean-html-single $(addprefix distclean-,$(SUBDIRS))
+distclean: clean-html-chunked clean-html-single
 	-rm -f html-chunk.xsl html-single.xsl xsltproc.sh xmllint.sh
+	for i in $(SUBDIRS); do \
+		rm -rf $(HTML_SINGLE)/$$i $(HTML_CHUNKED)/$$i; \
+		$(MAKE) HTMLDIR=../$(HTML_CHUNKED)/$$i -C $$i distclean; \
+	done
 
 xsltproc.sh xmllint.sh:
 	sh configure
@@ -57,17 +72,6 @@
 
 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))))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-docs/attachments/20040205/4882067b/attachment.pgp>


More information about the MPlayer-DOCS mailing list