From 814c3d0d7693207078e8e7112d674f9a230d0f75 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 3 Nov 2011 14:32:52 -0700 Subject: [PATCH] Add clean-all rule which also cleans LLVM --- mk/clean.mk | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/mk/clean.mk b/mk/clean.mk index 2009df61f2d..d1db178f9c0 100644 --- a/mk/clean.mk +++ b/mk/clean.mk @@ -6,8 +6,14 @@ CLEAN_STAGE_RULES = $(foreach target,$(CFG_TARGET_TRIPLES), \ clean0$(target) clean1$(target) clean2$(target) clean3$(target)) \ clean0 clean1 clean2 clean3 +CLEAN_LLVM_RULES = $(foreach target,$(CFG_TARGET_TRIPLES), \ + clean-llvm$(target)) -.PHONY: clean +.PHONY: clean clean-all clean-misc + +clean-all: clean clean-llvm + +clean-llvm: $(CLEAN_LLVM_RULES) clean: clean-misc $(CLEAN_STAGE_RULES) @@ -66,3 +72,19 @@ $(foreach target, $(CFG_TARGET_TRIPLES), \ $(eval $(call CLEAN_STAGE_N,1,$(target))) \ $(eval $(call CLEAN_STAGE_N,2,$(target))) \ $(eval $(call CLEAN_STAGE_N,3,$(target)))) + + +define DEF_CLEAN_LLVM_TARGET +ifeq ($(CFG_LLVM_ROOT),) + +clean-llvm$(1): + $$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1)) clean +else + +clean-llvm$(1): ; + +endif +endef + +$(foreach target, $(CFG_TARGET_TRIPLES), \ + $(eval $(call DEF_CLEAN_LLVM_TARGET,$(target)))) \ No newline at end of file