Module: sip-router Branch: kamailio_3.0 Commit: 7d8c22046b2e9e5bc87b78a00ba7cff7390f317c URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=7d8c2204...
Author: Andrei Pelinescu-Onciul andrei@iptel.org Committer: Daniel-Constantin Mierla miconda@gmail.com 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) (cherry picked from commit b8e67fd6d759b1a3a2f6acd61e0b7f8706a98d73)
---
Makefile | 22 ++++++++++++++++++++++ Makefile.modules | 31 +++++++++++++++++++++++++++++++ Makefile.rules | 25 ------------------------- 3 files changed, 53 insertions(+), 25 deletions(-)
diff --git a/Makefile b/Makefile index 9c1f2b3..e3ee534 100644 --- a/Makefile +++ b/Makefile @@ -971,6 +971,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