Skip to content

Commit 814c3d0

Browse files
committed
Add clean-all rule which also cleans LLVM
1 parent 2e54a76 commit 814c3d0

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

mk/clean.mk

+23-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@ CLEAN_STAGE_RULES = $(foreach target,$(CFG_TARGET_TRIPLES), \
66
clean0$(target) clean1$(target) clean2$(target) clean3$(target)) \
77
clean0 clean1 clean2 clean3
88

9+
CLEAN_LLVM_RULES = $(foreach target,$(CFG_TARGET_TRIPLES), \
10+
clean-llvm$(target))
911

10-
.PHONY: clean
12+
.PHONY: clean clean-all clean-misc
13+
14+
clean-all: clean clean-llvm
15+
16+
clean-llvm: $(CLEAN_LLVM_RULES)
1117

1218
clean: clean-misc $(CLEAN_STAGE_RULES)
1319

@@ -66,3 +72,19 @@ $(foreach target, $(CFG_TARGET_TRIPLES), \
6672
$(eval $(call CLEAN_STAGE_N,1,$(target))) \
6773
$(eval $(call CLEAN_STAGE_N,2,$(target))) \
6874
$(eval $(call CLEAN_STAGE_N,3,$(target))))
75+
76+
77+
define DEF_CLEAN_LLVM_TARGET
78+
ifeq ($(CFG_LLVM_ROOT),)
79+
80+
clean-llvm$(1):
81+
$$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1)) clean
82+
else
83+
84+
clean-llvm$(1): ;
85+
86+
endif
87+
endef
88+
89+
$(foreach target, $(CFG_TARGET_TRIPLES), \
90+
$(eval $(call DEF_CLEAN_LLVM_TARGET,$(target))))

0 commit comments

Comments
 (0)