]> git.proxmox.com Git - rustc.git/blame - mk/reconfig.mk
New upstream version 1.16.0+dfsg1
[rustc.git] / mk / reconfig.mk
CommitLineData
1a4d82fc
JJ
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
13rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) \
14 $(filter $(subst *,%,$2),$d))
15
16ifndef 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.
22NEED_GIT_RECONFIG=$(shell cd "$(CFG_SRC_DIR)" && $(CFG_GIT) submodule status | grep -c '^+')
23else
24NEED_GIT_RECONFIG=0
25endif
26
27ifeq ($(NEED_GIT_RECONFIG),0)
28else
29# If the submodules have changed then always execute config.mk
30.PHONY: config.stamp
31endif
32
33Makefile config.mk: config.stamp
34
62682a34
SL
35ifeq ($(SREL),)
36SREL_ROOT := ./
37else
38SREL_ROOT := $(SREL)
39endif
40
a7813a04 41config.stamp: $(S)configure $(S)Makefile.in $(S)src/stage0.txt
1a4d82fc 42 @$(call E, cfg: reconfiguring)
62682a34 43 $(SREL_ROOT)configure $(CFG_CONFIGURE_ARGS)