]> git.lizzy.rs Git - rust.git/blob - mk/reconfig.mk
librustc: Don't try to perform the magical
[rust.git] / mk / reconfig.mk
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.
4 #
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.
10
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))
15
16 ifndef CFG_DISABLE_MANAGE_SUBMODULES
17 # This is a pretty expensive operation but I don't see any way to avoid it
18 NEED_GIT_RECONFIG=$(shell cd "$(CFG_SRC_DIR)" && "$(CFG_GIT)" submodule status | grep -c '^\(+\|-\)')
19 else
20 NEED_GIT_RECONFIG=0
21 endif
22
23 ifeq ($(NEED_GIT_RECONFIG),0)
24 else
25 # If the submodules have changed then always execute config.mk
26 .PHONY: config.stamp
27 endif
28
29 Makefile config.mk: config.stamp
30
31 config.stamp: $(S)configure $(S)Makefile.in $(S)src/snapshots.txt
32         @$(call E, cfg: reconfiguring)
33         $(S)configure $(CFG_CONFIGURE_ARGS)