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"
+
+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) \
# This is just a rough approximation of LLVM deps
LLVM_DEPS=$(call rwildcard,$(CFG_LLVM_SRC_DIR),*cpp *hpp)
+endif
define DEF_LLVM_RULES
# 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)))" \