Skip to content

Commit 44c9e85

Browse files
author
Linus Torvalds
committed
Fix up header file dependencies and add sparse checking rules
We're pretty sparse-clean already, thanks to earlier efforts, but some things inevitably creep in.
1 parent 944d858 commit 44c9e85

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ CC=gcc
2020
AR=ar
2121
INSTALL=install
2222

23+
#
24+
# sparse is architecture-neutral, which means that we need to tell it
25+
# explicitly what architecture to check for. Fix this up for yours..
26+
#
27+
SPARSE_FLAGS=-D__BIG_ENDIAN__ -D__powerpc__
28+
2329
SCRIPTS=git git-apply-patch-script git-merge-one-file-script git-prune-script \
2430
git-pull-script git-tag-script git-resolve-script git-whatchanged \
2531
git-fetch-script git-status-script git-commit-script \
@@ -49,7 +55,7 @@ LIB_OBJS=read-cache.o sha1_file.o usage.o object.o commit.o tree.o blob.o \
4955
epoch.o refs.o csum-file.o pack-check.o pkt-line.o
5056
LIB_FILE=libgit.a
5157
LIB_H=cache.h object.h blob.h tree.h commit.h tag.h delta.h epoch.h csum-file.h \
52-
pack.h pkt-line.h
58+
pack.h pkt-line.h refs.h
5359

5460
LIB_H += strbuf.h
5561
LIB_OBJS += strbuf.o
@@ -81,6 +87,9 @@ CFLAGS += '-DSHA1_HEADER=$(SHA1_HEADER)'
8187
$(LIB_FILE): $(LIB_OBJS)
8288
$(AR) rcs $@ $(LIB_OBJS)
8389

90+
check:
91+
for i in *.c; do sparse $(CFLAGS) $(SPARSE_FLAGS) $$i; done
92+
8493
test-date: test-date.c date.o
8594
$(CC) $(CFLAGS) -o $@ test-date.c date.o
8695

0 commit comments

Comments
 (0)