X-Git-Url: https://git.kernelconcepts.de/?a=blobdiff_plain;f=config.mk;h=b7cd4814fe74e87633dc15d9c1c8f388c5b8da78;hb=8965112bbf393d7b63703c07c28cc43a3fa58f8f;hp=c3822a25c255100f6730549820fe32dadce8dba7;hpb=6e2fbdea1b26d75314d87c380a36b0015bf824cf;p=karo-tx-uboot.git diff --git a/config.mk b/config.mk index c3822a25c2..b7cd4814fe 100644 --- a/config.mk +++ b/config.mk @@ -23,6 +23,8 @@ ######################################################################### +include $(TOPDIR)/helper.mk + ifeq ($(CURDIR),$(SRCTREE)) dir := else @@ -128,6 +130,7 @@ endif # cc-version # Usage gcc-ver := $(call cc-version) cc-version = $(shell $(SHELL) $(SRCTREE)/tools/gcc-version.sh $(CC)) +binutils-version = $(shell $(SHELL) $(SRCTREE)/tools/binutils-version.sh $(AS)) # # Include the make variables (CC, etc...) @@ -148,6 +151,7 @@ OBJCOPY = $(CROSS_COMPILE)objcopy OBJDUMP = $(CROSS_COMPILE)objdump RANLIB = $(CROSS_COMPILE)RANLIB DTC = dtc +CHECK = sparse ######################################################################### @@ -274,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 @@ -321,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