From 55f92d25ba8c30298bd38bc92c93c765cec98831 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Wed, 7 Jan 2015 02:03:19 +0100 Subject: [PATCH] Change from Sparse to Clang's scan-build for `make check` target Signed-off-by: Joachim Nilsson --- Makefile | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index e084440..5b9d255 100644 --- a/Makefile +++ b/Makefile @@ -33,13 +33,9 @@ ARCHIVE = $(PKG).tar.xz CC ?= $(CROSS)gcc AR ?= $(CROSS)ar STRIP ?= $(CROSS)strip -CHECK ?= sparse CFLAGS += -fPIC -Os CPPFLAGS += -W -Wall -Werror ARFLAGS = crus -CHECK_FLAGS = -Wcast-to-as -Wdefault-bitfield-sign -Wdo-while -Wparen-string \ - -Wptr-subtraction-blows -Wreturn-void -Wshadow -Wtypesign -Wbitwise \ - -std=gnu99 -D__x86_64__ -D__LP64__ -I/usr/include/x86_64-linux-gnu JUNK = *~ *.bak *.map .*.d DEADJOE *.gdb *.elf core core.* LIBNAME = $(NAME) @@ -115,8 +111,9 @@ joystick: Makefile joystick.o $(STATICLIB) @printf " JOTST %s\n" $(STATICLIB) @$(CC) $(CPPFLAGS) -g -o joystick joystick.c $(STATICLIB) && ./joystick -check: - @$(CHECK) $(CHECK_FLAGS) $(CPPFLAGS) $(SRCS) bench.c +# Runs Clang scan-build on the whole tree +check: clean + @scan-build $(MAKE) all clean: -@$(RM) $(TARGET) *.o test