From 642ac8a05ea7f449c367cd4293b0e07ca3305fd8 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Fri, 9 Mar 2007 17:48:25 +0000 Subject: [PATCH] Avoid duplication in the binary-dist rules for docs Rather than building complex sh stuff and echoing what we're doing ourselves, use make rules to do the looping and let make print things out. --- Makefile | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index 3b0ab36..19c05a3 100644 --- a/Makefile +++ b/Makefile @@ -314,27 +314,23 @@ endif # XSLTPROC endif # BINDIST_DOC_WAYS -binary-dist :: ifneq "$(DIR_DOCBOOK_XSL)" "" - @for i in $(BinDistDirs); do \ - if test -d "$$i"; then \ - $(MAKE) -C $$i $(MFLAGS) $(BINDIST_DOC_WAYS); \ - echo $(MAKE) -C $$i $(MFLAGS) install-docs XMLDocWays="$(BINDIST_DOC_WAYS)" \ - prefix=$(BIN_DIST_DIR) \ - exec_prefix=$(BIN_DIST_DIR) \ - bindir=$(BIN_DIST_DIR)/bin/$(TARGETPLATFORM) \ - libdir=$(BIN_DIST_DIR)/lib/$(TARGETPLATFORM) \ - libexecdir=$(BIN_DIST_DIR)/lib/$(TARGETPLATFORM) \ - datadir=$(BIN_DIST_DIR)/share; \ - $(MAKE) -C $$i $(MFLAGS) install-docs XMLDocWays="$(BINDIST_DOC_WAYS)" \ - prefix=$(BIN_DIST_DIR) \ - exec_prefix=$(BIN_DIST_DIR) \ - bindir=$(BIN_DIST_DIR)/bin/$(TARGETPLATFORM) \ - libdir=$(BIN_DIST_DIR)/lib/$(TARGETPLATFORM) \ - libexecdir=$(BIN_DIST_DIR)/lib/$(TARGETPLATFORM) \ - datadir=$(BIN_DIST_DIR)/share; \ - fi \ - done +.PHONY: binary-dist-doc-% + +BINARY_DIST_DOC_RULES=$(foreach d,$(BinDistDirs),binary-dist-doc-$d) + +binary-dist :: $(BINARY_DIST_DOC_RULES) + +$(BINARY_DIST_DOC_RULES): binary-dist-doc-%: + $(MAKE) -C $* $(MFLAGS) $(BINDIST_DOC_WAYS) + $(MAKE) -C $* $(MFLAGS) install-docs \ + XMLDocWays="$(BINDIST_DOC_WAYS)" \ + prefix=$(BIN_DIST_DIR) \ + exec_prefix=$(BIN_DIST_DIR) \ + bindir=$(BIN_DIST_DIR)/bin/$(TARGETPLATFORM) \ + libdir=$(BIN_DIST_DIR)/lib/$(TARGETPLATFORM) \ + libexecdir=$(BIN_DIST_DIR)/lib/$(TARGETPLATFORM) \ + datadir=$(BIN_DIST_DIR)/share endif # Rename scripts to $i.prl and $i.sh where necessary. -- 1.7.10.4