443 $$(call MakeDir,$$($1_OBJECT_DIR) $$($1_OUTPUT_DIR))
444 $$(foreach d,$$($1_SRC), $$(if $$(wildcard $$d),, \
445 $$(error SRC specified to SetupNativeCompilation $1 contains missing directory $$d)))
446
447 # Find all files in the source trees. Sort to remove duplicates.
448 $1_SRCS := $$(sort $$(call CacheFind,$$($1_SRC)))
449 $1_SRCS := $$(filter $$(NATIVE_SOURCE_EXTENSIONS), $$($1_SRCS))
450 # Extract the C/C++ files.
451 ifneq ($$($1_EXCLUDE_PATTERNS), )
452 # We must not match the exclude pattern against the src root(s).
453 $1_SRCS_WITHOUT_ROOTS := $$($1_SRCS)
454 $$(foreach i,$$($1_SRC),$$(eval $1_SRCS_WITHOUT_ROOTS := $$(patsubst \
455 $$i/%,%, $$($1_SRCS_WITHOUT_ROOTS))))
456 $1_ALL_EXCLUDE_FILES := $$(call containing, $$($1_EXCLUDE_PATTERNS), \
457 $$($1_SRCS_WITHOUT_ROOTS))
458 endif
459 ifneq ($$($1_EXCLUDE_FILES),)
460 $1_ALL_EXCLUDE_FILES += $$($1_EXCLUDE_FILES)
461 endif
462 ifneq ($$($1_ALL_EXCLUDE_FILES),)
463 $1_EXCLUDE_FILES_PAT := $$($1_ALL_EXCLUDE_FILES) \
464 $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_ALL_EXCLUDE_FILES)))
465 $1_EXCLUDE_FILES_PAT := $$(addprefix %,$$($1_EXCLUDE_FILES_PAT))
466 $1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES_PAT),$$($1_SRCS))
467 endif
468 ifneq ($$($1_INCLUDE_FILES), )
469 $1_INCLUDE_FILES_PAT := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_INCLUDE_FILES)))
470 $1_SRCS := $$(filter $$($1_INCLUDE_FILES_PAT),$$($1_SRCS))
471 endif
472 # There can be only a single bin dir root, no need to foreach over the roots.
473 $1_BINS := $$(wildcard $$($1_OBJECT_DIR)/*$(OBJ_SUFFIX))
474 # Now we have a list of all c/c++ files to compile: $$($1_SRCS)
475 # and we have a list of all existing object files: $$($1_BINS)
476
477 # Prepend the source/bin path to the filter expressions. Then do the filtering.
478 ifneq ($$($1_INCLUDES),)
479 $1_SRC_INCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_INCLUDES))))
480 $1_SRCS := $$(filter $$($1_SRC_INCLUDES),$$($1_SRCS))
481 endif
482 ifneq ($$($1_EXCLUDES),)
483 $1_SRC_EXCLUDES := $$(addsuffix /%,$$($1_EXCLUDES))
|
443 $$(call MakeDir,$$($1_OBJECT_DIR) $$($1_OUTPUT_DIR))
444 $$(foreach d,$$($1_SRC), $$(if $$(wildcard $$d),, \
445 $$(error SRC specified to SetupNativeCompilation $1 contains missing directory $$d)))
446
447 # Find all files in the source trees. Sort to remove duplicates.
448 $1_SRCS := $$(sort $$(call CacheFind,$$($1_SRC)))
449 $1_SRCS := $$(filter $$(NATIVE_SOURCE_EXTENSIONS), $$($1_SRCS))
450 # Extract the C/C++ files.
451 ifneq ($$($1_EXCLUDE_PATTERNS), )
452 # We must not match the exclude pattern against the src root(s).
453 $1_SRCS_WITHOUT_ROOTS := $$($1_SRCS)
454 $$(foreach i,$$($1_SRC),$$(eval $1_SRCS_WITHOUT_ROOTS := $$(patsubst \
455 $$i/%,%, $$($1_SRCS_WITHOUT_ROOTS))))
456 $1_ALL_EXCLUDE_FILES := $$(call containing, $$($1_EXCLUDE_PATTERNS), \
457 $$($1_SRCS_WITHOUT_ROOTS))
458 endif
459 ifneq ($$($1_EXCLUDE_FILES),)
460 $1_ALL_EXCLUDE_FILES += $$($1_EXCLUDE_FILES)
461 endif
462 ifneq ($$($1_ALL_EXCLUDE_FILES),)
463 $1_EXCLUDE_FILES_PAT := \
464 $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_ALL_EXCLUDE_FILES)))
465 $1_EXCLUDE_FILES_PAT := $$(addprefix %,$$($1_EXCLUDE_FILES_PAT))
466 $1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES_PAT),$$($1_SRCS))
467 endif
468 ifneq ($$($1_INCLUDE_FILES), )
469 $1_INCLUDE_FILES_PAT := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_INCLUDE_FILES)))
470 $1_SRCS := $$(filter $$($1_INCLUDE_FILES_PAT),$$($1_SRCS))
471 endif
472 # There can be only a single bin dir root, no need to foreach over the roots.
473 $1_BINS := $$(wildcard $$($1_OBJECT_DIR)/*$(OBJ_SUFFIX))
474 # Now we have a list of all c/c++ files to compile: $$($1_SRCS)
475 # and we have a list of all existing object files: $$($1_BINS)
476
477 # Prepend the source/bin path to the filter expressions. Then do the filtering.
478 ifneq ($$($1_INCLUDES),)
479 $1_SRC_INCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_INCLUDES))))
480 $1_SRCS := $$(filter $$($1_SRC_INCLUDES),$$($1_SRCS))
481 endif
482 ifneq ($$($1_EXCLUDES),)
483 $1_SRC_EXCLUDES := $$(addsuffix /%,$$($1_EXCLUDES))
|