For PR614:

Move the implementation of the fix from Makefile.rules to Makefile. This
ensures that it is only checked on a top-level rebuild, and not in every
single subdirectory. This removes some annoying messages from the build and
numerous executions of config.status if the .in file changes but not
substantively enough to cause the .h file to be modified by config.status.

llvm-svn: 23039
This commit is contained in:
Reid Spencer 2005-08-25 04:59:49 +00:00
parent 2296582d06
commit 3cbdac1edb
2 changed files with 19 additions and 21 deletions

View File

@ -51,3 +51,21 @@ dist-hook::
tools-only: all tools-only: all
libs-only: all libs-only: all
#------------------------------------------------------------------------
# Make sure the generated headers are up-to-date. This must be kept in
# sync with the AC_CONFIG_HEADER invocations in autoconf/configure.ac
#------------------------------------------------------------------------
FilesToConfig := \
include/llvm/Config/config.h \
include/llvm/Support/DataTypes.h \
include/llvm/ADT/hash_map \
include/llvm/ADT/hash_set \
include/llvm/ADT/iterator
FilesToConfigPATH := $(addprefix $(LLVM_OBJ_ROOT)/,$(FilesToConfig))
all-local:: $(FilesToConfigPATH)
$(FilesToConfigPATH) : $(LLVM_OBJ_ROOT)/% : $(LLVM_SRC_ROOT)/%.in
$(Echo) Regenerating $*
$(Verb) cd $(LLVM_OBJ_ROOT) && $(ConfigStatusScript) $*
.PRECIOUS: $(FilesToConfigPATH)

View File

@ -28,13 +28,6 @@ TopLevelTargets := check dist dist-check dist-clean tags dist-gzip dist-bzip2 \
UserTargets := $(RecursiveTargets) $(LocalTargets) $(TopLevelTargets) UserTargets := $(RecursiveTargets) $(LocalTargets) $(TopLevelTargets)
InternalTargets := preconditions distdir dist-hook InternalTargets := preconditions distdir dist-hook
FilesToConfig := \
include/llvm/Config/config.h \
include/llvm/Support/DataTypes.h \
include/llvm/ADT/hash_map \
include/llvm/ADT/hash_set \
include/llvm/ADT/iterator
################################################################################ ################################################################################
# INITIALIZATION: Basic things the makefile needs # INITIALIZATION: Basic things the makefile needs
################################################################################ ################################################################################
@ -84,10 +77,7 @@ ifneq ($(MakefileConfigIn),)
PreConditions += $(MakefileConfig) PreConditions += $(MakefileConfig)
endif endif
FilesToConfigPATH := $(addprefix $(LLVM_OBJ_ROOT)/,$(FilesToConfig)) preconditions: $(PreConditions)
PreConditions += $(FilesToConfigPATH)
preconditions : $(PreConditions)
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# Make sure the BUILT_SOURCES are built first # Make sure the BUILT_SOURCES are built first
@ -144,16 +134,6 @@ $(ConfigStatusScript): $(ConfigureScript)
$(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \ $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
$(ConfigStatusScript) $(ConfigStatusScript)
#------------------------------------------------------------------------
# If we're buildilng LLVM, then make sure the generated headers are Up2Dt
#------------------------------------------------------------------------
ifeq ($(LLVM_OBJ_ROOT),$(PROJ_OBJ_ROOT))
.PRECIOUS: $(FilesToConfigPATH)
$(FilesToConfigPATH) : $(LLVM_OBJ_ROOT)/% : $(LLVM_SRC_ROOT)/%.in
$(Echo) Regenerating $*
$(Verb) cd $(LLVM_OBJ_ROOT) && $(ConfigStatusScript) $*
endif
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# Make sure the configuration makefile is up to date # Make sure the configuration makefile is up to date
#------------------------------------------------------------------------ #------------------------------------------------------------------------