From 04b4e6aaecc0227ad890958be303417cc7d2249b Mon Sep 17 00:00:00 2001 From: "Sergey S. Betke" Date: Sun, 17 Jun 2018 00:26:22 +0300 Subject: [PATCH] =?UTF-8?q?*=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BF=D0=BE=D0=B4=D0=B4=D0=B5=D1=80=D0=B6=D0=BA?= =?UTF-8?q?=D0=B0=20=D1=81=D1=82=D0=B0=D0=BD=D0=B4=D0=B0=D1=80=D1=82=D0=BD?= =?UTF-8?q?=D1=8B=D1=85=20=D1=86=D0=B5=D0=BB=D0=B5=D0=B9=20`*clean`=20(Met?= =?UTF-8?q?rolog/marks#50)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common.mk | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/common.mk b/common.mk index 8a79328..a181a1d 100644 --- a/common.mk +++ b/common.mk @@ -220,7 +220,7 @@ $(SUBPROJECTS_EXPORTS_DIR)/$1.mk: $(call getSubProjectDir,$1)/Makefile $$(MAKETARGETDIR) $(call MAKE_SUBPROJECT,$1) .GLOBAL_VARIABLES .PHONY: $1 $3 -ifeq ($(filter clean,$(MAKECMDGOALS)),) +ifeq ($(filter %clean,$(MAKECMDGOALS)),) include $(SUBPROJECTS_EXPORTS_DIR)/$1.mk endif $1: @@ -237,8 +237,20 @@ $(call getSubProjectDir,$1)/%: $(call MAKE_SUBPROJECT,$1) $$* all:: $1 test: test-$1 +ifeq ($(filter clean distclean maintainer-clean,$(MAKECMDGOALS)),) +mostlyclean:: + $(call MAKE_SUBPROJECT,$1) mostlyclean +endif +ifeq ($(filter distclean maintainer-clean,$(MAKECMDGOALS)),) clean:: $(call MAKE_SUBPROJECT,$1) clean +endif +ifeq ($(filter maintainer-clean,$(MAKECMDGOALS)),) +distclean:: + $(call MAKE_SUBPROJECT,$1) distclean +endif +maintainer-clean:: + $(call MAKE_SUBPROJECT,$1) maintainer-clean endef ifdef ROOT_PROJECT_DIR @@ -253,9 +265,18 @@ test: .PHONY: check check: test -.PHONY: clean -clean:: +.PHONY: mostlyclean +mostlyclean:: $(RMDIR) $(AUXDIR) $(RMDIR) $(OUTPUTDIR) +.PHONY: clean +clean:: mostlyclean + +.PHONY: distclean +distclean:: clean + +.PHONY: maintainer-clean +maintainer-clean:: distclean + endif