From aeef9f42fe53a4d5ed3f6bef2291f3755087ac94 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 1 Mar 2017 07:53:15 +0000 Subject: common.mk: separate clean-ext * common.mk (clean-ext): separate clean-up of makefiles and timestamps, and clean-up of subdirectories under ext and gems. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- Makefile.in | 55 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 24 deletions(-) (limited to 'Makefile.in') diff --git a/Makefile.in b/Makefile.in index 699b25ea50..a2a17039c6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -416,36 +416,43 @@ distclean-local:: -$(Q)$(RM) $(INSTALLED_LIST) $(arch_hdrdir)/ruby/config.h verconf.h -$(Q)$(RMDIRS) $(arch_hdrdir)/ruby 2> /dev/null || true -clean-ext distclean-ext realclean-ext:: - @[ -f $(EXTS_MK) ] && $(MAKE) -f $(EXTS_MK) $(@:-ext=) - @set dummy `echo "${EXTS}" | tr , ' '`; shift; \ +ext/clean.sub gems/clean.sub:: ext/clean.mk +ext/distclean.sub gems/distclean.sub:: ext/distclean.mk +ext/realclean.sub gems/realclean.sub:: ext/realclean.mk + +ext/clean.mk ext/distclean.mk ext/realclean.mk:: + $(Q) [ -f $(EXTS_MK) ] && exec $(MAKE) -f $(EXTS_MK) $(@F:.mk=) + +ext/clean:: ext/clean.sub +ext/distclean:: ext/distclean.sub +ext/realclean:: ext/realclean.sub +gems/clean:: gems/clean.sub +gems/distclean:: gems/distclean.sub +gems/realclean:: gems/realclean.sub + +ext/clean.sub ext/distclean.sub ext/realclean.sub \ +gems/clean.sub gems/distclean.sub gems/realclean.sub:: + $(Q) set dummy `echo "${EXTS}" | tr , ' '`; shift; \ test "$$#" = 0 && set .; \ set dummy `\ - cd ext 2>/dev/null && \ + cd $(@D) 2>/dev/null && \ find "$$@" \( -name Makefile -o -name exts.mk \) -print | \ - sed -n 's:^\./::;s:^:ext/:;s:/[^/][^/]*$$::p' | sort -u; \ - ` ` \ - cd gems 2>/dev/null && \ - find "$$@" -name exts.mk -print | \ - sed -n 's:^\./::;s:^:gems/:;s:/[^/][^/]*$$::p' | sort -u; \ + sed -n 's:^\./::;s:^:$(@D)/:;s:/[^/][^/]*$$::p' | sort -u; \ `; shift; \ for dir do \ - echo $(@:-ext=)ing "$$dir"; \ $(RM) "$$dir/exts.mk"; \ - { [ ! -f "$$dir/Makefile" ] || \ - (cd "$$dir" && exec $(MAKE) $(mflags) $(@:-ext=)); } && \ - case "$@" in \ - *distclean-ext*|*realclean-ext*) \ - $(RMDIRS) "$$dir" 2> /dev/null || true;; \ - esac; \ - done - -$(Q)$(RM) ext/extinit.$(OBJEXT) - -distclean-ext realclean-ext:: - -$(Q)$(RM) ext/extinit.c ext/configure-ext.mk - -$(Q)$(RMDIR) ext 2> /dev/null || true - -clean-extout: + if [ -f "$$dir/Makefile" ]; then \ + echo $(@F:.sub=)ing "$$dir"; \ + (cd "$$dir" && exec $(MAKE) $(mflags) $(@F:.sub=)); \ + fi; \ + done || true + +ext/distclean ext/realclean gems/distclean gems/realclean:: + $(Q) set dummy `echo "${EXTS}" | tr , ' '`; shift; \ + test "$$#" = 0 && set .; \ + cd $(@D) 2>/dev/null && \ + find "$$@" -type d -empty -exec $(RMDIRS) {} + 2> /dev/null || true + $(Q) $(RMDIRS) $(@D) clean-enc distclean-enc realclean-enc: @test -f "$(ENC_MK)" || exit 0; \ -- cgit v1.2.3