Lines Matching +full:- +full:- +full:non +full:- +full:interactive
9 # This makefile requires the environment variable IDF_PATH to be set to the top-level esp-idf direc…
13 …PHONY: build-components menuconfig defconfig all build clean all_binaries check-submodules size si…
21 # target can build everything without triggering the per-component "to
27 @echo "make menuconfig - Configure IDF project"
28 @echo "make defconfig - Set defaults for all new configuration options"
30 @echo "make all - Build app, bootloader, partition table"
31 @echo "make flash - Flash app, bootloader, partition table to a chip"
32 @echo "make clean - Remove all build output"
33 @echo "make size - Display the static memory footprint of the app"
34 @echo "make size-components, size-files - Finer-grained memory footprints"
35 @echo "make size-symbols - Per symbol memory footprint. Requires COMPONENT=<component>"
36 @echo "make erase_flash - Erase entire flash contents"
37 …@echo "make erase_otadata - Erase ota_data partition; First bootable partition (factory or OTAx) w…
39 @echo "make monitor - Run idf_monitor tool to monitor serial output from app"
40 @echo "make simple_monitor - Monitor serial output on terminal console"
41 @echo "make list-components - List all components in the project"
43 @echo "make app - Build just the app"
44 @echo "make app-flash - Flash just the app"
45 @echo "make app-clean - Clean just the app"
46 @echo "make print_flash_cmd - Print the arguments for esptool when flash"
47 @echo "make check_python_dependencies - Check that the required python packages are installed"
49 @echo "See also 'make bootloader', 'make bootloader-flash', 'make bootloader-clean', "
52 # Non-interactive targets. Mostly, those for which you do not need to build a binary
53 NON_INTERACTIVE_TARGET += defconfig clean% %clean help list-components print_flash_cmd check_python…
58 $(warning esp-idf build system only supports GNU Make versions 3.81 or newer. You may see unexpecte…
63 $(warning esp-idf build system only supports MSYS2 in "MINGW32" mode. Consult the ESP-IDF documenta…
69 # can't run 'clean' along with any non-clean targets
71 ifneq ("$(filter-out clean% %clean,$(MAKECMDGOALS))", "")
72 $(error esp-idf build system doesn't support running 'clean' targets along with any others. Run 'ma…
80 # * changes Windows-style C:/blah/ paths to MSYS style /c/blah
83 # where /xyz is a directory inside the MSYS root - so we don't use it.
114 $(error IDF_PATH cannot contain colons. If overriding IDF_PATH on Windows, use MSYS Unix-style /c/d…
117 # disable built-in make rules, makes debugging saner
119 MAKEFLAGS +=-rR
139 …BASE)) cannot contain colons. If setting this path on Windows, use MSYS Unix-style /c/dir instead …
168 MULTI_COMPONENT_DIRS := $(filter-out $(SINGLE_COMPONENT_DIRS),$(COMPONENT_DIRS))
175 # Use the "make list-components" target to debug this step.
178 # directories they're in, so /bla/components/mycomponent/component.mk -> mycomponent.
189 COMPONENTS := $(filter-out $(subst ",,$(EXCLUDE_COMPONENTS)), $(COMPONENTS))
196 # - either this is directory with multiple components, in which case check that
198 # - or, this is a directory of a single component, in which case the name of this
221 TEST_COMPONENTS_LIST := $(filter-out $(TEST_EXCLUDE_COMPONENTS), $(COMPONENTS))
257 # (bootloader build doesn't need this, config is exported from top-level)
289 # Initialise project-wide variables which can be added to by
295 # See docs/build-system.rst for more details.
306 # COMPONENT_LDFLAGS variables and also targets for any inter-component
312 # this line is -include instead of include to prevent a spurious error message on make 3.81
313 -include $(COMPONENT_PROJECT_VARS)
315 # Also add top-level project include path, for top-level includes
326 @echo "espsecure.py sign_data --version 1 --keyfile KEYFILE $(APP_BIN)"
327 @echo "espsecure.py sign_data --version 1 --keyfile KEYFILE $(PARTITION_TABLE_BIN)"
330 @echo "espsecure.py sign_data --version 2 --keyfile KEYFILE $(APP_BIN)"
348 IDF_VER_T := $(shell cd ${IDF_PATH} && git describe --always --dirty --match v*.*)
352 IDF_VER := $(shell echo "$(IDF_VER_T)" | cut -c 1-31)
356 LDFLAGS ?= -nostdlib \
358 -Wl,--gc-sections \
359 -Wl,-static \
360 -Wl,--start-group \
362 -lgcc \
363 -lstdc++ \
364 -lgcov \
365 -Wl,--end-group \
366 -Wl,-EL
380 CPPFLAGS := -DESP_PLATFORM -D IDF_VER=\"$(IDF_VER)\" -MMD -MP $(CPPFLAGS) $(EXTRA_CPPFLAGS)
386 # Warnings-related flags relevant both for C and C++
387 COMMON_WARNING_FLAGS = -Wall -Werror=all \
388 -Wno-error=unused-function \
389 -Wno-error=unused-but-set-variable \
390 -Wno-error=unused-variable \
391 -Wno-error=deprecated-declarations \
392 -Wextra \
393 -Wno-unused-parameter -Wno-sign-compare
396 COMMON_WARNING_FLAGS += -Wno-parentheses \
397 -Wno-sizeof-pointer-memaccess \
398 -Wno-clobbered \
399 -Wno-format-overflow \
400 -Wno-stringop-truncation \
401 -Wno-misleading-indentation \
402 -Wno-cast-function-type \
403 -Wno-implicit-fallthrough \
404 -Wno-unused-const-variable \
405 -Wno-switch-unreachable \
406 -Wno-format-truncation \
407 -Wno-memset-elt-size \
408 -Wno-int-in-bool-context
412 COMMON_WARNING_FLAGS += -Wwrite-strings
417 -Wno-frame-address \
418 -ffunction-sections -fdata-sections \
419 -fstrict-volatile-bitfields \
420 -mlongcalls \
421 -nostdlib
426 COMMON_FLAGS += -fstack-protector
429 COMMON_FLAGS += -fstack-protector-strong
432 COMMON_FLAGS += -fstack-protector-all
437 COMMON_FLAGS += -fno-jump-tables
438 COMMON_FLAGS += -fno-tree-switch-conversion
442 OPTIMIZATION_FLAGS = -Os -freorder-blocks
446 OPTIMIZATION_FLAGS = -Og
450 OPTIMIZATION_FLAGS = -O0
454 OPTIMIZATION_FLAGS = -O2
458 CPPFLAGS += -DNDEBUG
464 OPTIMIZATION_FLAGS = -Os -freorder-blocks
468 OPTIMIZATION_FLAGS = -Og
472 OPTIMIZATION_FLAGS = -O0
476 OPTIMIZATION_FLAGS = -O2
483 CPPFLAGS += -D_GNU_SOURCE
487 DEBUG_FLAGS ?= -ggdb
494 -std=gnu99 \
497 $(COMMON_WARNING_FLAGS) -Wno-old-style-declaration \
506 -std=gnu++11 \
514 CXXFLAGS += -fexceptions
516 CXXFLAGS += -fno-exceptions
520 CXXFLAGS += -frtti
522 CXXFLAGS += -fno-rtti
523 LDFLAGS += -fno-rtti
541 COMPILER_VERSION_STR := $(shell $(CC) -dumpversion)
575 $(CC) $(LDFLAGS) -o $@ -Wl,-Map=$(APP_MAP)
587 @echo "espsecure.py sign_data --version $(SECURE_APPS_SIGNING_SCHEME) --keyfile KEYFILE $(APP_BIN)"
601 mkdir -p $(BUILD_DIR_BASE)
603 # Macro for the recursive sub-make for each component
604 # $(1) - component directory
605 # $(2) - component name only
609 +$(MAKE) -C $(BUILD_DIR_BASE)/$(2) -f $(IDF_PATH)/make/component_wrapper.mk COMPONENT_MAKEFILE=$(1)…
612 # Generate top-level component-specific targets for each component
613 # $(1) - path to component dir
614 # $(2) - name of component
617 .PHONY: component-$(2)-build component-$(2)-clean
622 component-$(2)-build: check-submodules $(call prereq_if_explicit, component-$(2)-clean) | $(BUILD_D…
625 component-$(2)-clean: | $(BUILD_DIR_BASE)/$(2) $(BUILD_DIR_BASE)/$(2)/component_project_vars.mk
629 @mkdir -p $(BUILD_DIR_BASE)/$(2)
631 # tell make it can build any component's library by invoking the -build target
635 $(BUILD_DIR_BASE)/$(2)/lib$(2).a: component-$(2)-build
652 app-clean: $(addprefix component-,$(addsuffix -clean,$(notdir $(COMPONENT_PATHS))))
654 rm -f $(APP_ELF) $(APP_BIN) $(APP_MAP)
659 size-files: $(APP_ELF) | check_python_dependencies
660 $(PYTHON) $(IDF_PATH)/tools/idf_size.py --files $(APP_MAP)
662 size-components: $(APP_ELF) | check_python_dependencies
663 $(PYTHON) $(IDF_PATH)/tools/idf_size.py --archives $(APP_MAP)
665 size-symbols: $(APP_ELF) | check_python_dependencies
669 $(PYTHON) $(IDF_PATH)/tools/idf_size.py --archive_details lib$(COMPONENT).a $(APP_MAP)
672 # NB: this ordering is deliberate (app-clean & bootloader-clean before
673 # _config-clean), so config remains valid during all component clean
675 config-clean: app-clean bootloader-clean
676 clean: app-clean bootloader-clean config-clean ldgen-clean
688 check-submodules:
696 GIT_STATUS := $(shell cd ${IDF_PATH} && git status --porcelain --ignore-submodules=dirty)
699 # $(1) - submodule directory, relative to IDF_PATH
701 check-submodules: $(IDF_PATH)/$(1)/.git
704 [ -e ${IDF_PATH}/.git ] || { echo "ERROR: esp-idf must be cloned from git to work."; exit 1; }
705 …[ -x "$(shell which git)" ] || { echo "ERROR: Need to run 'git submodule init $(1)' in esp-idf roo…
706 @echo "Attempting 'git submodule update --init $(1)' in esp-idf root directory..."
707 cd ${IDF_PATH} && git submodule update --init $(1)
711 $$(info WARNING: esp-idf git submodule $(1) may be out of date. Run 'git submodule update' in IDF_P…
722 list-components:
738 echo $(ESPTOOL_WRITE_FLASH_OPTIONS) $(ESPTOOL_ALL_FLASH_ARGS) | sed -e 's:'$(PWD)/build/'::g'
740 # Check toolchain version using the output of xtensa-esp32-elf-gcc --version command.
742 # xtensa-esp32-elf-gcc (crosstool-NG crosstool-ng-1.22.0-80-g6c4433a) 5.2.0
747 TOOLCHAIN_HEADER := $(shell $(CC) --version | head -1)
749 TOOLCHAIN_COMMIT_DESC := $(shell $(CC) --version | sed -E -n 's|.*\(crosstool-NG (.*)\).*|\1|gp')
763 $(info Please check ESP-IDF setup instructions and update the toolchain, or proceed at your own ris…
772 $(info Please check ESP-IDF setup instructions and update the toolchain, or proceed at your own ris…