X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=config.mk;h=b7cd4814fe74e87633dc15d9c1c8f388c5b8da78;hb=5846b11e8810f0ecc15e78b383b7709b9b785580;hp=51b47838cf53dd85fd928945efa36e2b92d9b975;hpb=c1f5805a9dd5ea50b108e1d39a16edf710ea17e6;p=u-boot diff --git a/config.mk b/config.mk index 51b47838cf..b7cd4814fe 100644 --- a/config.mk +++ b/config.mk @@ -23,6 +23,8 @@ ######################################################################### +include $(TOPDIR)/helper.mk + ifeq ($(CURDIR),$(SRCTREE)) dir := else @@ -149,6 +151,7 @@ OBJCOPY = $(CROSS_COMPILE)objcopy OBJDUMP = $(CROSS_COMPILE)objdump RANLIB = $(CROSS_COMPILE)RANLIB DTC = dtc +CHECK = sparse ######################################################################### @@ -275,6 +278,10 @@ ifneq ($(CONFIG_SPL_TEXT_BASE),) LDFLAGS_u-boot-spl += -Ttext $(CONFIG_SPL_TEXT_BASE) endif +# Linus' kernel sanity checking tool +CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \ + -Wbitwise -Wno-return-void -D__CHECK_ENDIAN__ $(CF) + # Location of a usable BFD library, where we define "usable" as # "built for ${HOST}, supports ${TARGET}". Sensible values are # - When cross-compiling: the root of the cross-environment @@ -322,6 +329,9 @@ $(obj)%.s: %.S $(obj)%.o: %.S $(CC) $(ALL_AFLAGS) -o $@ $< -c $(obj)%.o: %.c +ifneq ($(CHECKSRC),0) + $(CHECK) $(CHECKFLAGS) $(ALL_CFLAGS) $< +endif $(CC) $(ALL_CFLAGS) -o $@ $< -c $(obj)%.i: %.c $(CPP) $(ALL_CFLAGS) -o $@ $< -c