aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.main3
-rw-r--r--Makefile.rules11
2 files changed, 14 insertions, 0 deletions
diff --git a/Makefile.main b/Makefile.main
index 665baf4..cf41a22 100644
--- a/Makefile.main
+++ b/Makefile.main
@@ -87,6 +87,9 @@ ifneq ($(KERNEL),)
CPPFLAGS += -DBUILTIN_KERNEL="\"$(KERNEL)\""
endif
+CHECK = sparse
+CHECKFLAGS := $(CF)
+
.SECONDARY:
vpath %.c $(SRC)
diff --git a/Makefile.rules b/Makefile.rules
index 2aace78..d63cbf4 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -33,6 +33,15 @@ define cook_cflags
$(filter-out $(CFLAGS_SKIP_$(1)), $(CPPFLAGS) $(CFLAGS)) $(CFLAGS_$(1))
endef
+ifeq ($(C),1)
+ ifeq ($(VERBOSE),1)
+ cmd_check = $(CHECK) $(CHECKFLAGS) $(call cook_cflags,$@) $<
+ else
+ cmd_check = @$(CHECK) $(CHECKFLAGS) $(call cook_cflags,$@) $<
+ endif
+endif
+
+
%.o : %.S include/asm-offsets.h
$(call Q,AS, $(CC) $(call cook_aflags,$@) -c $< -o $@, $@)
@@ -40,10 +49,12 @@ endef
$(call Q,CC, $(CC) $(call cook_aflags,$@) -E -c $< -o $@, $@)
%.o : %.c
+ $(call cmd_check)
$(call Q,CC, $(CC) $(call cook_cflags,$@) -c $< -o $@, $@)
# Force the use of the C compiler, not C++ for the .C files in libpore
%.o : %.C
+ $(call cmd_check)
$(call Q,CC, $(CC) $(call cook_cflags,$@) -x c -c $< -o $@, $@)
%.s : %.c