# IDF environment
IDF_PATH: "$CI_PROJECT_DIR"
+ BATCH_BUILD: "1"
+ V: "0"
APPLY_BOT_FILTER_SCRIPT: "$CI_PROJECT_DIR/tools/ci/apply_bot_filter.py"
CHECKOUT_REF_SCRIPT: "$CI_PROJECT_DIR/tools/ci/checkout_project_ref.py"
@echo "See also 'make bootloader', 'make bootloader-flash', 'make bootloader-clean', "
@echo "'make partition_table', etc, etc."
+# Non-interactive targets. Mostly, those for which you do not need to build a binary
+NON_INTERACTIVE_TARGET += defconfig clean% %clean help list-components print_flash_cmd
+
# dependency checks
ifndef MAKE_RESTARTS
ifeq ("$(filter 4.% 3.81 3.82,$(MAKE_VERSION))","")
# overrides (usually used for esp-idf examples)
SDKCONFIG_DEFAULTS ?= $(PROJECT_PATH)/sdkconfig.defaults
+# Workaround to run make parallel (-j). mconf and conf cannot be made simultaneously
+$(KCONFIG_TOOL_DIR)/mconf: $(KCONFIG_TOOL_DIR)/conf
+
# reset MAKEFLAGS as the menuconfig makefile uses implicit compile rules
$(KCONFIG_TOOL_DIR)/mconf $(KCONFIG_TOOL_DIR)/conf: $(wildcard $(KCONFIG_TOOL_DIR)/*.c)
MAKEFLAGS="" CC=$(HOSTCC) LD=$(HOSTLD) \
$(MAKE) -C $(KCONFIG_TOOL_DIR)
ifeq ("$(wildcard $(SDKCONFIG))","")
-ifeq ("$(filter defconfig clean% %clean, $(MAKECMDGOALS))","")
-# if no configuration file is present and defconfig or clean
-# is not a named target, run defconfig then menuconfig to get the initial config
+# if no configuration file is present we need a rule for it
+ifeq ("$(filter $(NON_INTERACTIVE_TARGET), $(MAKECMDGOALS))","")
+# if special non-interactive item is not a named target (eg. 'defconfig', 'clean')
+# run defconfig then menuconfig to get the initial config
$(SDKCONFIG): menuconfig
menuconfig: defconfig
else
# -----------------------------------------------------------------------------
# Safety settings (see https://gist.github.com/ilg-ul/383869cbb01f61a51c4d).
-if [[ ! -z ${DEBUG} ]]
+if [[ ! -z ${DEBUG_SHELL} ]]
then
set -x # Activate the expand mode if DEBUG is anything but empty.
fi
# Sets the error behaviour options for shell throughout the CI environment
#
set -o errexit # Exit if command failed.
+set -o pipefail # Exit if pipe failed.
+
+# we can use the appropriate secret variable for debugging
+[ ! -z $DEBUG_SHELL ] && set -x
[ -z $CI_COMMIT_REF_NAME ] && echo "This internal script should only be run by a Gitlab CI runner." && exit 1
# -----------------------------------------------------------------------------
# Common bash
-if [[ ! -z ${DEBUG} ]]; then
+if [[ ! -z ${DEBUG_SHELL} ]]; then
set -x # Activate the expand mode if DEBUG is anything but empty.
fi
# -----------------------------------------------------------------------------
# Common bash
-if [[ ! -z ${DEBUG} ]]
+if [[ ! -z ${DEBUG_SHELL} ]]
then
set -x # Activate the expand mode if DEBUG is anything but empty.
fi
# -----------------------------------------------------------------------------
# Common bash
-if [[ ! -z ${DEBUG} ]]
+if [[ ! -z ${DEBUG_SHELL} ]]
then
set -x # Activate the expand mode if DEBUG is anything but empty.
fi
PROJECT_NAME := unit-test-app
+NON_INTERACTIVE_TARGET += ut-apply-config-% ut-clean-%
+
include $(IDF_PATH)/make/project.mk
# List of unit-test-app configurations.