1 # Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 # file at the top-level directory of this distribution and at
3 # http://rust-lang.org/COPYRIGHT.
5 # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 # option. This file may not be copied, modified, or distributed
9 # except according to those terms.
11 ######################################################################
12 # Copy debugger related scripts
13 ######################################################################
15 DEBUGGER_RUSTLIB_ETC_SCRIPTS=lldb_rust_formatters.py
16 DEBUGGER_BIN_SCRIPTS=rust-lldb
18 DEBUGGER_RUSTLIB_ETC_SCRIPTS_ABS=$(foreach script,$(DEBUGGER_RUSTLIB_ETC_SCRIPTS), \
19 $(CFG_SRC_DIR)src/etc/$(script))
20 DEBUGGER_BIN_SCRIPTS_ABS=$(foreach script,$(DEBUGGER_BIN_SCRIPTS), \
21 $(CFG_SRC_DIR)src/etc/$(script))
23 DEBUGGER_SCRIPTS_ALL=$(DEBUGGER_RUSTLIB_ETC_SCRIPTS_ABS) $(DEBUGGER_BIN_SCRIPTS_ABS)
25 # $(1) - the stage to copy to
26 # $(2) - the host triple
27 define DEF_INSTALL_DEBUGGER_SCRIPTS_HOST
29 tmp/install-debugger-scripts$(1)_H_$(2).done: $$(DEBUGGER_SCRIPTS_ALL)
30 $(Q)mkdir -p $$(HBIN$(1)_H_$(2))
31 $(Q)mkdir -p $$(HLIB$(1)_H_$(2))/rustlib/etc
32 $(Q)install $(DEBUGGER_BIN_SCRIPTS_ABS) $$(HBIN$(1)_H_$(2))
33 $(Q)install $(DEBUGGER_RUSTLIB_ETC_SCRIPTS_ABS) $$(HLIB$(1)_H_$(2))/rustlib/etc
37 # Expand host make-targets for all stages
38 $(foreach stage,$(STAGES), \
39 $(foreach host,$(CFG_HOST), \
40 $(eval $(call DEF_INSTALL_DEBUGGER_SCRIPTS_HOST,$(stage),$(host)))))
42 # $(1) is the stage number
43 # $(2) is the target triple
44 # $(3) is the host triple
45 define DEF_INSTALL_DEBUGGER_SCRIPTS_TARGET
47 tmp/install-debugger-scripts$(1)_T_$(2)_H_$(3).done: $$(DEBUGGER_SCRIPTS_ALL)
48 $(Q)mkdir -p $$(TBIN$(1)_T_$(2)_H_$(3))
49 $(Q)mkdir -p $$(TLIB$(1)_T_$(2)_H_$(3))/rustlib/etc
50 $(Q)install $(DEBUGGER_BIN_SCRIPTS_ABS) $$(TBIN$(1)_T_$(2)_H_$(3))
51 $(Q)install $(DEBUGGER_RUSTLIB_ETC_SCRIPTS_ABS) $$(TLIB$(1)_T_$(2)_H_$(3))/rustlib/etc
55 # Expand target make-targets for all stages
56 $(foreach stage,$(STAGES), \
57 $(foreach target,$(CFG_TARGET), \
58 $(foreach host,$(CFG_HOST), \
59 $(eval $(call DEF_INSTALL_DEBUGGER_SCRIPTS_TARGET,$(stage),$(target),$(host))))))