From 5fc2e9e9ab9cf0329fb9f18c28c2df545e4e3edc Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Fri, 10 Feb 2012 12:07:01 -0800 Subject: [PATCH] support a fast-make mode that avoids globbing into llvm and libuv --- configure | 1 + mk/llvm.mk | 5 +++++ mk/rt.mk | 17 ++++++++++++----- 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)))" \