1 # Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 # file at the top-level directory of this distribution and at
3 # http://rust-lang.org/COPYRIGHT.
5 # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 # option. This file may not be copied, modified, or distributed
9 # except according to those terms.
11 # Recursive wildcard function
12 # http://blog.jgc.org/2011/07/gnu-make-recursive-wildcard-function.html
13 rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) \
14 $(filter $(subst *,%,$2),$d))
16 ifndef CFG_DISABLE_MANAGE_SUBMODULES
17 # This is a pretty expensive operation but I don't see any way to avoid it
18 # NB: This only looks for '+' status (wrong commit checked out), not '-' status
19 # (nothing checked out at all). `./configure --{llvm,jemalloc}-root`
20 # will explicitly deinitialize the corresponding submodules, and we don't
21 # want to force constant rebuilds in that case.
22 NEED_GIT_RECONFIG=$(shell cd "$(CFG_SRC_DIR)" && "$(CFG_GIT)" submodule status | grep -c '^+')
27 ifeq ($(NEED_GIT_RECONFIG),0)
29 # If the submodules have changed then always execute config.mk
33 Makefile config.mk: config.stamp
35 config.stamp: $(S)configure $(S)Makefile.in $(S)src/snapshots.txt
36 @$(call E, cfg: reconfiguring)
37 $(S)configure $(CFG_CONFIGURE_ARGS)