forked from OSchip/llvm-project
				
			For PR619:
Make any header files that are automatically generated be preconditions of the compilation. This ensures that if a *.h.in file is changed then its corresponding *.h file gets updated on the next rebuild. Note that this can lead to confusing (but correct) results if the *.h.in file changed unsubstantially so that autoheader doesn't update the *.h file. In that case, manually touch the *.h file in question to restore order. Moral of the story, if you're going to "touch" a *.in file then modify it substantially. llvm-svn: 23006
This commit is contained in:
		
							parent
							
								
									f85fabeb71
								
							
						
					
					
						commit
						b48e3f8b74
					
				| 
						 | 
				
			
			@ -28,6 +28,13 @@ TopLevelTargets  := check dist dist-check dist-clean tags dist-gzip dist-bzip2 \
 | 
			
		|||
UserTargets      := $(RecursiveTargets) $(LocalTargets) $(TopLevelTargets)
 | 
			
		||||
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
 | 
			
		||||
################################################################################
 | 
			
		||||
| 
						 | 
				
			
			@ -77,6 +84,9 @@ ifneq ($(MakefileConfigIn),)
 | 
			
		|||
PreConditions      += $(MakefileConfig)
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
FilesToConfigPATH  := $(addprefix $(PROJ_OBJ_ROOT)/,$(FilesToConfig))
 | 
			
		||||
PreConditions      += $(FilesToConfigPATH)
 | 
			
		||||
 | 
			
		||||
preconditions : $(PreConditions)
 | 
			
		||||
 | 
			
		||||
#------------------------------------------------------------------------
 | 
			
		||||
| 
						 | 
				
			
			@ -134,6 +144,11 @@ $(ConfigStatusScript): $(ConfigureScript)
 | 
			
		|||
	  $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \
 | 
			
		||||
	  $(ConfigStatusScript)
 | 
			
		||||
 | 
			
		||||
.PRECIOUS: $(FilesToConfigPATH)
 | 
			
		||||
$(FilesToConfigPATH) : $(PROJ_OBJ_ROOT)/% : $(PROJ_SRC_ROOT)/%.in 
 | 
			
		||||
	$(Echo) Regenerating $*
 | 
			
		||||
	$(Verb) cd $(PROJ_OBJ_ROOT) && $(ConfigStatusScript) $*
 | 
			
		||||
 | 
			
		||||
#------------------------------------------------------------------------
 | 
			
		||||
# Make sure the configuration makefile is up to date
 | 
			
		||||
#------------------------------------------------------------------------
 | 
			
		||||
| 
						 | 
				
			
			@ -1576,3 +1591,4 @@ printvars::
 | 
			
		|||
	$(Echo) "YaccFiles    : " '$(YaccFiles)'
 | 
			
		||||
	$(Echo) "LexFiles     : " '$(LexFiles)'
 | 
			
		||||
	$(Echo) "Module       : " '$(Module)'
 | 
			
		||||
	$(Echo) "FilesToConfig: " '$(FilesToConfigPATH)'
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -634,6 +634,10 @@ dnl===
 | 
			
		|||
dnl===-----------------------------------------------------------------------===
 | 
			
		||||
 | 
			
		||||
dnl Configure header files
 | 
			
		||||
dnl WARNING: dnl If you add or remove any of the following config headers, then
 | 
			
		||||
dnl you MUST also update Makefile.rules so that the variable FilesToConfig
 | 
			
		||||
dnl contains the same list of files as AC_CONFIG_HEADERS below. This ensures the
 | 
			
		||||
dnl files can be updated automatically when their *.in sources change.
 | 
			
		||||
AC_CONFIG_HEADERS([include/llvm/Config/config.h])
 | 
			
		||||
AC_CONFIG_HEADERS([include/llvm/Support/DataTypes.h])
 | 
			
		||||
AC_CONFIG_HEADERS([include/llvm/ADT/hash_map])
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue