about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Makefile.in2
-rw-r--r--mk/fuzzer.mk28
-rw-r--r--mk/tests.mk28
-rw-r--r--mk/tools.mk50
-rw-r--r--src/compiletest/common.rs (renamed from src/test/compiletest/common.rs)0
-rw-r--r--src/compiletest/compiletest.rc (renamed from src/test/compiletest/compiletest.rc)0
-rw-r--r--src/compiletest/compiletest.rs (renamed from src/test/compiletest/compiletest.rs)0
-rw-r--r--src/compiletest/header.rs (renamed from src/test/compiletest/header.rs)0
-rw-r--r--src/compiletest/procsrv.rs (renamed from src/test/compiletest/procsrv.rs)0
-rw-r--r--src/compiletest/runtest.rs (renamed from src/test/compiletest/runtest.rs)0
-rw-r--r--src/compiletest/util.rs (renamed from src/test/compiletest/util.rs)0
11 files changed, 60 insertions, 48 deletions
diff --git a/Makefile.in b/Makefile.in
index e401ec0ab33..52bc981176f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -321,7 +321,7 @@ include $(CFG_SRC_DIR)/mk/stage0.mk
 include $(CFG_SRC_DIR)/mk/rt.mk
 include $(CFG_SRC_DIR)/mk/rustllvm.mk
 include $(CFG_SRC_DIR)/mk/autodep.mk
-include $(CFG_SRC_DIR)/mk/fuzzer.mk
+include $(CFG_SRC_DIR)/mk/tools.mk
 include $(CFG_SRC_DIR)/mk/docs.mk
 
 
diff --git a/mk/fuzzer.mk b/mk/fuzzer.mk
deleted file mode 100644
index ced5d6ce6fe..00000000000
--- a/mk/fuzzer.mk
+++ /dev/null
@@ -1,28 +0,0 @@
-FUZZER_CRATE := $(S)src/fuzzer/fuzzer.rc
-FUZZER_INPUTS := $(wildcard $(addprefix $(S)src/fuzzer/, *.rs))
-
-define FUZZ_STAGE_N
-
-# We only really care about fuzzing on the host arch
-$$(TARGET_BIN$(1)$(CFG_HOST_TRIPLE))/fuzzer$$(X): \
-	$$(FUZZER_CRATE) $$(FUZZER_INPUTS) \
-	$$(TARGET_SREQ$(1)$(CFG_HOST_TRIPLE)) \
-	$$(TARGET_LIB$(1)$(CFG_HOST_TRIPLE))/$$(CFG_STDLIB) \
-	$$(TARGET_LIB$(1)$(CFG_HOST_TRIPLE))/$$(CFG_LIBRUSTC)
-	@$$(call E, compile_and_link: $$@)
-	$$(STAGE$(1)) -o $$@ $$<
-
-# Promote the stageN target to stageN+1 host
-# FIXME: Shouldn't need to depend on host/librustc.so once
-# rpath is working
-$$(HOST_BIN$(2))/fuzzer$$(X): \
-	$$(TARGET_BIN$(1)$(CFG_HOST_TRIPLE))/fuzzer$$(X) \
-	$$(HOST_LIB$(2))/$$(CFG_LIBRUSTC)
-	@$$(call E, cp: $$@)
-	$$(Q)cp $$< $$@
-
-endef
-
-$(eval $(call FUZZ_STAGE_N,0,1))
-$(eval $(call FUZZ_STAGE_N,1,2))
-$(eval $(call FUZZ_STAGE_N,2,3))
diff --git a/mk/tests.mk b/mk/tests.mk
index 7dae7e6d552..112aa7b70fc 100644
--- a/mk/tests.mk
+++ b/mk/tests.mk
@@ -56,10 +56,6 @@ ifdef VERBOSE
   CTEST_TESTARGS += --verbose
 endif
 
-# The test runner that runs the cfail/rfail/rpass and bench tests
-COMPILETEST_CRATE := $(S)src/test/compiletest/compiletest.rc
-COMPILETEST_INPUTS := $(wildcard $(S)src/test/compiletest/*rs)
-
 # The standard library test crate
 STDTEST_CRATE := $(S)src/test/stdtest/stdtest.rc
 STDTEST_INPUTS := $(wildcard $(S)src/test/stdtest/*rs)
@@ -241,61 +237,55 @@ PRETTY_PRETTY_ARGS$(2) := $$(CTEST_COMMON_ARGS$(2)) \
                           --build-base test/pretty/ \
                           --mode pretty \
 
-test/compiletest.stage$(2)$$(X): $$(COMPILETEST_CRATE) \
-                                 $$(COMPILETEST_INPUTS) \
-                                 $$(SREQ$(2)$$(CFG_HOST_TRIPLE))
-	@$$(call E, compile_and_link: $$@)
-	$$(STAGE$(2)) -o $$@ $$<
-
-test/compile-fail.stage$(2).out.tmp: test/compiletest.stage$(2)$$(X) \
+test/compile-fail.stage$(2).out.tmp: $$(HOST_BIN$(2))/compiletest$$(X) \
                                    $$(CFAIL_TESTS)
 	@$$(call E, run: $$<)
 	$$(Q)$$(call CFG_RUN_CTEST,$(2),$$<) $$(CFAIL_ARGS$(2))
 	$$(Q)touch $$@
 
-test/run-fail.stage$(2).out.tmp: test/compiletest.stage$(2)$$(X) \
+test/run-fail.stage$(2).out.tmp: $$(HOST_BIN$(2))/compiletest$$(X) \
                                $$(RFAIL_TESTS)
 	@$$(call E, run: $$<)
 	$$(Q)$$(call CFG_RUN_CTEST,$(2),$$<) $$(RFAIL_ARGS$(2))
 	$$(Q)touch $$@
 
-test/run-pass.stage$(2).out.tmp: test/compiletest.stage$(2)$$(X) \
+test/run-pass.stage$(2).out.tmp: $$(HOST_BIN$(2))/compiletest$$(X) \
                                $$(RPASS_TESTS)
 	@$$(call E, run: $$<)
 	$$(Q)$$(call CFG_RUN_CTEST,$(2),$$<) $$(RPASS_ARGS$(2))
 	$$(Q)touch $$@
 
-test/bench.stage$(2).out.tmp: test/compiletest.stage$(2)$$(X) \
+test/bench.stage$(2).out.tmp: $$(HOST_BIN$(2))/compiletest$$(X) \
                             $$(BENCH_TESTS)
 	@$$(call E, run: $$<)
 	$$(Q)$$(call CFG_RUN_CTEST,$(2),$$<) $$(BENCH_ARGS$(2))
 	$$(Q)touch $$@
 
-test/perf.stage$(2).out.tmp: test/compiletest.stage$(2)$$(X) \
+test/perf.stage$(2).out.tmp: $$(HOST_BIN$(2))/compiletest$$(X) \
                             $$(BENCH_TESTS)
 	@$$(call E, perf: $$<)
 	$$(Q)$$(call CFG_RUN_CTEST,$(2),$$<) $$(PERF_ARGS$(2))
 	$$(Q)touch $$@
 
-test/pretty-rpass.stage$(2).out.tmp: test/compiletest.stage$(2)$$(X) \
+test/pretty-rpass.stage$(2).out.tmp: $$(HOST_BIN$(2))/compiletest$$(X) \
                                      $$(RPASS_TESTS)
 	@$$(call E, run: $$<)
 	$$(Q)$$(call CFG_RUN_CTEST,$(2),$$<) $$(PRETTY_RPASS_ARGS$(2))
 	$$(Q)touch $$@
 
-test/pretty-rfail.stage$(2).out.tmp: test/compiletest.stage$(2)$$(X) \
+test/pretty-rfail.stage$(2).out.tmp: $$(HOST_BIN$(2))/compiletest$$(X) \
                                      $$(RFAIL_TESTS)
 	@$$(call E, run: $$<)
 	$$(Q)$$(call CFG_RUN_CTEST,$(2),$$<) $$(PRETTY_RFAIL_ARGS$(2))
 	$$(Q)touch $$@
 
-test/pretty-bench.stage$(2).out.tmp: test/compiletest.stage$(2)$$(X) \
+test/pretty-bench.stage$(2).out.tmp: $$(HOST_BIN$(2))/compiletest$$(X) \
                                      $$(BENCH_TESTS)
 	@$$(call E, run: $$<)
 	$$(Q)$$(call CFG_RUN_CTEST,$(2),$$<) $$(PRETTY_BENCH_ARGS$(2))
 	$$(Q)touch $$@
 
-test/pretty-pretty.stage$(2).out.tmp: test/compiletest.stage$(2)$$(X) \
+test/pretty-pretty.stage$(2).out.tmp: $$(HOST_BIN$(2))/compiletest$$(X) \
                                      $$(PRETTY_TESTS)
 	@$$(call E, run: $$<)
 	$$(Q)$$(call CFG_RUN_CTEST,$(2),$$<) $$(PRETTY_PRETTY_ARGS$(2))
diff --git a/mk/tools.mk b/mk/tools.mk
new file mode 100644
index 00000000000..8805cd40be1
--- /dev/null
+++ b/mk/tools.mk
@@ -0,0 +1,50 @@
+# Rules for non-core tools built with the compiler, both for target
+# and host architectures
+
+FUZZER_CRATE := $(S)src/fuzzer/fuzzer.rc
+FUZZER_INPUTS := $(wildcard $(addprefix $(S)src/fuzzer/, *.rs))
+
+# The test runner that runs the cfail/rfail/rpass and bench tests
+COMPILETEST_CRATE := $(S)src/compiletest/compiletest.rc
+COMPILETEST_INPUTS := $(wildcard $(S)src/compiletest/*rs)
+
+# FIXME: These are only built for the host arch. Eventually we'll
+# have tools that need to built for other targets.
+define TOOLS_STAGE_N
+
+$$(TARGET_BIN$(1)$(CFG_HOST_TRIPLE))/fuzzer$$(X): \
+	$$(FUZZER_CRATE) $$(FUZZER_INPUTS) \
+	$$(TARGET_SREQ$(1)$(CFG_HOST_TRIPLE)) \
+	$$(TARGET_LIB$(1)$(CFG_HOST_TRIPLE))/$$(CFG_STDLIB) \
+	$$(TARGET_LIB$(1)$(CFG_HOST_TRIPLE))/$$(CFG_LIBRUSTC)
+	@$$(call E, compile_and_link: $$@)
+	$$(STAGE$(1)) -o $$@ $$<
+
+# Promote the stageN target to stageN+1 host
+# FIXME: Shouldn't need to depend on host/librustc.so once
+# rpath is working
+$$(HOST_BIN$(2))/fuzzer$$(X): \
+	$$(TARGET_BIN$(1)$(CFG_HOST_TRIPLE))/fuzzer$$(X) \
+	$$(HOST_LIB$(2))/$$(CFG_LIBRUSTC) \
+	$$(HOST_SREQ$(2))
+	@$$(call E, cp: $$@)
+	$$(Q)cp $$< $$@
+
+$$(TARGET_BIN$(1)$(CFG_HOST_TRIPLE))/compiletest$$(X): \
+	$$(COMPILETEST_CRATE) $$(COMPILETEST_INPUTS) \
+	$$(TARGET_SREQ$(1)$(CFG_HOST_TRIPLE)) \
+	$$(TARGET_LIB$(1)$(CFG_HOST_TRIPLE))/$$(CFG_STDLIB)
+	@$$(call E, compile_and_link: $$@)
+	$$(STAGE$(1)) -o $$@ $$<
+
+$$(HOST_BIN$(2))/compiletest$$(X): \
+	$$(TARGET_BIN$(1)$(CFG_HOST_TRIPLE))/compiletest$$(X) \
+	$$(HOST_SREQ$(2))
+	@$$(call E, cp: $$@)
+	$$(Q)cp $$< $$@
+
+endef
+
+$(eval $(call TOOLS_STAGE_N,0,1))
+$(eval $(call TOOLS_STAGE_N,1,2))
+$(eval $(call TOOLS_STAGE_N,2,3))
diff --git a/src/test/compiletest/common.rs b/src/compiletest/common.rs
index ab0415fd7c1..ab0415fd7c1 100644
--- a/src/test/compiletest/common.rs
+++ b/src/compiletest/common.rs
diff --git a/src/test/compiletest/compiletest.rc b/src/compiletest/compiletest.rc
index 2f9ffe50f81..2f9ffe50f81 100644
--- a/src/test/compiletest/compiletest.rc
+++ b/src/compiletest/compiletest.rc
diff --git a/src/test/compiletest/compiletest.rs b/src/compiletest/compiletest.rs
index b75bb10bab3..b75bb10bab3 100644
--- a/src/test/compiletest/compiletest.rs
+++ b/src/compiletest/compiletest.rs
diff --git a/src/test/compiletest/header.rs b/src/compiletest/header.rs
index 890818d4574..890818d4574 100644
--- a/src/test/compiletest/header.rs
+++ b/src/compiletest/header.rs
diff --git a/src/test/compiletest/procsrv.rs b/src/compiletest/procsrv.rs
index 6a40aaccaf4..6a40aaccaf4 100644
--- a/src/test/compiletest/procsrv.rs
+++ b/src/compiletest/procsrv.rs
diff --git a/src/test/compiletest/runtest.rs b/src/compiletest/runtest.rs
index de188f3927e..de188f3927e 100644
--- a/src/test/compiletest/runtest.rs
+++ b/src/compiletest/runtest.rs
diff --git a/src/test/compiletest/util.rs b/src/compiletest/util.rs
index aa6c7d5abdb..aa6c7d5abdb 100644
--- a/src/test/compiletest/util.rs
+++ b/src/compiletest/util.rs