]> granicus.if.org Git - esp-idf/commitdiff
build system: Allow BUILD_DIR_BASE to be a relative directory (see github #38)
authorAngus Gratton <angus@espressif.com>
Thu, 6 Oct 2016 07:05:51 +0000 (18:05 +1100)
committerAngus Gratton <angus@espressif.com>
Thu, 6 Oct 2016 07:05:51 +0000 (18:05 +1100)
components/bootloader/Makefile.projbuild
components/esp32/component.mk
make/project.mk
make/project_config.mk
make/test_build_system.sh

index 559769957c1838ee6bc1a77cdda20a7628a976a6..02135e1c64c66e18aa867d3b603fc7c7ef6f2707 100644 (file)
@@ -11,7 +11,7 @@
 ifeq ("$(IS_BOOTLOADER_BUILD)","")
 
 BOOTLOADER_COMPONENT_PATH := $(COMPONENT_PATH)
-BOOTLOADER_BUILD_DIR=$(BUILD_DIR_BASE)/bootloader
+BOOTLOADER_BUILD_DIR=$(abspath $(BUILD_DIR_BASE)/bootloader)
 BOOTLOADER_BIN=$(BOOTLOADER_BUILD_DIR)/bootloader.bin
 BOOTLOADER_SDKCONFIG=$(BOOTLOADER_BUILD_DIR)/sdkconfig
 
index 85040d77a0ea8e10d1277b732f6d30cde8c61b82..b3d95f1b19defe346527eb7779fde451d76f66c0 100644 (file)
@@ -6,7 +6,7 @@
 # lib(subdirectory_name).a in the build directory. This behaviour is entirely configurable,
 # please read the esp-idf build system document if you need to do this.
 #
--include $(BUILD_DIR_BASE)/include/config/auto.conf
+-include include/config/auto.conf
 
 COMPONENT_SRCDIRS := . hwcrypto
 
index 74943334a677557dcdd3b1227875c99dea4b122a..c4bf68db636f1bcbfc83d1f93fc56c9942c39fe6 100644 (file)
@@ -106,7 +106,7 @@ COMPONENT_INCLUDES := $(abspath $(foreach comp,$(COMPONENT_PATHS_BUILDABLE),$(ad
        $(call GetVariable,$(comp),COMPONENT_ADD_INCLUDEDIRS))))
 
 #Also add project include path, for sdk includes
-COMPONENT_INCLUDES += $(BUILD_DIR_BASE)/include/
+COMPONENT_INCLUDES += $(abspath $(BUILD_DIR_BASE)/include/)
 export COMPONENT_INCLUDES
 
 #COMPONENT_LDFLAGS has a list of all flags that are needed to link the components together. It's collected
index 40f51ff8ffd9d2e760706591b6cac689eb8f7c2c..00452dda4d97e7d87429f9c66ea7d6eaa07a584a 100644 (file)
@@ -18,7 +18,7 @@ $(KCONFIG_TOOL_DIR)/mconf $(KCONFIG_TOOL_DIR)/conf:
        $(MAKE) -C $(KCONFIG_TOOL_DIR)
 
 # use a wrapper environment for where we run Kconfig tools
-KCONFIG_TOOL_ENV=KCONFIG_AUTOHEADER=$(BUILD_DIR_BASE)/include/sdkconfig.h \
+KCONFIG_TOOL_ENV=KCONFIG_AUTOHEADER=$(abspath $(BUILD_DIR_BASE)/include/sdkconfig.h) \
        COMPONENT_KCONFIGS="$(COMPONENT_KCONFIGS)" KCONFIG_CONFIG=$(SDKCONFIG) \
        COMPONENT_KCONFIGS_PROJBUILD="$(COMPONENT_KCONFIGS_PROJBUILD)"
 
index 401c8376cbfaa4559127116dd8d4966dae586b37..b7004eece101f909e383f08fc484c6907cf8e58f 100755 (executable)
@@ -91,7 +91,7 @@ function run_tests()
                 failure "Files weren't cleaned: ${ALL_BUILD_FILES}"
        fi
 
-       print_status "Moving BUILD_DIR_BASE out of tree should still build OK"
+       print_status "Moving BUILD_DIR_BASE out of tree"
        rm -rf --preserve-root ${BUILD}/*
        OUTOFTREE_BUILD=${TESTDIR}/alt_build
        make BUILD_DIR_BASE=${OUTOFTREE_BUILD} || failure "Failed to build with BUILD_DIR_BASE overriden"
@@ -104,6 +104,14 @@ function run_tests()
                failure "Some files were incorrectly put into the default build directory: ${DEFAULT_BUILD_FILES}"
        fi
 
+       print_status "BUILD_DIR_BASE inside default build directory"
+       rm -rf --preserve-root ${BUILD}/*
+       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 "Can still clean build if all text files are CRLFs"
        make clean || failure "Unexpected failure to make clean"
        find . -exec unix2dos {} \; # CRLFify template dir