]> git.ipfire.org Git - thirdparty/git.git/blame - Makefile
Don't special-case a zero-sized compression.
[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 \
1fcc8ea5 46 git-prune-packed git-fetch-pack git-upload-pack git-clone-pack
e83c5163
LT
47
48all: $(PROG)
49
cd2fb81d 50install: $(PROG) $(SCRIPTS)
29c2cce4 51 $(INSTALL) $(PROG) $(SCRIPTS) $(dest)$(bin)
e83c5163 52
ecee9d9e 53LIB_OBJS=read-cache.o sha1_file.o usage.o object.o commit.o tree.o blob.o \
c4584ae3 54 tag.o date.o index.o diff-delta.o patch-delta.o entry.o \
f7192598 55 epoch.o refs.o csum-file.o pack-check.o pkt-line.o connect.o
0a02ce72 56LIB_FILE=libgit.a
f3a3214e 57LIB_H=cache.h object.h blob.h tree.h commit.h tag.h delta.h epoch.h csum-file.h \
44c9e859 58 pack.h pkt-line.h refs.h
0a02ce72 59
d1df5743
JH
60LIB_H += strbuf.h
61LIB_OBJS += strbuf.o
62
85976974
JH
63LIB_H += diff.h count-delta.h
64LIB_OBJS += diff.o diffcore-rename.o diffcore-pickaxe.o diffcore-pathspec.o \
af5323e0 65 count-delta.o diffcore-break.o diffcore-order.o
86436c28 66
d19938ab
JH
67LIB_OBJS += gitenv.o
68
cc1ad5c8
LT
69LIBS = $(LIB_FILE)
70LIBS += -lz
cef661fc
LT
71
72ifdef MOZILLA_SHA1
73 SHA1_HEADER="mozilla-sha1/sha1.h"
74 LIB_OBJS += mozilla-sha1/sha1.o
a6ef3518
PM
75else
76ifdef PPC_SHA1
77 SHA1_HEADER="ppc/sha1.h"
78 LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
cef661fc
LT
79else
80 SHA1_HEADER=<openssl/sha.h>
3be4b61a 81 LIBS += -lcrypto
cef661fc 82endif
a6ef3518 83endif
cef661fc
LT
84
85CFLAGS += '-DSHA1_HEADER=$(SHA1_HEADER)'
cc1ad5c8 86
0a02ce72
LT
87$(LIB_FILE): $(LIB_OBJS)
88 $(AR) rcs $@ $(LIB_OBJS)
89
44c9e859
LT
90check:
91 for i in *.c; do sparse $(CFLAGS) $(SPARSE_FLAGS) $$i; done
92
89967023
LT
93test-date: test-date.c date.o
94 $(CC) $(CFLAGS) -o $@ test-date.c date.o
95
a310d434
NP
96test-delta: test-delta.c diff-delta.o patch-delta.o
97 $(CC) $(CFLAGS) -o $@ $^
98
a3df1801 99git-%: %.c $(LIB_FILE)
6eb7ed54
DB
100 $(CC) $(CFLAGS) -o $@ $(filter %.c,$^) $(LIBS)
101
a3df1801
LT
102git-update-cache: update-cache.c
103git-diff-files: diff-files.c
104git-init-db: init-db.c
105git-write-tree: write-tree.c
106git-read-tree: read-tree.c
107git-commit-tree: commit-tree.c
108git-cat-file: cat-file.c
109git-fsck-cache: fsck-cache.c
110git-checkout-cache: checkout-cache.c
111git-diff-tree: diff-tree.c
112git-rev-tree: rev-tree.c
9b23b4bc 113git-ls-files: ls-files.c
a3df1801
LT
114git-check-files: check-files.c
115git-ls-tree: ls-tree.c
116git-merge-base: merge-base.c
117git-merge-cache: merge-cache.c
118git-unpack-file: unpack-file.c
119git-export: export.c
120git-diff-cache: diff-cache.c
121git-convert-cache: convert-cache.c
4250a5e5 122git-http-pull: http-pull.c pull.c
dfcb4057 123git-local-pull: local-pull.c pull.c
418aaf84
JH
124git-ssh-push: rsh.c
125git-ssh-pull: rsh.c pull.c
a3df1801
LT
126git-rev-list: rev-list.c
127git-mktag: mktag.c
99665af5 128git-diff-helper: diff-helper.c
a3df1801 129git-tar-tree: tar-tree.c
74400e71 130git-write-blob: write-blob.c
a3e870f2 131git-stripspace: stripspace.c
22f77b77 132git-diff-stages: diff-stages.c
178cb243 133git-rev-parse: rev-parse.c
f9767222 134git-patch-id: patch-id.c
c323ac7d 135git-pack-objects: pack-objects.c
bad50dc8 136git-unpack-objects: unpack-objects.c
f9253394 137git-verify-pack: verify-pack.c
575f4974 138git-receive-pack: receive-pack.c
61221472 139git-send-pack: send-pack.c
2396ec85 140git-prune-packed: prune-packed.c
def88e9a 141git-fetch-pack: fetch-pack.c
a3df1801
LT
142
143git-http-pull: LIBS += -lcurl
64de3562 144git-rev-list: LIBS += -lssl
a3df1801
LT
145
146# Library objects..
e590d694 147blob.o: $(LIB_H)
a3df1801 148tree.o: $(LIB_H)
e590d694 149commit.o: $(LIB_H)
a3df1801 150tag.o: $(LIB_H)
e590d694
LT
151object.o: $(LIB_H)
152read-cache.o: $(LIB_H)
e590d694 153sha1_file.o: $(LIB_H)
e590d694 154usage.o: $(LIB_H)
e515f318 155strbuf.o: $(LIB_H)
d19938ab 156gitenv.o: $(LIB_H)
6ee67f26 157entry.o: $(LIB_H)
6b14d7fa
JH
158diff.o: $(LIB_H) diffcore.h
159diffcore-rename.o : $(LIB_H) diffcore.h
160diffcore-pathspec.o : $(LIB_H) diffcore.h
161diffcore-pickaxe.o : $(LIB_H) diffcore.h
f345b0a0 162diffcore-break.o : $(LIB_H) diffcore.h
af5323e0 163diffcore-order.o : $(LIB_H) diffcore.h
a3437b8c 164epoch.o: $(LIB_H)
e83c5163 165
14cd1ff3 166test: all
ca67f002 167 $(MAKE) -C t/ all
dfe07051 168
e83c5163 169clean:
a6ef3518 170 rm -f *.o mozilla-sha1/*.o ppc/*.o $(PROG) $(LIB_FILE)
ca67f002 171 $(MAKE) -C Documentation/ clean
e83c5163
LT
172
173backup: clean
174 cd .. ; tar czvf dircache.tar.gz dir-cache