diff --git a/spec/cspec/c/kernel.mk b/spec/cspec/c/kernel.mk index f429cf5fdf..a1f8e9e3f9 100644 --- a/spec/cspec/c/kernel.mk +++ b/spec/cspec/c/kernel.mk @@ -66,7 +66,11 @@ ifndef ISABELLE_PROCESS export ISABELLE_PROCESS:=${ISABELLE_HOME}/bin/isabelle-process endif -KERNEL_DEPS := $(shell find ${SOURCE_ROOT} -type f) +# __pycache__ directories are the only in-tree products of the kernel build. +# But since they are generated after the cmake setup, they would cause unnecessary +# kernel rebuilds if we treated them as dependencies of the kernel build. +# We avoid this by excluding __pycache__ directories from the kernel dependencies. +KERNEL_DEPS := $(shell find ${SOURCE_ROOT} -name __pycache__ -prune -o -type f -print) # Top level rule for rebuilding kernel_all.c_pp ${KERNEL_BUILD_ROOT}/kernel_all.c_pp: ${KERNEL_BUILD_ROOT}/.cmake_done