Merge branch 'feature/build_exclude_components' into 'master'

make: EXCLUDE_COMPONENTS

See merge request idf/esp-idf!2204
This commit is contained in:
Ivan Grokhotkov 2018-04-09 19:13:39 +08:00
commit d88f2582cf
2 changed files with 8 additions and 0 deletions

View file

@ -123,6 +123,7 @@ These variables all have default values that can be overridden for custom behavi
- ``COMPONENT_DIRS``: Directories to search for components. Defaults to `$(IDF_PATH)/components`, `$(PROJECT_PATH)/components`, ``$(PROJECT_PATH)/main`` and ``EXTRA_COMPONENT_DIRS``. Override this variable if you don't want to search for components in these places.
- ``EXTRA_COMPONENT_DIRS``: Optional list of additional directories to search for components.
- ``COMPONENTS``: A list of component names to build into the project. Defaults to all components found in the COMPONENT_DIRS directories.
- ``EXCLUDE_COMPONENTS``: Optional list of component names to exclude during the build process. Note that this decreases build time, but not binary size.
Any paths in these Makefile variables should be absolute paths. You can convert relative paths using ``$(PROJECT_PATH)/xxx``, ``$(IDF_PATH)/xxx``, or use the Make function ``$(abspath xxx)``.

View file

@ -150,6 +150,10 @@ COMPONENTS := $(dir $(foreach cd,$(COMPONENT_DIRS), \
))
COMPONENTS := $(sort $(foreach comp,$(COMPONENTS),$(lastword $(subst /, ,$(comp)))))
endif
# After a full manifest of component names is determined, subtract the ones explicitly omitted by the project Makefile.
ifdef EXCLUDE_COMPONENTS
COMPONENTS := $(filter-out $(EXCLUDE_COMPONENTS), $(COMPONENTS))
endif
export COMPONENTS
# Resolve all of COMPONENTS into absolute paths in COMPONENT_PATHS.
@ -512,6 +516,9 @@ list-components:
$(info COMPONENTS (list of component names))
$(info $(COMPONENTS))
$(info $(call dequote,$(SEPARATOR)))
$(info EXCLUDE_COMPONENTS (list of excluded names))
$(info $(if $(EXCLUDE_COMPONENTS),$(EXCLUDE_COMPONENTS),(none provided)))
$(info $(call dequote,$(SEPARATOR)))
$(info COMPONENT_PATHS (paths to all components):)
$(foreach cp,$(COMPONENT_PATHS),$(info $(cp)))