2011-05-01 15:18:52 -05:00
|
|
|
######################################################################
|
|
|
|
# Cleanup
|
|
|
|
######################################################################
|
|
|
|
|
2011-11-21 15:11:40 -06:00
|
|
|
CLEAN_STAGE_RULES = \
|
|
|
|
$(foreach stage, $(STAGES), \
|
|
|
|
$(foreach host, $(CFG_TARGET_TRIPLES), \
|
|
|
|
clean$(stage)_H_$(host) \
|
|
|
|
$(foreach target, $(CFG_TARGET_TRIPLES), \
|
2011-11-23 17:23:40 -06:00
|
|
|
clean$(stage)_T_$(target)_H_$(host))))
|
2011-09-29 13:48:44 -05:00
|
|
|
|
2011-11-21 15:11:40 -06:00
|
|
|
CLEAN_LLVM_RULES = \
|
|
|
|
$(foreach target, $(CFG_TARGET_TRIPLES), \
|
|
|
|
clean-llvm$(target))
|
2011-09-29 13:48:44 -05:00
|
|
|
|
2011-11-03 16:32:52 -05:00
|
|
|
.PHONY: clean clean-all clean-misc
|
|
|
|
|
|
|
|
clean-all: clean clean-llvm
|
|
|
|
|
|
|
|
clean-llvm: $(CLEAN_LLVM_RULES)
|
2011-05-01 15:18:52 -05:00
|
|
|
|
2011-09-29 13:48:44 -05:00
|
|
|
clean: clean-misc $(CLEAN_STAGE_RULES)
|
|
|
|
|
|
|
|
clean-misc:
|
2011-05-01 15:18:52 -05:00
|
|
|
@$(call E, cleaning)
|
2012-04-04 19:57:36 -05:00
|
|
|
$(Q)find rustllvm rt $(CFG_HOST_TRIPLE)/test \
|
|
|
|
-name '*.[odasS]' -o \
|
|
|
|
-name '*.so' -o \
|
|
|
|
-name '*.dylib' -o \
|
|
|
|
-name '*.dll' -o \
|
|
|
|
-name '*.def' -o \
|
2012-04-16 19:44:40 -05:00
|
|
|
-name '*.bc' \
|
2012-04-04 19:57:36 -05:00
|
|
|
| xargs rm -f
|
2012-04-16 19:44:40 -05:00
|
|
|
$(Q)find rustllvm rt $(CFG_HOST_TRIPLE)\
|
|
|
|
-name '*.dSYM' \
|
|
|
|
| xargs rm -Rf
|
2011-05-01 15:18:52 -05:00
|
|
|
$(Q)rm -f $(RUNTIME_OBJS) $(RUNTIME_DEF)
|
|
|
|
$(Q)rm -f $(RUSTLLVM_LIB_OBJS) $(RUSTLLVM_OBJS_OBJS) $(RUSTLLVM_DEF)
|
2011-12-30 14:47:43 -06:00
|
|
|
$(Q)rm -Rf $(DOCS)
|
|
|
|
$(Q)rm -Rf $(GENERATED)
|
2012-04-04 19:57:36 -05:00
|
|
|
$(Q)rm -f tmp/*.log tmp/*.rc tmp/*.rs
|
2011-05-01 15:18:52 -05:00
|
|
|
$(Q)rm -Rf $(PKG_NAME)-*.tar.gz dist
|
|
|
|
$(Q)rm -Rf $(foreach ext, \
|
2012-01-06 09:18:27 -06:00
|
|
|
html aux cp fn ky log pdf pg toc tp vr cps, \
|
2011-12-30 14:47:43 -06:00
|
|
|
$(wildcard doc/*.$(ext) \
|
|
|
|
doc/*/*.$(ext) \
|
|
|
|
doc/*/*/*.$(ext)))
|
2012-01-12 21:10:30 -06:00
|
|
|
$(Q)rm -Rf doc/version.md
|
2011-12-30 14:47:43 -06:00
|
|
|
$(Q)rm -Rf $(foreach sub, index styles files search javascript, \
|
|
|
|
$(wildcard doc/*/$(sub)))
|
2011-09-29 13:48:44 -05:00
|
|
|
|
2011-11-21 15:11:40 -06:00
|
|
|
define CLEAN_HOST_STAGE_N
|
|
|
|
|
|
|
|
clean$(1)_H_$(2):
|
|
|
|
$(Q)rm -f $$(HBIN$(1)_H_$(2))/rustc$(X)
|
|
|
|
$(Q)rm -f $$(HBIN$(1)_H_$(2))/fuzzer$(X)
|
2011-12-01 13:31:29 -06:00
|
|
|
$(Q)rm -f $$(HBIN$(1)_H_$(2))/cargo$(X)
|
2012-02-24 22:02:52 -06:00
|
|
|
$(Q)rm -f $$(HBIN$(1)_H_$(2))/serializer$(X)
|
2011-12-30 14:47:43 -06:00
|
|
|
$(Q)rm -f $$(HBIN$(1)_H_$(2))/rustdoc$(X)
|
2012-11-04 18:22:05 -06:00
|
|
|
$(Q)rm -f $$(HBIN$(1)_H_$(2))/rusti$(X)
|
2012-10-03 19:32:30 -05:00
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_LIBFUZZER)
|
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_LIBCARGO)
|
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_LIBRUSTDOC)
|
2011-11-21 15:11:40 -06:00
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_RUNTIME)
|
2011-12-02 10:51:59 -06:00
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_CORELIB)
|
2011-11-21 15:11:40 -06:00
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_STDLIB)
|
2011-12-02 10:51:59 -06:00
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_LIBRUSTC)
|
2012-05-29 23:35:12 -05:00
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_LIBSYNTAX)
|
2012-11-04 18:22:05 -06:00
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_LIBRUSTI)
|
2011-12-02 10:51:59 -06:00
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CORELIB_GLOB)
|
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(STDLIB_GLOB)
|
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(LIBRUSTC_GLOB)
|
2012-05-29 23:35:12 -05:00
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(LIBSYNTAX_GLOB)
|
2012-10-03 19:32:30 -05:00
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(LIBFUZZER_GLOB)
|
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(LIBCARGO_GLOB)
|
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(LIBRUSTDOC_GLOB)
|
2012-11-04 18:22:05 -06:00
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(LIBRUSTI_GLOB)
|
2011-11-21 15:11:40 -06:00
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_RUSTLLVM)
|
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/libstd.rlib
|
2011-09-29 13:48:44 -05:00
|
|
|
|
|
|
|
endef
|
|
|
|
|
2011-11-21 15:11:40 -06:00
|
|
|
$(foreach host, $(CFG_TARGET_TRIPLES), \
|
|
|
|
$(eval $(foreach stage, $(STAGES), \
|
|
|
|
$(eval $(call CLEAN_HOST_STAGE_N,$(stage),$(host))))))
|
|
|
|
|
|
|
|
define CLEAN_TARGET_STAGE_N
|
|
|
|
|
2011-11-23 17:23:40 -06:00
|
|
|
clean$(1)_T_$(2)_H_$(3):
|
2011-11-21 15:11:40 -06:00
|
|
|
$(Q)rm -f $$(TBIN$(1)_T_$(2)_H_$(3))/rustc$(X)
|
|
|
|
$(Q)rm -f $$(TBIN$(1)_T_$(2)_H_$(3))/fuzzer$(X)
|
2011-12-30 14:47:43 -06:00
|
|
|
$(Q)rm -f $$(TBIN$(1)_T_$(2)_H_$(3))/cargo$(X)
|
2012-02-24 22:02:52 -06:00
|
|
|
$(Q)rm -f $$(TBIN$(1)_T_$(2)_H_$(3))/serializer$(X)
|
2011-12-30 14:47:43 -06:00
|
|
|
$(Q)rm -f $$(TBIN$(1)_T_$(2)_H_$(3))/rustdoc$(X)
|
2012-10-03 19:32:30 -05:00
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBFUZZER)
|
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBCARGO)
|
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBRUSTDOC)
|
2011-11-21 15:11:40 -06:00
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_RUNTIME)
|
2011-12-02 10:51:59 -06:00
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_CORELIB)
|
2011-11-21 15:11:40 -06:00
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_STDLIB)
|
2011-12-02 10:51:59 -06:00
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBRUSTC)
|
2012-05-29 23:35:12 -05:00
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBSYNTAX)
|
2011-12-02 10:51:59 -06:00
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(CORELIB_GLOB)
|
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(STDLIB_GLOB)
|
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(LIBRUSTC_GLOB)
|
2012-05-29 23:35:12 -05:00
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(LIBSYNTAX_GLOB)
|
2012-10-03 19:32:30 -05:00
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(LIBFUZZER_GLOB)
|
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(LIBCARGO_GLOB)
|
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(LIBRUSTDOC_GLOB)
|
2011-11-21 15:11:40 -06:00
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_RUSTLLVM)
|
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/libstd.rlib
|
2011-12-30 14:47:43 -06:00
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/libmorestack.a
|
2012-11-30 17:02:00 -06:00
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/librun_pass*
|
2011-11-21 15:11:40 -06:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach host, $(CFG_TARGET_TRIPLES), \
|
|
|
|
$(eval $(foreach target, $(CFG_TARGET_TRIPLES), \
|
2011-11-23 17:23:40 -06:00
|
|
|
$(eval $(foreach stage, 0 1 2 3, \
|
2011-11-21 15:11:40 -06:00
|
|
|
$(eval $(call CLEAN_TARGET_STAGE_N,$(stage),$(target),$(host))))))))
|
2011-11-03 16:32:52 -05:00
|
|
|
|
|
|
|
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), \
|
2011-11-08 16:36:19 -06:00
|
|
|
$(eval $(call DEF_CLEAN_LLVM_TARGET,$(target))))
|