1 postPhases
+=" cleanupBuildDir"
3 # Force GCC to build with coverage instrumentation. Also disable
4 # optimisation, since it may confuse things.
5 export NIX_CFLAGS_COMPILE
="${NIX_CFLAGS_COMPILE:-} -O0 --coverage"
7 # Get rid of everything that isn't a gcno file or a C source file.
8 # Also strip the `.tmp_' prefix from gcno files. (The Linux kernel
11 if ! [ -e $out/.build
]; then return; fi
13 find $out/.build
/ -type f
-a ! \
14 \
( -name "*.c" -o -name "*.cc" -o -name "*.cpp" -o -name "*.h" -o -name "*.hh" -o -name "*.y" -o -name "*.l" -o -name "*.gcno" \
) \
17 for i
in $
(find $out/.build
/ -name ".tmp_*.gcno"); do
18 mv "$i" "$(echo $i | sed s/.tmp_//)"