about summary refs log tree commit diff homepage
path: root/runtime
diff options
context:
space:
mode:
authorDan Liew <daniel.liew@imperial.ac.uk>2017-07-24 10:12:13 +0100
committerDan Liew <daniel.liew@imperial.ac.uk>2017-07-24 10:13:31 +0100
commita9a310e40cd8f6505464dd595dd28f2987cdbf5c (patch)
treefd3b8e1419a070f85f9e5aa5f5a87941473d2168 /runtime
parentc0d1bfe5386d73f9998e439a0e28e5ec6a4083e1 (diff)
downloadklee-a9a310e40cd8f6505464dd595dd28f2987cdbf5c.tar.gz
[CMake] Add a sanity check to the runtime build system so that we
provide a better error message (and stop earlier) when no C source
files are found.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/Makefile.cmake.bitcode.rules6
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/Makefile.cmake.bitcode.rules b/runtime/Makefile.cmake.bitcode.rules
index 472c979b..6ad23aed 100644
--- a/runtime/Makefile.cmake.bitcode.rules
+++ b/runtime/Makefile.cmake.bitcode.rules
@@ -82,6 +82,12 @@ endif
 LOCAL_BUILD_DIR := $(abspath $(ROOT_OBJ)/$(DIR_SUFFIX))
 
 C_SRCS := $(sort $(shell echo $(SRC_DIR)/*.c))
+
+# Sanity check: Make sure at least one source file was found
+ifneq ($(strip $(filter %*.c,$(C_SRCS))),)
+$(error Failed to find C source files in $(SRC_DIR))
+endif
+
 C_SRCS_NO_DIR := $(notdir $(C_SRCS))
 BC_FILES_NO_DIR := $(C_SRCS_NO_DIR:.c=.bc)
 BC_FILES := $(addprefix $(LOCAL_BUILD_DIR)/,$(BC_FILES_NO_DIR))