Module: sip-router
Branch: sr_3.0
Commit: b8e67fd6d759b1a3a2f6acd61e0b7f8706a98d73
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b8e67fd…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Fri Dec 4 18:16:25 2009 +0100
makefiles: clean-utils and proper-utils fix
- clean-utils and proper-utils now work both from the main
directory (for utils compiled by make utils or installed by make
install-utils) and from the modules directories (for utils
installed by a module)
- make utils now works in module directories (compiles utils that
would be installed by the module)
---
Makefile | 22 ++++++++++++++++++++++
Makefile.modules | 31 +++++++++++++++++++++++++++++++
Makefile.rules | 25 -------------------------
3 files changed, 53 insertions(+), 25 deletions(-)
diff --git a/Makefile b/Makefile
index 7f2d496..d2d98c4 100644
--- a/Makefile
+++ b/Makefile
@@ -953,6 +953,28 @@ clean-libs:
proper-libs realclean-libs distclean-libs maintainer-clean-libs:
$(MAKE) -C lib $(patsubst %-libs,%,$@)
+# utils cleaning targets
+
+.PHONY: clean-utils
+clean-utils:
+ @for r in $(C_COMPILE_UTILS) $(C_INSTALL_UTILS) "" ; do \
+ if [ -d "$$r" ]; then \
+ $(MAKE) -C "$$r" clean ; \
+ fi ; \
+ done
+
+.PHONY: proper-utils
+.PHONY: distclean-utils
+.PHONY: realclean-utils
+.PHONY: maintainer-clean-utils
+proper-utils realclean-utils distclean-utils maintainer-clean-utils: \
+ clean_target=$(patsubst %-utils,%,$@)
+proper-utils realclean-utils distclean-utils maintainer-clean-utils:
+ @for r in $(C_COMPILE_UTILS) $(C_INSTALL_UTILS) "" ; do \
+ if [ -d "$$r" ]; then \
+ $(MAKE) -C "$$r" $(clean_target); \
+ fi ; \
+ done
# clean extra binary names (common "flavour" names)
clean: clean-extra-names
diff --git a/Makefile.modules b/Makefile.modules
index f1f172b..1f226ba 100644
--- a/Makefile.modules
+++ b/Makefile.modules
@@ -139,14 +139,45 @@ install-libs:
endif # $(SER_LIBS)
+.PHONY: utils
+.PHONY: clean-utils
+.PHONY: proper-utils
+.PHONY: distclean-utils
+.PHONY: realclean-utils
+.PHONY: maintainer-clean-utils
ifneq (,$(MOD_INSTALL_UTILS))
install-utils:
@for ut in $(MOD_INSTALL_UTILS) ; do \
$(call try_err, $(MAKE) -C "$${ut}" install-if-newer ) ;\
done; true
+utils:
+ @for r in $(MOD_INSTALL_UTILS) ; do \
+ $(call try_err, $(MAKE) -C "$$r" ) ;\
+ done; true
+
+clean-utils:
+ @for r in $(MOD_INSTALL_UTILS) ; do \
+ if [ -d "$$r" ]; then \
+ $(MAKE) -C "$$r" clean ; \
+ fi ; \
+ done
+
+proper-utils realclean-utils distclean-utils maintainer-clean-utils: \
+ clean_target=$(patsubst %-utils,%,$@)
+proper-utils realclean-utils distclean-utils maintainer-clean-utils:
+ @for r in $(MOD_INSTALL_UTILS) ; do \
+ if [ -d "$$r" ]; then \
+ $(MAKE) -C "$$r" $(clean_target); \
+ fi ; \
+ done
+
else
+# ! MOD_INSTALL_UTILS
install-utils:
+utils:
+clean-utils:
+proper-utils realclean-utils distclean-utils maintainer-clean-utils:
endif # $(MOD_INSTALL_UTILS)
diff --git a/Makefile.rules b/Makefile.rules
index 512f828..8f254f4 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -218,16 +218,6 @@ clean-modules:
fi ; \
done
-.PHONY: clean-utils
-clean-utils:
- @if [ -n "$(cmodules)" ]; then \
- for r in $(utils_compile) "" ; do \
- if [ -d "$$r" ]; then \
- $(MAKE) -C "$$r" clean ; \
- fi ; \
- done \
- fi
-
# make proper for the local directory
.PHONY: proper
.PHONY: distclean
@@ -253,21 +243,6 @@ proper-modules realclean-modules distclean-modules
maintainer-clean-modules:
fi ; \
done
-.PHONY: proper-utils
-.PHONY: distclean-utils
-.PHONY: realclean-utils
-.PHONY: maintainer-clean-utils
-proper-utils realclean-utils distclean-utils maintainer-clean-utils: \
- clean_target=$(patsubst %-utils,%,$@)
-proper-utils realclean-utils distclean-utils maintainer-clean-utils:
- @if [ -n "$(cmodules)" ]; then \
- for r in $(utils_compile) "" ; do \
- if [ -d "$$r" ]; then \
- $(MAKE) -C "$$r" $(clean_target); \
- fi ; \
- done \
- fi
-
.PHONY: clean-tmp
clean-tmp:
-@rm -f TAGS tags *.dbg .*.swp