aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@home.transmeta.com>2003-05-07 08:12:58 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2003-05-07 08:12:58 -0700
commit8c2b313a0e3db75a83e976a119414fa29c560eaa (patch)
tree3b19736171a73b696f4170dea3c8c1d4d1030dac /scripts
parentc270c6447ba900499a571291248cfa23af424a9c (diff)
downloadhistory-8c2b313a0e3db75a83e976a119414fa29c560eaa.tar.gz
Support a "checking" mode for kernel builds, that runs a
user-supplied source checker on all C files before compiling them. I'll release the actual checker once I've cleaned it up a bit more (yay, all the copyright paperwork completed!)
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.build21
1 files changed, 19 insertions, 2 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 4f3f9e3346a9b..21d1a162b5199 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -66,6 +66,12 @@ __build: $(if $(KBUILD_BUILTIN),$(O_TARGET) $(L_TARGET) $(extra-y)) \
$(subdir-ym) $(always)
@:
+# Linus's kernel sanity checking tool
+ifneq ($(KBUILD_CHECKSRC),0)
+quiet_cmd_checksrc = CHECK $<
+ cmd_checksrc = $(CHECK) $(CFLAGS) $< ;
+endif
+
# Module versioning
# ---------------------------------------------------------------------------
@@ -91,6 +97,8 @@ quiet_cmd_vcc_o_c = CC $(quiet_modtag) $@
cmd_vcc_o_c = $(CC) $(c_flags) -c -o $(@D)/.tmp_$(@F) $<
define rule_vcc_o_c
+ $(if $($(quiet)cmd_checksrc),echo ' $($(quiet)cmd_checksrc)';) \
+ $(cmd_checksrc) \
$(if $($(quiet)cmd_vcc_o_c),echo ' $($(quiet)cmd_vcc_o_c)';) \
$(cmd_vcc_o_c); \
\
@@ -158,6 +166,15 @@ cmd_cc_i_c = $(CPP) $(c_flags) -o $@ $<
quiet_cmd_cc_o_c = CC $(quiet_modtag) $@
cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
+define rule_cc_o_c
+ $(if $($(quiet)cmd_checksrc),echo ' $($(quiet)cmd_checksrc)';) \
+ $(cmd_checksrc) \
+ $(if $($(quiet)cmd_cc_o_c),echo ' $($(quiet)cmd_cc_o_c)';) \
+ $(cmd_cc_o_c); \
+ scripts/fixdep $(depfile) $@ '$(cmd_cc_o_c)' > $(@D)/.$(@F).tmp; \
+ rm -f $(depfile); \
+ mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd
+endef
# Built-in and composite module parts
@@ -165,7 +182,7 @@ cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
ifdef CONFIG_MODVERSIONS
$(call if_changed_rule,vcc_o_c)
else
- $(call if_changed_dep,cc_o_c)
+ $(call if_changed_rule,cc_o_c)
endif
# Single-part modules are special since we need to mark them in $(MODVERDIR)
@@ -174,7 +191,7 @@ $(single-used-m): %.o: %.c FORCE
ifdef CONFIG_MODVERSIONS
$(call if_changed_rule,vcc_o_c)
else
- $(call if_changed_dep,cc_o_c)
+ $(call if_changed_rule,cc_o_c)
endif
$(touch-module)