]> granicus.if.org Git - esp-idf/commitdiff
make: EXCLUDE_COMPONENTS
authorndotb <neilebailey@gmail.com>
Sun, 8 Apr 2018 17:07:43 +0000 (13:07 -0400)
committerndotb <neilebailey@gmail.com>
Sun, 8 Apr 2018 17:07:43 +0000 (13:07 -0400)
Add project build variable, documentation for EXCLUDE_COMPONENTS

docs/en/api-guides/build-system.rst
make/project.mk

index 31debb431c894750857dd864cd333c572a11ed8f..ca967f071b8ead54ada99f6e36398c4082973782 100644 (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)``.
 
index a5bc916bf80f81aed68b198ec5718fd56b9ee628..8640319cfe36968daddb74f19adf8b7cb78e328c 100644 (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)))