diff --git a/Makefile b/Makefile index 0f5e77cc83abcf..bdf22fe2af31c4 100644 --- a/Makefile +++ b/Makefile @@ -241,8 +241,10 @@ coverage-clean: $(RM) -r node_modules $(RM) -r gcovr $(RM) -r coverage/tmp - $(FIND) out/$(BUILDTYPE)/obj.target \( -name "*.gcda" -o -name "*.gcno" \) \ - -type f -exec $(RM) {} \; + @if [ -d "out/Release/obj.target" ]; then \ + $(FIND) out/$(BUILDTYPE)/obj.target \( -name "*.gcda" -o -name "*.gcno" \) \ + -type f -exec $(RM) {};\ + fi .PHONY: coverage # Build and test with code coverage reporting. HTML coverage reports will be