changeset 26788:0bec9426c86d

Replace hackish shell loops for man page installation with make constructs.
author diego
date Sun, 18 May 2008 17:05:16 +0000
parents 58dd979537a5
children 49eb016d1219
files Makefile
diffstat 1 files changed, 20 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Sun May 18 16:43:17 2008 +0000
+++ b/Makefile	Sun May 18 17:05:16 2008 +0000
@@ -825,23 +825,27 @@
 install-%: %$(EXESUF)
 	$(INSTALL) -m 755 $(INSTALLSTRIP) $< $(BINDIR)
 
-install-mplayer-man:
-	for lang in $(MAN_LANG); do \
-		if test "$$lang" = en ; then \
-			$(INSTALL) -c -m 644 DOCS/man/en/mplayer.1 $(MANDIR)/man1/ ; \
-		else \
-			$(INSTALL) -c -m 644 DOCS/man/$$lang/mplayer.1 $(MANDIR)/$$lang/man1/ ; \
-		fi ; \
-	done
+install-mplayer-man: $(foreach lang,$(MAN_LANG_ALL),install-mplayer-man-$(lang))
+install-mencoder-man: $(foreach lang,$(MAN_LANG_ALL),install-mencoder-man-$(lang))
+
+install-mplayer-man-en:
+	$(INSTALL) -c -m 644 DOCS/man/en/mplayer.1 $(MANDIR)/man1/
+
+install-mencoder-man-en: install-mplayer-man-en
+	cd $(MANDIR)/man1 && ln -sf mplayer.1 mencoder.1
 
-install-mencoder-man: install-mplayer-man
-	for lang in $(MAN_LANG); do \
-		if test "$$lang" = en ; then \
-			cd $(MANDIR)/man1 && ln -sf mplayer.1 mencoder.1 ; \
-		else \
-			cd $(MANDIR)/$$lang/man1 && ln -sf mplayer.1 mencoder.1 ; \
-		fi ; \
-	done
+define MPLAYER_MAN_RULE
+install-mplayer-man-$(lang):
+	$(INSTALL) -c -m 644 DOCS/man/$(lang)/mplayer.1 $(MANDIR)/$(lang)/man1/
+endef
+
+define MENCODER_MAN_RULE
+install-mencoder-man-$(lang): install-mplayer-man-$(lang)
+	cd $(MANDIR)/$(lang)/man1 && ln -sf mplayer.1 mencoder.1
+endef
+
+$(foreach lang,$(MAN_LANG),$(eval $(MPLAYER_MAN_RULE)))
+$(foreach lang,$(MAN_LANG),$(eval $(MENCODER_MAN_RULE)))
 
 install-gui: install-mplayer
 	-ln -sf mplayer$(EXESUF) $(BINDIR)/gmplayer$(EXESUF)