Skip to content

Commit

Permalink
auto merge of rust-lang#20360 : alexcrichton/rust/rollup, r=alexcrichton
Browse files Browse the repository at this point in the history
  • Loading branch information
bors committed Dec 31, 2014
2 parents 84f5ad8 + 139f44b commit 10d99a9
Show file tree
Hide file tree
Showing 238 changed files with 4,885 additions and 4,947 deletions.
5 changes: 3 additions & 2 deletions mk/clean.mk
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ clean-generic-$(2)-$(1):
-name '*.dll' -o \
-name '*.def' -o \
-name '*.py' -o \
-name '*.pyc' -o \
-name '*.bc' \
\) \
| xargs rm -f
Expand All @@ -79,7 +80,7 @@ define CLEAN_HOST_STAGE_N

clean$(1)_H_$(2): \
$$(foreach crate,$$(CRATES),clean$(1)_H_$(2)-lib-$$(crate)) \
$$(foreach tool,$$(TOOLS) $$(DEBUGGER_BIN_SCRIPTS),clean$(1)_H_$(2)-tool-$$(tool))
$$(foreach tool,$$(TOOLS) $$(DEBUGGER_BIN_SCRIPTS_ALL),clean$(1)_H_$(2)-tool-$$(tool))
$$(Q)rm -fr $(2)/rt/libbacktrace

clean$(1)_H_$(2)-tool-%:
Expand All @@ -99,7 +100,7 @@ define CLEAN_TARGET_STAGE_N

clean$(1)_T_$(2)_H_$(3): \
$$(foreach crate,$$(CRATES),clean$(1)_T_$(2)_H_$(3)-lib-$$(crate)) \
$$(foreach tool,$$(TOOLS) $$(DEBUGGER_BIN_SCRIPTS),clean$(1)_T_$(2)_H_$(3)-tool-$$(tool))
$$(foreach tool,$$(TOOLS) $$(DEBUGGER_BIN_SCRIPTS_ALL),clean$(1)_T_$(2)_H_$(3)-tool-$$(tool))
$$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/libmorestack.a
$$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/libcompiler-rt.a
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/librun_pass_stage* # For unix
Expand Down
101 changes: 88 additions & 13 deletions mk/debuggers.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,77 @@
# Copy debugger related scripts
######################################################################

DEBUGGER_RUSTLIB_ETC_SCRIPTS=lldb_rust_formatters.py
DEBUGGER_BIN_SCRIPTS=rust-lldb

DEBUGGER_RUSTLIB_ETC_SCRIPTS_ABS=$(foreach script,$(DEBUGGER_RUSTLIB_ETC_SCRIPTS), \
$(CFG_SRC_DIR)src/etc/$(script))
DEBUGGER_BIN_SCRIPTS_ABS=$(foreach script,$(DEBUGGER_BIN_SCRIPTS), \
$(CFG_SRC_DIR)src/etc/$(script))
## GDB ##
DEBUGGER_RUSTLIB_ETC_SCRIPTS_GDB=gdb_load_rust_pretty_printers.py \
gdb_rust_pretty_printing.py
DEBUGGER_RUSTLIB_ETC_SCRIPTS_GDB_ABS=\
$(foreach script,$(DEBUGGER_RUSTLIB_ETC_SCRIPTS_GDB), \
$(CFG_SRC_DIR)src/etc/$(script))

DEBUGGER_BIN_SCRIPTS_GDB=rust-gdb
DEBUGGER_BIN_SCRIPTS_GDB_ABS=\
$(foreach script,$(DEBUGGER_BIN_SCRIPTS_GDB), \
$(CFG_SRC_DIR)src/etc/$(script))


## LLDB ##
DEBUGGER_RUSTLIB_ETC_SCRIPTS_LLDB=lldb_rust_formatters.py
DEBUGGER_RUSTLIB_ETC_SCRIPTS_LLDB_ABS=\
$(foreach script,$(DEBUGGER_RUSTLIB_ETC_SCRIPTS_LLDB), \
$(CFG_SRC_DIR)src/etc/$(script))

DEBUGGER_BIN_SCRIPTS_LLDB=rust-lldb
DEBUGGER_BIN_SCRIPTS_LLDB_ABS=\
$(foreach script,$(DEBUGGER_BIN_SCRIPTS_LLDB), \
$(CFG_SRC_DIR)src/etc/$(script))


## ALL ##
DEBUGGER_RUSTLIB_ETC_SCRIPTS_ALL=$(DEBUGGER_RUSTLIB_ETC_SCRIPTS_GDB) \
$(DEBUGGER_RUSTLIB_ETC_SCRIPTS_LLDB)
DEBUGGER_RUSTLIB_ETC_SCRIPTS_ALL_ABS=$(DEBUGGER_RUSTLIB_ETC_SCRIPTS_GDB_ABS) \
$(DEBUGGER_RUSTLIB_ETC_SCRIPTS_LLDB_ABS)
DEBUGGER_BIN_SCRIPTS_ALL=$(DEBUGGER_BIN_SCRIPTS_GDB) \
$(DEBUGGER_BIN_SCRIPTS_LLDB)
DEBUGGER_BIN_SCRIPTS_ALL_ABS=$(DEBUGGER_BIN_SCRIPTS_GDB_ABS) \
$(DEBUGGER_BIN_SCRIPTS_LLDB_ABS)

DEBUGGER_SCRIPTS_ALL=$(DEBUGGER_RUSTLIB_ETC_SCRIPTS_ABS) $(DEBUGGER_BIN_SCRIPTS_ABS)

# $(1) - the stage to copy to
# $(2) - the host triple
define DEF_INSTALL_DEBUGGER_SCRIPTS_HOST

tmp/install-debugger-scripts$(1)_H_$(2).done: $$(DEBUGGER_SCRIPTS_ALL)
tmp/install-debugger-scripts$(1)_H_$(2)-gdb.done: \
$$(DEBUGGER_RUSTLIB_ETC_SCRIPTS_GDB_ABS) \
$$(DEBUGGER_BIN_SCRIPTS_GDB_ABS)
$(Q)mkdir -p $$(HBIN$(1)_H_$(2))
$(Q)mkdir -p $$(HLIB$(1)_H_$(2))/rustlib/etc
$(Q)install $$(DEBUGGER_BIN_SCRIPTS_GDB_ABS) $$(HBIN$(1)_H_$(2))
$(Q)install $$(DEBUGGER_RUSTLIB_ETC_SCRIPTS_GDB_ABS) $$(HLIB$(1)_H_$(2))/rustlib/etc
$(Q)touch $$@

tmp/install-debugger-scripts$(1)_H_$(2)-lldb.done: \
$$(DEBUGGER_RUSTLIB_ETC_SCRIPTS_LLDB_ABS) \
$$(DEBUGGER_BIN_SCRIPTS_LLDB_ABS)
$(Q)mkdir -p $$(HBIN$(1)_H_$(2))
$(Q)mkdir -p $$(HLIB$(1)_H_$(2))/rustlib/etc
$(Q)install $$(DEBUGGER_BIN_SCRIPTS_LLDB_ABS) $$(HBIN$(1)_H_$(2))
$(Q)install $$(DEBUGGER_RUSTLIB_ETC_SCRIPTS_LLDB_ABS) $$(HLIB$(1)_H_$(2))/rustlib/etc
$(Q)touch $$@

tmp/install-debugger-scripts$(1)_H_$(2)-all.done: \
$$(DEBUGGER_RUSTLIB_ETC_SCRIPTS_ALL_ABS) \
$$(DEBUGGER_BIN_SCRIPTS_ALL_ABS)
$(Q)mkdir -p $$(HBIN$(1)_H_$(2))
$(Q)mkdir -p $$(HLIB$(1)_H_$(2))/rustlib/etc
$(Q)install $(DEBUGGER_BIN_SCRIPTS_ABS) $$(HBIN$(1)_H_$(2))
$(Q)install $(DEBUGGER_RUSTLIB_ETC_SCRIPTS_ABS) $$(HLIB$(1)_H_$(2))/rustlib/etc
$(Q)install $$(DEBUGGER_BIN_SCRIPTS_ALL_ABS) $$(HBIN$(1)_H_$(2))
$(Q)install $$(DEBUGGER_RUSTLIB_ETC_SCRIPTS_ALL_ABS) $$(HLIB$(1)_H_$(2))/rustlib/etc
$(Q)touch $$@

tmp/install-debugger-scripts$(1)_H_$(2)-none.done:
$(Q)touch $$@

endef

# Expand host make-targets for all stages
Expand All @@ -44,12 +95,36 @@ $(foreach stage,$(STAGES), \
# $(3) is the host triple
define DEF_INSTALL_DEBUGGER_SCRIPTS_TARGET

tmp/install-debugger-scripts$(1)_T_$(2)_H_$(3).done: $$(DEBUGGER_SCRIPTS_ALL)
tmp/install-debugger-scripts$(1)_T_$(2)_H_$(3)-gdb.done: \
$$(DEBUGGER_RUSTLIB_ETC_SCRIPTS_GDB_ABS) \
$$(DEBUGGER_BIN_SCRIPTS_GDB_ABS)
$(Q)mkdir -p $$(TBIN$(1)_T_$(2)_H_$(3))
$(Q)mkdir -p $$(TLIB$(1)_T_$(2)_H_$(3))/rustlib/etc
$(Q)install $(DEBUGGER_BIN_SCRIPTS_GDB_ABS) $$(TBIN$(1)_T_$(2)_H_$(3))
$(Q)install $(DEBUGGER_RUSTLIB_ETC_SCRIPTS_GDB_ABS) $$(TLIB$(1)_T_$(2)_H_$(3))/rustlib/etc
$(Q)touch $$@

tmp/install-debugger-scripts$(1)_T_$(2)_H_$(3)-lldb.done: \
$$(DEBUGGER_RUSTLIB_ETC_SCRIPTS_LLDB_ABS) \
$$(DEBUGGER_BIN_SCRIPTS_LLDB_ABS)
$(Q)mkdir -p $$(TBIN$(1)_T_$(2)_H_$(3))
$(Q)mkdir -p $$(TLIB$(1)_T_$(2)_H_$(3))/rustlib/etc
$(Q)install $(DEBUGGER_BIN_SCRIPTS_ABS) $$(TBIN$(1)_T_$(2)_H_$(3))
$(Q)install $(DEBUGGER_RUSTLIB_ETC_SCRIPTS_ABS) $$(TLIB$(1)_T_$(2)_H_$(3))/rustlib/etc
$(Q)install $(DEBUGGER_BIN_SCRIPTS_LLDB_ABS) $$(TBIN$(1)_T_$(2)_H_$(3))
$(Q)install $(DEBUGGER_RUSTLIB_ETC_SCRIPTS_LLDB_ABS) $$(TLIB$(1)_T_$(2)_H_$(3))/rustlib/etc
$(Q)touch $$@

tmp/install-debugger-scripts$(1)_T_$(2)_H_$(3)-all.done: \
$$(DEBUGGER_RUSTLIB_ETC_SCRIPTS_ALL_ABS) \
$$(DEBUGGER_BIN_SCRIPTS_ALL_ABS)
$(Q)mkdir -p $$(TBIN$(1)_T_$(2)_H_$(3))
$(Q)mkdir -p $$(TLIB$(1)_T_$(2)_H_$(3))/rustlib/etc
$(Q)install $(DEBUGGER_BIN_SCRIPTS_ALL_ABS) $$(TBIN$(1)_T_$(2)_H_$(3))
$(Q)install $(DEBUGGER_RUSTLIB_ETC_SCRIPTS_ALL_ABS) $$(TLIB$(1)_T_$(2)_H_$(3))/rustlib/etc
$(Q)touch $$@

tmp/install-debugger-scripts$(1)_T_$(2)_H_$(3)-none.done:
$(Q)touch $$@

endef

# Expand target make-targets for all stages
Expand Down
6 changes: 3 additions & 3 deletions mk/dist.mk
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ LICENSE.txt: $(S)COPYRIGHT $(S)LICENSE-APACHE $(S)LICENSE-MIT
# Source tarball
######################################################################

PKG_TAR = dist/$(PKG_NAME).tar.gz
PKG_TAR = dist/$(PKG_NAME)-src.tar.gz

PKG_GITMODULES := $(S)src/llvm $(S)src/compiler-rt \
$(S)src/rt/hoedown $(S)src/jemalloc
Expand Down Expand Up @@ -241,8 +241,8 @@ dist/$$(PKG_NAME)-$(1).tar.gz: dist-install-dir-$(1)
@$(call E, build: $$@)
# Copy essential gcc components into installer
ifdef CFG_WINDOWSY_$(1)
$$(Q)rm -Rf dist/win-rust-gcc-$(1)
$$(Q)$$(CFG_PYTHON) $$(S)src/etc/make-win-dist.py tmp/dist/$$(PKG_NAME)-$(1)-image dist/win-rust-gcc-$(1) $(1)
$$(Q)rm -Rf tmp/dist/win-rust-gcc-$(1)
$$(Q)$$(CFG_PYTHON) $$(S)src/etc/make-win-dist.py tmp/dist/$$(PKG_NAME)-$(1)-image tmp/dist/win-rust-gcc-$(1) $(1)
$$(Q)cp -r $$(S)src/etc/third-party tmp/dist/$$(PKG_NAME)-$(1)-image/share/doc/
endif
$$(Q)$$(S)src/rust-installer/gen-installer.sh \
Expand Down
18 changes: 14 additions & 4 deletions mk/main.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
# The version number
CFG_RELEASE_NUM=0.13.0

# An optional number to put after the label, e.g. '2' -> '-beta2'
CFG_BETA_CYCLE=

CFG_FILENAME_EXTRA=4e7c5e5c

ifeq ($(CFG_RELEASE_CHANNEL),stable)
Expand All @@ -24,12 +27,13 @@ CFG_RELEASE=$(CFG_RELEASE_NUM)
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)
endif
ifeq ($(CFG_RELEASE_CHANNEL),beta)
CFG_RELEASE=$(CFG_RELEASE_NUM)-beta
# The beta channel is temporarily called 'alpha'
CFG_RELEASE=$(CFG_RELEASE_NUM)-alpha$(CFG_BETA_CYCLE)
# When building beta/nightly distributables just reuse the same "beta"
# name so when we upload we'll always override the previous
# nighly. This doesn't actually impact the version reported by rustc -
# it's just for file naming.
CFG_PACKAGE_VERS=beta
CFG_PACKAGE_VERS=alpha
endif
ifeq ($(CFG_RELEASE_CHANNEL),nightly)
CFG_RELEASE=$(CFG_RELEASE_NUM)-nightly
Expand Down Expand Up @@ -325,6 +329,12 @@ export CFG_DISABLE_INJECT_STD_VERSION
# Per-stage targets and runner
######################################################################

# Valid setting-strings are 'all', 'none', 'gdb', 'lldb'
# This 'function' will determine which debugger scripts to copy based on a
# target triple. See debuggers.mk for more information.
TRIPLE_TO_DEBUGGER_SCRIPT_SETTING=\
$(if $(findstring windows,$(1)),none,$(if $(findstring darwin,$(1)),lldb,gdb))

STAGES = 0 1 2 3

define SREQ
Expand Down Expand Up @@ -357,7 +367,7 @@ else
HSREQ$(1)_H_$(3) = \
$$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
$$(MKFILE_DEPS) \
tmp/install-debugger-scripts$(1)_H_$(3).done
tmp/install-debugger-scripts$(1)_H_$(3)-$$(call TRIPLE_TO_DEBUGGER_SCRIPT_SETTING,$(3)).done
endif

# Prerequisites for using the stageN compiler to build target artifacts
Expand All @@ -372,7 +382,7 @@ SREQ$(1)_T_$(2)_H_$(3) = \
$$(TSREQ$(1)_T_$(2)_H_$(3)) \
$$(foreach dep,$$(TARGET_CRATES), \
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(dep)) \
tmp/install-debugger-scripts$(1)_T_$(2)_H_$(3).done
tmp/install-debugger-scripts$(1)_T_$(2)_H_$(3)-$$(call TRIPLE_TO_DEBUGGER_SCRIPT_SETTING,$(2)).done

# Prerequisites for a working stageN compiler and complete set of target
# libraries
Expand Down
28 changes: 25 additions & 3 deletions mk/prepare.mk
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,27 @@ prepare-target-$(2)-host-$(3)-$(1)-$(4): prepare-maybe-clean-$(4) \
$$(call PREPARE_LIB,libcompiler-rt.a),),),)
endef

define INSTALL_GDB_DEBUGGER_SCRIPTS_COMMANDS
$(Q)$(PREPARE_BIN_CMD) $(DEBUGGER_BIN_SCRIPTS_GDB_ABS) $(PREPARE_DEST_BIN_DIR)
$(Q)$(PREPARE_LIB_CMD) $(DEBUGGER_RUSTLIB_ETC_SCRIPTS_GDB_ABS) $(PREPARE_DEST_LIB_DIR)/rustlib/etc
endef

define INSTALL_LLDB_DEBUGGER_SCRIPTS_COMMANDS
$(Q)$(PREPARE_BIN_CMD) $(DEBUGGER_BIN_SCRIPTS_LLDB_ABS) $(PREPARE_DEST_BIN_DIR)
$(Q)$(PREPARE_LIB_CMD) $(DEBUGGER_RUSTLIB_ETC_SCRIPTS_LLDB_ABS) $(PREPARE_DEST_LIB_DIR)/rustlib/etc
endef

define INSTALL_NO_DEBUGGER_SCRIPTS_COMMANDS
$(Q)echo "No debugger scripts will be installed for host $(PREPARE_HOST)"
endef

# $(1) is PREPARE_HOST
INSTALL_DEBUGGER_SCRIPT_COMMANDS=$(if $(findstring windows,$(1)),\
$(INSTALL_NO_DEBUGGER_SCRIPTS_COMMANDS),\
$(if $(findstring darwin,$(1)),\
$(INSTALL_LLDB_DEBUGGER_SCRIPTS_COMMANDS),\
$(INSTALL_GDB_DEBUGGER_SCRIPTS_COMMANDS)))

define DEF_PREPARE

prepare-base-$(1): PREPARE_SOURCE_DIR=$$(PREPARE_HOST)/stage$$(PREPARE_STAGE)
Expand All @@ -170,9 +191,10 @@ prepare-host-dirs-$(1): prepare-maybe-clean-$(1)
$$(call PREPARE_DIR,$$(PREPARE_DEST_LIB_DIR)/rustlib/etc)
$$(call PREPARE_DIR,$$(PREPARE_DEST_MAN_DIR))

prepare-debugger-scripts-$(1): prepare-host-dirs-$(1) $(DEBUGGER_SCRIPTS_ALL)
$$(Q)$$(PREPARE_BIN_CMD) $(DEBUGGER_BIN_SCRIPTS_ABS) $$(PREPARE_DEST_BIN_DIR)
$$(Q)$$(PREPARE_LIB_CMD) $(DEBUGGER_RUSTLIB_ETC_SCRIPTS_ABS) $$(PREPARE_DEST_LIB_DIR)/rustlib/etc
prepare-debugger-scripts-$(1): prepare-host-dirs-$(1) \
$$(DEBUGGER_BIN_SCRIPTS_ALL_ABS) \
$$(DEBUGGER_RUSTLIB_ETC_SCRIPTS_ALL_ABS)
$$(call INSTALL_DEBUGGER_SCRIPT_COMMANDS,$$(PREPARE_HOST))

$$(foreach tool,$$(PREPARE_TOOLS), \
$$(foreach host,$$(CFG_HOST), \
Expand Down
Loading

0 comments on commit 10d99a9

Please sign in to comment.