make/common/NativeCompilation.gmk
changeset 58361 ad863044567e
parent 55292 f4b2d5b83ebf
child 58419 18e27ee2276b
child 58665 30a5049a36bb
child 58679 9c3209ff7550
child 58846 f9ac726ab347
equal deleted inserted replaced
58358:d658f4379c63 58361:ad863044567e
   758 		    $$($1_PCH_COMMAND) $$< -o $$($1_PCH_FILE))
   758 		    $$($1_PCH_COMMAND) $$< -o $$($1_PCH_FILE))
   759       endif
   759       endif
   760     endif
   760     endif
   761   endif
   761   endif
   762 
   762 
   763   # Create a rule to collect all the individual make dependency files into a
       
   764   # single makefile.
       
   765   $1_DEPS_FILE := $$($1_OBJECT_DIR)/$1.d
       
   766 
       
   767   $$($1_DEPS_FILE): $$($1_ALL_OBJS)
       
   768 	$(RM) $$@
       
   769         # CD into dir to reduce risk of hitting command length limits, which
       
   770         # could otherwise happen if TOPDIR is a very long path.
       
   771 	$(CD) $$($1_OBJECT_DIR) && $(CAT) *.d > $$@.tmp
       
   772 	$(CD) $$($1_OBJECT_DIR) && $(CAT) *.d.targets | $(SORT) -u >> $$@.tmp
       
   773         # After generating the file, which happens after all objects have been
       
   774         # compiled, copy it to .old extension. On the next make invocation, this
       
   775         # .old file will be included by make.
       
   776 	$(CP) $$@.tmp $$@.old
       
   777 	$(MV) $$@.tmp $$@
       
   778 
       
   779   $1 += $$($1_DEPS_FILE)
       
   780 
       
   781   # The include must be on the .old file, which represents the state from the
       
   782   # previous invocation of make. The file being included must not have a rule
       
   783   # defined for it as otherwise make will think it has to run the rule before
       
   784   # being able to include the file, which would be wrong since we specifically
       
   785   # need the file as it was generated by a previous make invocation.
       
   786   ifneq ($$(wildcard $$($1_DEPS_FILE).old), )
       
   787     $1_DEPS_FILE_LOADED := true
       
   788     -include $$($1_DEPS_FILE).old
       
   789   endif
       
   790 
       
   791   # Now call SetupCompileNativeFile for each source file we are going to compile.
   763   # Now call SetupCompileNativeFile for each source file we are going to compile.
   792   $$(foreach file, $$($1_SRCS), \
   764   $$(foreach file, $$($1_SRCS), \
   793       $$(eval $$(call SetupCompileNativeFile, $1_$$(notdir $$(file)),\
   765       $$(eval $$(call SetupCompileNativeFile, $1_$$(notdir $$(file)),\
   794           FILE := $$(file), \
   766           FILE := $$(file), \
   795           BASE := $1, \
   767           BASE := $1, \
   846 		    >> $$($1_RES_DEPS_FILE) ; \
   818 		    >> $$($1_RES_DEPS_FILE) ; \
   847 		$(ECHO) >> $$($1_RES_DEPS_FILE) ;\
   819 		$(ECHO) >> $$($1_RES_DEPS_FILE) ;\
   848 		$(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_RES_DEPS_FILE) \
   820 		$(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_RES_DEPS_FILE) \
   849 		    > $$($1_RES_DEPS_TARGETS_FILE)
   821 		    > $$($1_RES_DEPS_TARGETS_FILE)
   850     endif
   822     endif
       
   823   endif
       
   824 
       
   825   # Create a rule to collect all the individual make dependency files into a
       
   826   # single makefile.
       
   827   $1_DEPS_FILE := $$($1_OBJECT_DIR)/$1.d
       
   828 
       
   829   $$($1_DEPS_FILE): $$($1_ALL_OBJS) $$($1_RES)
       
   830 	$(RM) $$@
       
   831         # CD into dir to reduce risk of hitting command length limits, which
       
   832         # could otherwise happen if TOPDIR is a very long path.
       
   833 	$(CD) $$($1_OBJECT_DIR) && $(CAT) *.d > $$@.tmp
       
   834 	$(CD) $$($1_OBJECT_DIR) && $(CAT) *.d.targets | $(SORT) -u >> $$@.tmp
       
   835         # After generating the file, which happens after all objects have been
       
   836         # compiled, copy it to .old extension. On the next make invocation, this
       
   837         # .old file will be included by make.
       
   838 	$(CP) $$@.tmp $$@.old
       
   839 	$(MV) $$@.tmp $$@
       
   840 
       
   841   $1 += $$($1_DEPS_FILE)
       
   842 
       
   843   # The include must be on the .old file, which represents the state from the
       
   844   # previous invocation of make. The file being included must not have a rule
       
   845   # defined for it as otherwise make will think it has to run the rule before
       
   846   # being able to include the file, which would be wrong since we specifically
       
   847   # need the file as it was generated by a previous make invocation.
       
   848   ifneq ($$(wildcard $$($1_DEPS_FILE).old), )
       
   849     $1_DEPS_FILE_LOADED := true
       
   850     -include $$($1_DEPS_FILE).old
   851   endif
   851   endif
   852 
   852 
   853   ifneq ($(DISABLE_MAPFILES), true)
   853   ifneq ($(DISABLE_MAPFILES), true)
   854     $1_REAL_MAPFILE := $$($1_MAPFILE)
   854     $1_REAL_MAPFILE := $$($1_MAPFILE)
   855     ifeq ($(call isTargetOs, windows), false)
   855     ifeq ($(call isTargetOs, windows), false)