make/common/NativeCompilation.gmk
changeset 54076 4b4745d185eb
parent 53683 48ff68e2fe5c
child 54380 e297c7bb6469
child 57262 e2b18d61132f
equal deleted inserted replaced
54075:daec95ed6795 54076:4b4745d185eb
   503   # Make sure the dirs exist.
   503   # Make sure the dirs exist.
   504   $$(call MakeDir, $$($1_OBJECT_DIR) $$($1_OUTPUT_DIR))
   504   $$(call MakeDir, $$($1_OBJECT_DIR) $$($1_OUTPUT_DIR))
   505   $$(foreach d, $$($1_SRC), $$(if $$(wildcard $$d), , \
   505   $$(foreach d, $$($1_SRC), $$(if $$(wildcard $$d), , \
   506       $$(error SRC specified to SetupNativeCompilation $1 contains missing directory $$d)))
   506       $$(error SRC specified to SetupNativeCompilation $1 contains missing directory $$d)))
   507 
   507 
   508   # Find all files in the source trees. Preserve order.
   508   $1_SRCS_RAW = $$(call CacheFind, $$($1_SRC))
   509   $1_SRCS := $$(foreach s, $$($1_SRC), $$(call CacheFind, $$(s)))
   509   # Order src files according to the order of the src dirs
       
   510   $1_SRCS := $$(foreach d, $$($1_SRC), $$(filter $$d%, $$($1_SRCS_RAW)))
   510   $1_SRCS := $$(filter $$(NATIVE_SOURCE_EXTENSIONS), $$($1_SRCS))
   511   $1_SRCS := $$(filter $$(NATIVE_SOURCE_EXTENSIONS), $$($1_SRCS))
   511   # Extract the C/C++ files.
   512   # Extract the C/C++ files.
   512   ifneq ($$($1_EXCLUDE_PATTERNS), )
   513   ifneq ($$($1_EXCLUDE_PATTERNS), )
   513     # We must not match the exclude pattern against the src root(s).
   514     # We must not match the exclude pattern against the src root(s).
   514     $1_SRCS_WITHOUT_ROOTS := $$($1_SRCS)
   515     $1_SRCS_WITHOUT_ROOTS := $$($1_SRCS)
   968         ifneq ($$(wildcard $$($1_IMPORT_LIBRARY)), $$($1_IMPORT_LIBRARY))
   969         ifneq ($$(wildcard $$($1_IMPORT_LIBRARY)), $$($1_IMPORT_LIBRARY))
   969           $$(call LogDebug, Deleting $$($1_BASENAME) because import library is missing)
   970           $$(call LogDebug, Deleting $$($1_BASENAME) because import library is missing)
   970           $$(shell $(RM) $$($1_TARGET))
   971           $$(shell $(RM) $$($1_TARGET))
   971         endif
   972         endif
   972         $$($1_IMPORT_LIBRARY): $$($1_TARGET)
   973         $$($1_IMPORT_LIBRARY): $$($1_TARGET)
   973 		$$(if $$(CORRECT_FUNCTION_IN_RECIPE_EVALUATION), \
       
   974 		  $$(if $$(wildcard $$@), , $$(error $$@ was not created for $$<)) \
       
   975 		)
       
   976 		$(TOUCH) $$@
   974 		$(TOUCH) $$@
       
   975 
       
   976         $1 += $$($1_IMPORT_LIBRARY)
   977       endif
   977       endif
   978     endif
   978     endif
   979 
   979 
   980     $1_VARDEPS := $$($1_LD) $$($1_SYSROOT_LDFLAGS) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) \
   980     $1_VARDEPS := $$($1_LD) $$($1_SYSROOT_LDFLAGS) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) \
   981         $$(GLOBAL_LIBS) $$($1_LIBS) $$($1_EXTRA_LIBS) $$($1_MT) \
   981         $$(GLOBAL_LIBS) $$($1_LIBS) $$($1_EXTRA_LIBS) $$($1_MT) \