about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@mozilla.com>2012-02-10 12:07:01 -0800
committerGraydon Hoare <graydon@mozilla.com>2012-02-10 12:07:11 -0800
commit5fc2e9e9ab9cf0329fb9f18c28c2df545e4e3edc (patch)
tree438f6f201e160af560d4dc1f0a0f4c042ced43ca
parent8e55d3130a1b8eab3b80c85e71a2a800fb9442f0 (diff)
downloadrust-5fc2e9e9ab9cf0329fb9f18c28c2df545e4e3edc.tar.gz
rust-5fc2e9e9ab9cf0329fb9f18c28c2df545e4e3edc.zip
support a fast-make mode that avoids globbing into llvm and libuv
-rwxr-xr-xconfigure1
-rw-r--r--mk/llvm.mk5
-rw-r--r--mk/rt.mk17
3 files changed, 18 insertions, 5 deletions
diff --git a/configure b/configure
index 10770c07b74..a910f6d9eab 100755
--- a/configure
+++ b/configure
@@ -262,6 +262,7 @@ opt docs     1 "build documentation"
 opt optimize 1 "build optimized rust code"
 opt optimize-cxx 1 "build optimized C++ code"
 opt optimize-llvm 1 "build optimized LLVM"
+opt fast-make 0 "use .gitmodules as timestamp for submodule deps"
 opt manage-submodules 1 "let the build manage the git submodules"
 opt mingw-cross 0 "cross-compile for win32 using mingw"
 opt clang 0 "prefer clang to gcc for building the runtime"
diff --git a/mk/llvm.mk b/mk/llvm.mk
index 17a8425c227..9b7c82c139d 100644
--- a/mk/llvm.mk
+++ b/mk/llvm.mk
@@ -1,3 +1,7 @@
+
+ifdef CFG_ENABLE_FAST_MAKE
+LLVM_DEPS := $(S)/.gitmodules
+else
 # Recursive wildcard function
 # http://blog.jgc.org/2011/07/gnu-make-recursive-wildcard-function.html
 rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) \
@@ -5,6 +9,7 @@ rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) \
 
 # This is just a rough approximation of LLVM deps
 LLVM_DEPS=$(call rwildcard,$(CFG_LLVM_SRC_DIR),*cpp *hpp)
+endif
 
 define DEF_LLVM_RULES
 
diff --git a/mk/rt.mk b/mk/rt.mk
index 2ba8610f344..e43a68e5211 100644
--- a/mk/rt.mk
+++ b/mk/rt.mk
@@ -158,11 +158,18 @@ rt/$(1)/$(CFG_RUNTIME): $$(RUNTIME_OBJS_$(1)) $$(MKFILE_DEPS) \
 # FIXME: For some reason libuv's makefiles can't figure out the correct definition
 # of CC on the mingw I'm using, so we are explicitly using gcc. Also, we
 # have to list environment variables first on windows... mysterious
-$$(LIBUV_LIB_$(1)): $$(wildcard \
-                     $$(S)src/libuv/* \
-                     $$(S)src/libuv/*/* \
-                     $$(S)src/libuv/*/*/* \
-                     $$(S)src/libuv/*/*/*/*)
+
+ifdef CFG_ENABLE_FAST_MAKE
+LIBUV_DEPS := $$(S)/.gitmodules
+else
+LIBUV_DEPS := $$(wildcard \
+              $$(S)src/libuv/* \
+              $$(S)src/libuv/*/* \
+              $$(S)src/libuv/*/*/* \
+              $$(S)src/libuv/*/*/*/*)
+endif
+
+$$(LIBUV_LIB_$(1)): $$(LIBUV_DEPS)
 	$$(Q)$$(MAKE) -C $$(S)mk/libuv/$$(LIBUV_ARCH_$(1))/$$(LIBUV_OSTYPE_$(1)) \
 		CFLAGS="$$(LIBUV_FLAGS_$$(HOST_$(1)))" \
         LDFLAGS="$$(LIBUV_FLAGS_$$(HOST_$(1)))" \