Skip to contentSkip to conversation

Display CHECK files like CC files

PATCH In review Matthew Wilcox 2 participants 2 messages Jan 2, 2019 – Jan 5, 2019 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Display CHECK files like CC files

When building with O= and C=1, this output looks weird:

  CC      fs/file_table.o
  CHECK   ../fs/file_table.c
  CC      fs/open.o
  CHECK   ../fs/open.c
  CC      fs/super.o
  CHECK   ../fs/super.c
  CC      fs/read_write.o
  CHECK   ../fs/read_write.c

Use $@ like CC instead of $< to produce the same output for both CHECK and CC.

scripts/Makefile.build +2 -2
index fd03d60f6c5a..f36b03396d9a 100644
@@ -74,10 +74,10 @@ __build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(extra-y)) \
 
 # Linus' kernel sanity checking tool
 ifeq ($(KBUILD_CHECKSRC),1)
-  quiet_cmd_checksrc       = CHECK   $<
+  quiet_cmd_checksrc       = CHECK   $@
         cmd_checksrc       = $(CHECK) $(CHECKFLAGS) $(c_flags) $<
 else ifeq ($(KBUILD_CHECKSRC),2)
-  quiet_cmd_force_checksrc = CHECK   $<
+  quiet_cmd_force_checksrc = CHECK   $@
         cmd_force_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $<
 endif
 
#1 lore raw

Hi Matthew,

Quoted 22 lines · Matthew Wilcox

When building with O= and C=1, this output looks weird:

  CC      fs/file_table.o
  CHECK   ../fs/file_table.c
  CC      fs/open.o
  CHECK   ../fs/open.c
  CC      fs/super.o
  CHECK   ../fs/super.c
  CC      fs/read_write.o
  CHECK   ../fs/read_write.c

Use $@ like CC instead of $< to produce the same output for both CHECK and CC.

scripts/Makefile.build +0 -0
index fd03d60f6c5a..f36b03396d9a 100644
@@ -74,10 +74,10 @@ __build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(extra-y)) \
 

scripts/Makefile.build __build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(extra-y)) \ · line 82

Quoted 10 lines
scripts/Makefile.build +2 -2
 # Linus' kernel sanity checking tool
 ifeq ($(KBUILD_CHECKSRC),1)
-  quiet_cmd_checksrc       = CHECK   $<
+  quiet_cmd_checksrc       = CHECK   $@
         cmd_checksrc       = $(CHECK) $(CHECKFLAGS) $(c_flags) $<
 else ifeq ($(KBUILD_CHECKSRC),2)
-  quiet_cmd_force_checksrc = CHECK   $<
+  quiet_cmd_force_checksrc = CHECK   $@
         cmd_force_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $<
 endif

IMHO, $@ is also a bit weird
since Sparse does not produce objects at all.

What I can suggest is like follows:

quiet_cmd_checksrc = CHECK $(patsubst $(srctree)/%,%,$<)

Signature · 2 lines
Best Regards
Masahiro Yamada