< prev index next >

make/common/MakeBase.gmk

Print this page




 656         - $(FIND_CACHE_DIRS)) $(FIND_CACHE_DIRS), $1)
 657     ifneq ($$(FIND_CACHE_NEW_DIRS), )
 658       # Remove any trailing slash from dirs in the cache dir list
 659       FIND_CACHE_DIRS += $$(patsubst %/,%, $$(FIND_CACHE_NEW_DIRS))
 660       FIND_CACHE := $$(sort $$(FIND_CACHE) $$(shell $(FIND) $$(FIND_CACHE_NEW_DIRS) \( -type f -o -type l \) $2))
 661     endif
 662   endef
 663 
 664   # Mimics find by looking in the cache if all of the directories have been cached.
 665   # Otherwise reverts to shell find. This is safe to call on all platforms, even if
 666   # cache is deactivated.
 667   #
 668   # $1 can be either a directory or a file. If it's a directory, make
 669   # sure we have exactly one trailing slash before the wildcard.
 670   # The extra - is needed when FIND_CACHE_DIRS is empty but should be harmless.
 671   #
 672   # Param 1 - Dirs to find in
 673   # Param 2 - (optional) specialization. Normally "-a \( ... \)" expression.
 674   define CacheFind
 675       $(if $(filter-out $(addsuffix /%,- $(FIND_CACHE_DIRS)) $(FIND_CACHE_DIRS),$1), \
 676     $(shell $(FIND) $1 \( -type f -o -type l \) $2), \
 677         $(filter $(addsuffix /%,$(patsubst %/,%,$1)) $1,$(FIND_CACHE)))
 678   endef
 679 
 680 else
 681   # If CacheFind is disabled, just run the find command.
 682   # Param 1 - Dirs to find in
 683   # Param 2 - (optional) specialization. Normally "-a \( ... \)" expression.
 684   define CacheFind
 685     $(shell $(FIND) $1 \( -type f -o -type l \) $2)
 686   endef
 687 endif
 688 
 689 ################################################################################
 690 
 691 define AddFileToCopy
 692   # Helper macro for SetupCopyFiles
 693   # 1 : Source file
 694   # 2 : Dest file
 695   # 3 : Variable to add targets to
 696   # 4 : Macro to call for copy operation




 656         - $(FIND_CACHE_DIRS)) $(FIND_CACHE_DIRS), $1)
 657     ifneq ($$(FIND_CACHE_NEW_DIRS), )
 658       # Remove any trailing slash from dirs in the cache dir list
 659       FIND_CACHE_DIRS += $$(patsubst %/,%, $$(FIND_CACHE_NEW_DIRS))
 660       FIND_CACHE := $$(sort $$(FIND_CACHE) $$(shell $(FIND) $$(FIND_CACHE_NEW_DIRS) \( -type f -o -type l \) $2))
 661     endif
 662   endef
 663 
 664   # Mimics find by looking in the cache if all of the directories have been cached.
 665   # Otherwise reverts to shell find. This is safe to call on all platforms, even if
 666   # cache is deactivated.
 667   #
 668   # $1 can be either a directory or a file. If it's a directory, make
 669   # sure we have exactly one trailing slash before the wildcard.
 670   # The extra - is needed when FIND_CACHE_DIRS is empty but should be harmless.
 671   #
 672   # Param 1 - Dirs to find in
 673   # Param 2 - (optional) specialization. Normally "-a \( ... \)" expression.
 674   define CacheFind
 675     $(if $(filter-out $(addsuffix /%,- $(FIND_CACHE_DIRS)) $(FIND_CACHE_DIRS),$1), \
 676       $(if $(wildcard $1), $(shell $(FIND) $1 \( -type f -o -type l \) $2)), \
 677       $(filter $(addsuffix /%,$(patsubst %/,%,$1)) $1,$(FIND_CACHE)))
 678   endef
 679 
 680 else
 681   # If CacheFind is disabled, just run the find command.
 682   # Param 1 - Dirs to find in
 683   # Param 2 - (optional) specialization. Normally "-a \( ... \)" expression.
 684   define CacheFind
 685     $(shell $(FIND) $1 \( -type f -o -type l \) $2)
 686   endef
 687 endif
 688 
 689 ################################################################################
 690 
 691 define AddFileToCopy
 692   # Helper macro for SetupCopyFiles
 693   # 1 : Source file
 694   # 2 : Dest file
 695   # 3 : Variable to add targets to
 696   # 4 : Macro to call for copy operation


< prev index next >