Skip to content

Commit

Permalink
* добавлена поддержка стандартных целей *clean (Metrolog/marks#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-s-betke committed Jun 16, 2018
1 parent bf9d26f commit 04b4e6a
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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

0 comments on commit 04b4e6a

Please sign in to comment.