2012-12-11 02:32:48 +01:00
|
|
|
# Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
# file at the top-level directory of this distribution and at
|
|
|
|
# http://rust-lang.org/COPYRIGHT.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
# option. This file may not be copied, modified, or distributed
|
|
|
|
# except according to those terms.
|
|
|
|
|
2011-05-01 22:18:52 +02:00
|
|
|
######################################################################
|
|
|
|
# Cleanup
|
|
|
|
######################################################################
|
|
|
|
|
2011-11-21 22:11:40 +01:00
|
|
|
CLEAN_STAGE_RULES = \
|
|
|
|
$(foreach stage, $(STAGES), \
|
2013-02-22 01:15:01 +01:00
|
|
|
$(foreach host, $(CFG_HOST_TRIPLES), \
|
2011-11-21 22:11:40 +01:00
|
|
|
clean$(stage)_H_$(host) \
|
|
|
|
$(foreach target, $(CFG_TARGET_TRIPLES), \
|
2011-11-24 00:23:40 +01:00
|
|
|
clean$(stage)_T_$(target)_H_$(host))))
|
2011-09-29 20:48:44 +02:00
|
|
|
|
2011-11-21 22:11:40 +01:00
|
|
|
CLEAN_LLVM_RULES = \
|
2013-06-30 05:54:17 +02:00
|
|
|
$(foreach target, $(CFG_HOST_TRIPLES), \
|
2011-11-21 22:11:40 +01:00
|
|
|
clean-llvm$(target))
|
2011-09-29 20:48:44 +02:00
|
|
|
|
2013-06-28 02:10:07 +02:00
|
|
|
.PHONY: clean clean-all clean-misc clean-llvm
|
2011-11-03 22:32:52 +01:00
|
|
|
|
|
|
|
clean-all: clean clean-llvm
|
|
|
|
|
|
|
|
clean-llvm: $(CLEAN_LLVM_RULES)
|
2011-05-01 22:18:52 +02:00
|
|
|
|
2011-09-29 20:48:44 +02:00
|
|
|
clean: clean-misc $(CLEAN_STAGE_RULES)
|
|
|
|
|
|
|
|
clean-misc:
|
2011-05-01 22:18:52 +02:00
|
|
|
@$(call E, cleaning)
|
2013-09-04 09:45:01 +02:00
|
|
|
$(Q)find $(CFG_BUILD_TRIPLE)/rustllvm \
|
|
|
|
$(CFG_BUILD_TRIPLE)/rt \
|
|
|
|
$(CFG_BUILD_TRIPLE)/test \
|
2012-04-05 02:57:36 +02:00
|
|
|
-name '*.[odasS]' -o \
|
|
|
|
-name '*.so' -o \
|
|
|
|
-name '*.dylib' -o \
|
|
|
|
-name '*.dll' -o \
|
|
|
|
-name '*.def' -o \
|
2012-04-17 02:44:40 +02:00
|
|
|
-name '*.bc' \
|
2012-04-05 02:57:36 +02:00
|
|
|
| xargs rm -f
|
2013-09-04 09:45:01 +02:00
|
|
|
$(Q)find $(CFG_BUILD_TRIPLE)\
|
2012-04-17 02:44:40 +02:00
|
|
|
-name '*.dSYM' \
|
|
|
|
| xargs rm -Rf
|
2011-05-01 22:18:52 +02:00
|
|
|
$(Q)rm -f $(RUNTIME_OBJS) $(RUNTIME_DEF)
|
|
|
|
$(Q)rm -f $(RUSTLLVM_LIB_OBJS) $(RUSTLLVM_OBJS_OBJS) $(RUSTLLVM_DEF)
|
2011-12-30 21:47:43 +01:00
|
|
|
$(Q)rm -Rf $(DOCS)
|
|
|
|
$(Q)rm -Rf $(GENERATED)
|
2013-09-06 09:17:14 +02:00
|
|
|
$(Q)rm -Rf tmp/*
|
2012-12-14 01:41:47 +01:00
|
|
|
$(Q)rm -Rf rust-stage0-*.tar.bz2 $(PKG_NAME)-*.tar.gz dist
|
2011-05-01 22:18:52 +02:00
|
|
|
$(Q)rm -Rf $(foreach ext, \
|
2012-01-06 16:18:27 +01:00
|
|
|
html aux cp fn ky log pdf pg toc tp vr cps, \
|
2013-09-27 00:13:03 +02:00
|
|
|
$(wildcard doc/*.$(ext)))
|
|
|
|
$(Q)find doc/std doc/extra -mindepth 1 | xargs rm -Rf
|
2012-01-13 04:10:30 +01:00
|
|
|
$(Q)rm -Rf doc/version.md
|
2011-12-30 21:47:43 +01:00
|
|
|
$(Q)rm -Rf $(foreach sub, index styles files search javascript, \
|
|
|
|
$(wildcard doc/*/$(sub)))
|
2011-09-29 20:48:44 +02:00
|
|
|
|
2011-11-21 22:11:40 +01:00
|
|
|
define CLEAN_HOST_STAGE_N
|
|
|
|
|
|
|
|
clean$(1)_H_$(2):
|
2013-03-02 13:25:12 +01:00
|
|
|
$(Q)rm -f $$(HBIN$(1)_H_$(2))/rustc$(X_$(2))
|
|
|
|
$(Q)rm -f $$(HBIN$(1)_H_$(2))/rustpkg$(X_$(2))
|
|
|
|
$(Q)rm -f $$(HBIN$(1)_H_$(2))/serializer$(X_$(2))
|
|
|
|
$(Q)rm -f $$(HBIN$(1)_H_$(2))/rustdoc$(X_$(2))
|
|
|
|
$(Q)rm -f $$(HBIN$(1)_H_$(2))/rust$(X_$(2))
|
2013-02-27 06:53:35 +01:00
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_LIBRUSTPKG_$(2))
|
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_LIBRUSTDOC_$(2))
|
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_RUNTIME_$(2))
|
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_STDLIB_$(2))
|
2013-05-17 19:45:09 +02:00
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_EXTRALIB_$(2))
|
2013-02-27 06:53:35 +01:00
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_LIBRUSTC_$(2))
|
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_LIBSYNTAX_$(2))
|
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(STDLIB_GLOB_$(2))
|
2013-05-17 19:45:09 +02:00
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(EXTRALIB_GLOB_$(2))
|
2013-02-27 06:53:35 +01:00
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(LIBRUSTC_GLOB_$(2))
|
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(LIBSYNTAX_GLOB_$(2))
|
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(LIBRUSTPKG_GLOB_$(2))
|
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(LIBRUSTDOC_GLOB_$(2))
|
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_RUSTLLVM_$(2))
|
2011-11-21 22:11:40 +01:00
|
|
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/libstd.rlib
|
2011-09-29 20:48:44 +02:00
|
|
|
|
|
|
|
endef
|
|
|
|
|
2013-02-22 01:15:01 +01:00
|
|
|
$(foreach host, $(CFG_HOST_TRIPLES), \
|
2011-11-21 22:11:40 +01:00
|
|
|
$(eval $(foreach stage, $(STAGES), \
|
|
|
|
$(eval $(call CLEAN_HOST_STAGE_N,$(stage),$(host))))))
|
|
|
|
|
|
|
|
define CLEAN_TARGET_STAGE_N
|
|
|
|
|
2011-11-24 00:23:40 +01:00
|
|
|
clean$(1)_T_$(2)_H_$(3):
|
2013-03-02 13:25:12 +01:00
|
|
|
$(Q)rm -f $$(TBIN$(1)_T_$(2)_H_$(3))/rustc$(X_$(2))
|
|
|
|
$(Q)rm -f $$(TBIN$(1)_T_$(2)_H_$(3))/rustpkg$(X_$(2))
|
|
|
|
$(Q)rm -f $$(TBIN$(1)_T_$(2)_H_$(3))/serializer$(X_$(2))
|
|
|
|
$(Q)rm -f $$(TBIN$(1)_T_$(2)_H_$(3))/rustdoc$(X_$(2))
|
|
|
|
$(Q)rm -f $$(TBIN$(1)_T_$(2)_H_$(3))/rust$(X_$(2))
|
2013-02-27 06:53:35 +01:00
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBRUSTPKG_$(2))
|
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBRUSTDOC_$(2))
|
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_RUNTIME_$(2))
|
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_STDLIB_$(2))
|
2013-05-17 19:45:09 +02:00
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_EXTRALIB_$(2))
|
2013-02-27 06:53:35 +01:00
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBRUSTC_$(2))
|
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBSYNTAX_$(2))
|
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(STDLIB_GLOB_$(2))
|
2013-05-17 19:45:09 +02:00
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(EXTRALIB_GLOB_$(2))
|
2013-02-27 06:53:35 +01:00
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(LIBRUSTC_GLOB_$(2))
|
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(LIBSYNTAX_GLOB_$(2))
|
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(LIBRUSTPKG_GLOB_$(2))
|
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(LIBRUSTDOC_GLOB_$(2))
|
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_RUSTLLVM_$(2))
|
2011-11-21 22:11:40 +01:00
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/libstd.rlib
|
2011-12-30 21:47:43 +01:00
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/libmorestack.a
|
2012-12-09 00:48:54 +01:00
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/librun_pass_stage* # For unix
|
|
|
|
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/run_pass_stage* # For windows
|
2011-11-21 22:11:40 +01:00
|
|
|
endef
|
|
|
|
|
2013-02-22 01:15:01 +01:00
|
|
|
$(foreach host, $(CFG_HOST_TRIPLES), \
|
2011-11-21 22:11:40 +01:00
|
|
|
$(eval $(foreach target, $(CFG_TARGET_TRIPLES), \
|
2011-11-24 00:23:40 +01:00
|
|
|
$(eval $(foreach stage, 0 1 2 3, \
|
2011-11-21 22:11:40 +01:00
|
|
|
$(eval $(call CLEAN_TARGET_STAGE_N,$(stage),$(target),$(host))))))))
|
2011-11-03 22:32:52 +01:00
|
|
|
|
2013-02-22 01:15:01 +01:00
|
|
|
define DEF_CLEAN_LLVM_HOST
|
2011-11-03 22:32:52 +01:00
|
|
|
ifeq ($(CFG_LLVM_ROOT),)
|
|
|
|
clean-llvm$(1):
|
|
|
|
$$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1)) clean
|
|
|
|
else
|
|
|
|
clean-llvm$(1): ;
|
|
|
|
|
|
|
|
endif
|
|
|
|
endef
|
|
|
|
|
2013-02-22 01:15:01 +01:00
|
|
|
$(foreach host, $(CFG_HOST_TRIPLES), \
|
|
|
|
$(eval $(call DEF_CLEAN_LLVM_HOST,$(host))))
|