]> git.ipfire.org Git - thirdparty/git.git/blame - Makefile
git-clone-pack: fix sparse warning
[thirdparty/git.git] / Makefile
CommitLineData
5c2a7fbc
PB
1# -DCOLLISION_CHECK if you believe that SHA1's
2# 1461501637330902918203684832716283019655932542976 hashes do not give you
3# enough guarantees about no collisions between objects ever hapenning.
bdd4da59 4#
2cb45e95
LT
5# -DUSE_NSEC if you want git to care about sub-second file mtimes and ctimes.
6# -DUSE_STDEV if you want git to care about st_dev changing
7#
bdd4da59
PB
8# Note that you need some new glibc (at least >2.2.4) for this, and it will
9# BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely randomly
10# break unless your underlying filesystem supports those sub-second times
11# (my ext3 doesn't).
1a3e7176 12COPTS=-O2
29c2cce4
TG
13CFLAGS=-g $(COPTS) -Wall
14
15prefix=$(HOME)
16bin=$(prefix)/bin
17# dest=
5c2a7fbc 18
e83c5163 19CC=gcc
0a02ce72 20AR=ar
29c2cce4 21INSTALL=install
e83c5163 22
44c9e859
LT
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#
27SPARSE_FLAGS=-D__BIG_ENDIAN__ -D__powerpc__
28
e764b8e8 29SCRIPTS=git git-apply-patch-script git-merge-one-file-script git-prune-script \
e002a16b 30 git-pull-script git-tag-script git-resolve-script git-whatchanged \
c4584ae3 31 git-fetch-script git-status-script git-commit-script \
40d8cfe4 32 git-log-script git-shortlog git-cvsimport-script git-diff-script \
3f571e0b 33 git-reset-script git-add-script git-checkout-script git-clone-script \
b2d46199 34 gitk git-cherry git-rebase-script git-relink-script git-repack-script
bdd4da59 35
a3df1801
LT
36PROG= git-update-cache git-diff-files git-init-db git-write-tree \
37 git-read-tree git-commit-tree git-cat-file git-fsck-cache \
9b23b4bc 38 git-checkout-cache git-diff-tree git-rev-tree git-ls-files \
a3df1801
LT
39 git-check-files git-ls-tree git-merge-base git-merge-cache \
40 git-unpack-file git-export git-diff-cache git-convert-cache \
418aaf84 41 git-http-pull git-ssh-push git-ssh-pull git-rev-list git-mktag \
99665af5 42 git-diff-helper git-tar-tree git-local-pull git-write-blob \
c4584ae3 43 git-get-tar-commit-id git-apply git-stripspace \
def88e9a
LT
44 git-diff-stages git-rev-parse git-patch-id git-pack-objects \
45 git-unpack-objects git-verify-pack git-receive-pack git-send-pack \
0271611e
LT
46 git-prune-packed git-fetch-pack git-upload-pack git-clone-pack \
47 git-show-index
e83c5163
LT
48
49all: $(PROG)
50
cd2fb81d 51install: $(PROG) $(SCRIPTS)
29c2cce4 52 $(INSTALL) $(PROG) $(SCRIPTS) $(dest)$(bin)
e83c5163 53
ecee9d9e 54LIB_OBJS=read-cache.o sha1_file.o usage.o object.o commit.o tree.o blob.o \
c4584ae3 55 tag.o date.o index.o diff-delta.o patch-delta.o entry.o \
f7192598 56 epoch.o refs.o csum-file.o pack-check.o pkt-line.o connect.o
0a02ce72 57LIB_FILE=libgit.a
f3a3214e 58LIB_H=cache.h object.h blob.h tree.h commit.h tag.h delta.h epoch.h csum-file.h \
44c9e859 59 pack.h pkt-line.h refs.h
0a02ce72 60
d1df5743
JH
61LIB_H += strbuf.h
62LIB_OBJS += strbuf.o
63
85976974
JH
64LIB_H += diff.h count-delta.h
65LIB_OBJS += diff.o diffcore-rename.o diffcore-pickaxe.o diffcore-pathspec.o \
af5323e0 66 count-delta.o diffcore-break.o diffcore-order.o
86436c28 67
d19938ab
JH
68LIB_OBJS += gitenv.o
69
cc1ad5c8
LT
70LIBS = $(LIB_FILE)
71LIBS += -lz
cef661fc
LT
72
73ifdef MOZILLA_SHA1
74 SHA1_HEADER="mozilla-sha1/sha1.h"
75 LIB_OBJS += mozilla-sha1/sha1.o
a6ef3518
PM
76else
77ifdef PPC_SHA1
78 SHA1_HEADER="ppc/sha1.h"
79 LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
cef661fc
LT
80else
81 SHA1_HEADER=<openssl/sha.h>
3be4b61a 82 LIBS += -lcrypto
cef661fc 83endif
a6ef3518 84endif
cef661fc
LT
85
86CFLAGS += '-DSHA1_HEADER=$(SHA1_HEADER)'
cc1ad5c8 87
0a02ce72
LT
88$(LIB_FILE): $(LIB_OBJS)
89 $(AR) rcs $@ $(LIB_OBJS)
90
44c9e859
LT
91check:
92 for i in *.c; do sparse $(CFLAGS) $(SPARSE_FLAGS) $$i; done
93
89967023
LT
94test-date: test-date.c date.o
95 $(CC) $(CFLAGS) -o $@ test-date.c date.o
96
a310d434
NP
97test-delta: test-delta.c diff-delta.o patch-delta.o
98 $(CC) $(CFLAGS) -o $@ $^
99
a3df1801 100git-%: %.c $(LIB_FILE)
6eb7ed54
DB
101 $(CC) $(CFLAGS) -o $@ $(filter %.c,$^) $(LIBS)
102
a3df1801
LT
103git-update-cache: update-cache.c
104git-diff-files: diff-files.c
105git-init-db: init-db.c
106git-write-tree: write-tree.c
107git-read-tree: read-tree.c
108git-commit-tree: commit-tree.c
109git-cat-file: cat-file.c
110git-fsck-cache: fsck-cache.c
111git-checkout-cache: checkout-cache.c
112git-diff-tree: diff-tree.c
113git-rev-tree: rev-tree.c
9b23b4bc 114git-ls-files: ls-files.c
a3df1801
LT
115git-check-files: check-files.c
116git-ls-tree: ls-tree.c
117git-merge-base: merge-base.c
118git-merge-cache: merge-cache.c
119git-unpack-file: unpack-file.c
120git-export: export.c
121git-diff-cache: diff-cache.c
122git-convert-cache: convert-cache.c
4250a5e5 123git-http-pull: http-pull.c pull.c
dfcb4057 124git-local-pull: local-pull.c pull.c
418aaf84
JH
125git-ssh-push: rsh.c
126git-ssh-pull: rsh.c pull.c
a3df1801
LT
127git-rev-list: rev-list.c
128git-mktag: mktag.c
99665af5 129git-diff-helper: diff-helper.c
a3df1801 130git-tar-tree: tar-tree.c
74400e71 131git-write-blob: write-blob.c
a3e870f2 132git-stripspace: stripspace.c
22f77b77 133git-diff-stages: diff-stages.c
178cb243 134git-rev-parse: rev-parse.c
f9767222 135git-patch-id: patch-id.c
c323ac7d 136git-pack-objects: pack-objects.c
bad50dc8 137git-unpack-objects: unpack-objects.c
f9253394 138git-verify-pack: verify-pack.c
575f4974 139git-receive-pack: receive-pack.c
61221472 140git-send-pack: send-pack.c
2396ec85 141git-prune-packed: prune-packed.c
def88e9a 142git-fetch-pack: fetch-pack.c
a3df1801
LT
143
144git-http-pull: LIBS += -lcurl
64de3562 145git-rev-list: LIBS += -lssl
a3df1801
LT
146
147# Library objects..
e590d694 148blob.o: $(LIB_H)
a3df1801 149tree.o: $(LIB_H)
e590d694 150commit.o: $(LIB_H)
a3df1801 151tag.o: $(LIB_H)
e590d694
LT
152object.o: $(LIB_H)
153read-cache.o: $(LIB_H)
e590d694 154sha1_file.o: $(LIB_H)
e590d694 155usage.o: $(LIB_H)
e515f318 156strbuf.o: $(LIB_H)
d19938ab 157gitenv.o: $(LIB_H)
6ee67f26 158entry.o: $(LIB_H)
6b14d7fa
JH
159diff.o: $(LIB_H) diffcore.h
160diffcore-rename.o : $(LIB_H) diffcore.h
161diffcore-pathspec.o : $(LIB_H) diffcore.h
162diffcore-pickaxe.o : $(LIB_H) diffcore.h
f345b0a0 163diffcore-break.o : $(LIB_H) diffcore.h
af5323e0 164diffcore-order.o : $(LIB_H) diffcore.h
a3437b8c 165epoch.o: $(LIB_H)
e83c5163 166
14cd1ff3 167test: all
ca67f002 168 $(MAKE) -C t/ all
dfe07051 169
e83c5163 170clean:
a6ef3518 171 rm -f *.o mozilla-sha1/*.o ppc/*.o $(PROG) $(LIB_FILE)
ca67f002 172 $(MAKE) -C Documentation/ clean
e83c5163
LT
173
174backup: clean
175 cd .. ; tar czvf dircache.tar.gz dir-cache