about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
-rw-r--r--runtime/Makefile.cmake.bitcode.rules9
1 files changed, 8 insertions, 1 deletions
diff --git a/runtime/Makefile.cmake.bitcode.rules b/runtime/Makefile.cmake.bitcode.rules
index 8261ce99..2737eb80 100644
--- a/runtime/Makefile.cmake.bitcode.rules
+++ b/runtime/Makefile.cmake.bitcode.rules
@@ -70,8 +70,15 @@ else
 all:: build_at_level
 
 # Compute the directory to find sources
-DIR_SUFFIX := $(subst $(RUNTIME_CMAKE_BINARY_DIR),,$(CURRENT_DIR))
+# Note: Use of $(realpath) is to resolve any symlinks
+DIR_SUFFIX := $(subst $(realpath $(RUNTIME_CMAKE_BINARY_DIR)),,$(realpath $(CURRENT_DIR)))
 SRC_DIR := $(abspath $(ROOT_SRC)/$(DIR_SUFFIX))
+# Sanity check
+ifeq ($(realpath $(SRC_DIR)),)
+$(error SRC_DIR "$(SRC_DIR)" does not exist)
+endif
+
+# Compute the directory to put build files
 LOCAL_BUILD_DIR := $(abspath $(ROOT_OBJ)/$(DIR_SUFFIX))
 
 C_SRCS := $(shell echo $(SRC_DIR)/*.c)