Support SPARSE in Makefile, better SPARSE_FLAGS
This patch makes it possible to use some other program instead of sparse (e.g. a wrapper around sparse). It also provides a better default for SPARSE_FLAGS. __BIG_ENDIAN__ should not be needed.
Signed-off-by: Pavel Roskin <proski@gnu.org>
Show changes to Makefile +4 −3
diff --git a/Makefile b/Makefile --- a/Makefile +++ b/Makefile @@ -66,8 +66,9 @@ INSTALL = install RPMBUILD = rpmbuild # sparse is architecture-neutral, which means that we need to tell it -# explicitly what architecture to check for. Fix this up for yours.. -SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__ +# explicitly what architecture to check for. +SPARSE = sparse +SPARSE_FLAGS = -D__$(shell uname -i)__ @@ -335,7 +336,7 @@ test-delta: test-delta.c diff-delta.o pa $(CC) $(ALL_CFLAGS) -o $@ $^ check: - for i in *.c; do sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i; done + for i in *.c; do $(SPARSE) $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i; done
-- Regards, Pavel Roskin