[lkml]   [2020]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v7] Makefile: Add clang-tidy and static analyzer support to makefile
On Wed, Aug 12, 2020 at 10:24 AM 'Nathan Huckleberry' via Clang Built
Linux <> wrote:
> Sounds good. Do you think this patch is ready to land then?

I do not think so.

I pointed out the CC=clang check was not working.
I see false positive errors from GCC commands.

This patch does not use the benefit of Makefile.

Makefile is used to describe the dependency
between a target and its prerequisites,
and how to update the target.

Make compares the timestamps between the
targets and prerequisites, then determines
which targets need updating.

See your code.

$(PYTHON3) scripts/clang-tools/
$(PYTHON3) scripts/clang-tools/ clang-tidy
$(error clang-tidy requires CC=clang)

This always runs two commands sequentially.
It rebuilds compile_commands.json even if
nothing in the source tree has been changed.

If you do this, there is no strong reason to use Make,
and actually you can rewrite it in a shell script:

clang_tidy () {
if [ "$CONFIG_CC_IS_CLANG = "y" ]; then
$PYTHON3 scripts/clang-tools/
$PYTHON3 scripts/clang-tools/ clang-tidy
echo "clang-tidy requires CC=clang"
exit 1

I changed the rules to Makefile-ish style.

I will wait for comments for the new version.

Best Regards
Masahiro Yamada

 \ /
  Last update: 2020-08-12 19:49    [W:0.070 / U:3.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site