Re: kbuild + kconfig: Updates

Sam Ravnborg
2004-08-16T20:29:36Z

On Tue, Aug 17, 2004 at 12:20:05AM +0200, Sam Ravnborg wrote:
> >
> > Uhh... It ends up running sparse *twice* and still runs gcc on every
> > file.

This one should be better.

On the sparse topic. Do you see anything against
introducing CHECKFLAGS?
CHECKFLAGS would be assigned the sparse specific flags in
arch/*/Makefile.

I see no reason to introduce EXTRA_CHECKFLAGS, CHECKFLAGS_$(F*)
as known from CFLAGS, AFLAGS. But I like the split into CHECKFLAGS.
That should allow me to do:
make CHECK=my_hacked_sparse C=2

Sam

===== scripts/Makefile.build 1.47 vs edited =====
--- 1.47/scripts/Makefile.build 2004-08-15 21:54:06 +02:00
+++ edited/scripts/Makefile.build 2004-08-17 00:23:52 +02:00
@@ -83,8 +83,13 @@

# Linus' kernel sanity checking tool
ifneq ($(KBUILD_CHECKSRC),0)
-quiet_cmd_checksrc = CHECK $<
- cmd_checksrc = $(CHECK) $(c_flags) $< ;
+ ifeq ($(KBUILD_CHECKSRC),2)
+ quiet_cmd_force_checksrc = CHECK $<
+ cmd_force_checksrc = $(CHECK) $(c_flags) $< ;
+ else
+ quiet_cmd_checksrc = CHECK $<
+ cmd_checksrc = $(CHECK) $(c_flags) $< ;
+ endif
endif

@@ -182,11 +187,13 @@
# Built-in and composite module parts

%.o: %.c FORCE
+ $(call cmd,force_checksrc)
$(call if_changed_rule,cc_o_c)

# Single-part modules are special since we need to mark them in $(MODVERDIR)

$(single-used-m): %.o: %.c FORCE
+ $(call cmd,force_checksrc)
$(call if_changed_rule,cc_o_c)
@{ echo $(@:.o=.ko); echo $@; } > $(MODVERDIR)/$(@F:.o=.mod)