BOOTLOADER_SDKCONFIG=$(BOOTLOADER_BUILD_DIR)/sdkconfig
# Custom recursive make for bootloader sub-project
-BOOTLOADER_MAKE=$(MAKE) -C $(BOOTLOADER_COMPONENT_PATH)/src \
- MAKEFLAGS= V=$(V) SDKCONFIG=$(BOOTLOADER_SDKCONFIG) \
+BOOTLOADER_MAKE=+$(MAKE) -C $(BOOTLOADER_COMPONENT_PATH)/src \
+ V=$(V) SDKCONFIG=$(BOOTLOADER_SDKCONFIG) \
BUILD_DIR_BASE=$(BOOTLOADER_BUILD_DIR) \
.PHONY: bootloader-clean bootloader-flash bootloader $(BOOTLOADER_BIN)
@echo "'make partition_table', etc, etc."
# disable built-in make rules, makes debugging saner
+MAKEFLAGS_OLD := $(MAKEFLAGS)
MAKEFLAGS +=-rR
# Figure out PROJECT_PATH if not set
# $(2) - target to generate (build, clean)
.PHONY: $(notdir $(1))-$(2)
$(notdir $(1))-$(2): | $(BUILD_DIR_BASE)/$(notdir $(1))
- @+$(MAKE) -C $(BUILD_DIR_BASE)/$(notdir $(1)) -f $(1)/component.mk COMPONENT_BUILD_DIR=$(BUILD_DIR_BASE)/$(notdir $(1)) $(2)
+ $(Q) +$(MAKE) -C $(BUILD_DIR_BASE)/$(notdir $(1)) -f $(1)/component.mk COMPONENT_BUILD_DIR=$(BUILD_DIR_BASE)/$(notdir $(1)) $(2)
endef
define GenerateComponentTargets
# unless it's overriden (happens for bootloader)
SDKCONFIG ?= $(PROJECT_PATH)/sdkconfig
-# clear MAKEFLAGS as the menuconfig makefile uses implicit compile rules
+# reset MAKEFLAGS as the menuconfig makefile uses implicit compile rules
$(KCONFIG_TOOL_DIR)/mconf $(KCONFIG_TOOL_DIR)/conf:
- MAKEFLAGS="" \
- CC=$(HOSTCC) LD=$(HOSTLD) \
+ MAKEFLAGS=$(ORIGINAL_MAKEFLAGS) CC=$(HOSTCC) LD=$(HOSTLD) \
$(MAKE) -C $(KCONFIG_TOOL_DIR)
# use a wrapper environment for where we run Kconfig tools
fi
print_status "Moving BUILD_DIR_BASE out of tree"
- rm -rf --preserve-root ${BUILD}/*
+ clean_build_dir
OUTOFTREE_BUILD=${TESTDIR}/alt_build
make BUILD_DIR_BASE=${OUTOFTREE_BUILD} || failure "Failed to build with BUILD_DIR_BASE overriden"
NEW_BUILD_FILES=$(find ${OUTOFREE_BUILD} -type f)
fi
print_status "BUILD_DIR_BASE inside default build directory"
- rm -rf --preserve-root ${BUILD}/*
+ clean_build_dir
make BUILD_DIR_BASE=build/subdirectory || failure "Failed to build with BUILD_DIR_BASE as subdir"
NEW_BUILD_FILES=$(find ${BUILD}/subdirectory -type f)
if [ -z "${NEW_BUILD_FILES}" ]; then
failure "No files found in new build directory!"
fi
+ print_status "Parallel builds should work OK"
+ clean_build_dir
+ (make -j5 2>&1 | tee ${TESTDIR}/parallel_build.log) || failure "Failed to build in parallel"
+ if grep -q "warning: jobserver unavailable" ${TESTDIR}/parallel_build.log; then
+ failure "Parallel build prints 'warning: jobserver unavailable' errors"
+ fi
+
print_status "Can still clean build if all text files are CRLFs"
make clean || failure "Unexpected failure to make clean"
find . -exec unix2dos {} \; # CRLFify template dir
done
}
+# do a "clean" that doesn't depend on 'make clean'
+function clean_build_dir()
+{
+ rm -rf --preserve-root ${BUILD}/*
+}
+
cd ${TESTDIR}
run_tests