Makefile: say the default target upfront.
[git/git.git] / Makefile
CommitLineData
2731d048
JH
1# The default target of this Makefile is...
2all:
3
5bdac8b3
PB
4# Define MOZILLA_SHA1 environment variable when running make to make use of
5# a bundled SHA1 routine coming from Mozilla. It is GPL'd and should be fast
6# on non-x86 architectures (e.g. PowerPC), while the OpenSSL version (default
7# choice) has very fast version optimized for i586.
bdd4da59 8#
5bdac8b3
PB
9# Define NO_OPENSSL environment variable if you do not have OpenSSL. You will
10# miss out git-rev-list --merge-order. This also implies MOZILLA_SHA1.
2cb45e95 11#
58e60dd2
NH
12# Define NO_CURL if you do not have curl installed. git-http-pull and
13# git-http-push are not built, and you cannot use http:// and https://
14# transports.
b2c0bd65 15#
6d9bbc50
PM
16# Define CURLDIR=/foo/bar if your curl header and library files are in
17# /foo/bar/include and /foo/bar/lib directories.
18#
58e60dd2
NH
19# Define NO_EXPAT if you do not have expat installed. git-http-push is
20# not built, and you cannot push using http:// and https:// transports.
21#
ef34af24
LT
22# Define NO_STRCASESTR if you don't have strcasestr.
23#
5bdac8b3
PB
24# Define PPC_SHA1 environment variable when running make to make use of
25# a bundled SHA1 routine optimized for PowerPC.
597c9cc5 26#
7c6ef2f2
NP
27# Define ARM_SHA1 environment variable when running make to make use of
28# a bundled SHA1 routine optimized for ARM.
29#
597c9cc5 30# Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl (Darwin).
f0ebff0d 31#
597c9cc5 32# Define NEEDS_LIBICONV if linking with libc is not enough (Darwin).
f0ebff0d
PM
33#
34# Define NEEDS_SOCKET if linking with libc is not enough (SunOS,
35# Patrick Mauritz).
36#
730d48a2
JS
37# Define NO_MMAP if you want to avoid mmap.
38#
343d35c9
JH
39# Define WITH_OWN_SUBPROCESS_PY if you want to use with python 2.3.
40#
49744d63
PA
41# Define NO_IPV6 if you lack IPv6 support and getaddrinfo().
42#
5bdac8b3
PB
43# Define COLLISION_CHECK below if you believe that SHA1's
44# 1461501637330902918203684832716283019655932542976 hashes do not give you
45# sufficient guarantee that no collisions between objects will ever happen.
46
5bdac8b3
PB
47# Define USE_NSEC below if you want git to care about sub-second file mtimes
48# and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and
49# it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely
50# randomly break unless your underlying filesystem supports those sub-second
51# times (my ext3 doesn't).
52
5bdac8b3
PB
53# Define USE_STDEV below if you want git to care about the underlying device
54# change being considered an inode change from the update-cache perspective.
55
c2d07d24 56GIT_VERSION = 0.99.9.GIT
a9db2974 57
94d23317 58# CFLAGS and LDFLAGS are for the users to override from the command line.
12aa7456 59
b05701c5 60CFLAGS = -g -O2 -Wall
94d23317 61LDFLAGS =
12aa7456 62ALL_CFLAGS = $(CFLAGS)
94d23317 63ALL_LDFLAGS = $(LDFLAGS)
29c2cce4 64
b05701c5
PR
65prefix = $(HOME)
66bindir = $(prefix)/bin
67template_dir = $(prefix)/share/git-core/templates/
720d150c 68GIT_PYTHON_DIR = $(prefix)/share/git-core/python
a682ef9f 69# DESTDIR=
5c2a7fbc 70
b05701c5
PR
71CC = gcc
72AR = ar
229a7ed7 73TAR = tar
b05701c5
PR
74INSTALL = install
75RPMBUILD = rpmbuild
e83c5163 76
44c9e859
LT
77# sparse is architecture-neutral, which means that we need to tell it
78# explicitly what architecture to check for. Fix this up for yours..
b05701c5 79SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
44c9e859 80
28818ffa
PB
81
82
83### --- END CONFIGURATION SECTION ---
84
215a7ad1
JH
85SCRIPT_SH = \
86 git-add.sh git-bisect.sh git-branch.sh git-checkout.sh \
87 git-cherry.sh git-clone.sh git-commit.sh \
88 git-count-objects.sh git-diff.sh git-fetch.sh \
89 git-format-patch.sh git-log.sh git-ls-remote.sh \
90 git-merge-one-file.sh git-octopus.sh git-parse-remote.sh \
91 git-prune.sh git-pull.sh git-push.sh git-rebase.sh \
92 git-repack.sh git-request-pull.sh git-reset.sh \
93 git-resolve.sh git-revert.sh git-sh-setup.sh git-status.sh \
8e49d503 94 git-tag.sh git-verify-tag.sh git-whatchanged.sh \
d1c5f2a4 95 git-applymbox.sh git-applypatch.sh git-am.sh \
2276aa6c 96 git-merge.sh git-merge-stupid.sh git-merge-octopus.sh \
04e7ca1a 97 git-merge-resolve.sh git-merge-ours.sh git-grep.sh \
0086e2c8 98 git-lost-found.sh
215a7ad1
JH
99
100SCRIPT_PERL = \
101 git-archimport.perl git-cvsimport.perl git-relink.perl \
1331df87 102 git-shortlog.perl git-fmt-merge-msg.perl \
5e0306ad 103 git-svnimport.perl git-mv.perl git-cvsexportcommit.perl
60036a41 104
720d150c 105SCRIPT_PYTHON = \
e4cf17ce 106 git-merge-recursive.py
720d150c 107
d6ebd259
AE
108SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \
109 $(patsubst %.perl,%,$(SCRIPT_PERL)) \
110 $(patsubst %.py,%,$(SCRIPT_PYTHON)) \
111 gitk git-cherry-pick
112
597c9cc5
JH
113# The ones that do not have to link with lcrypto nor lz.
114SIMPLE_PROGRAMS = \
2f29dd52 115 git-get-tar-commit-id$X git-mailinfo$X git-mailsplit$X \
3299c6f6 116 git-stripspace$X git-daemon$X
597c9cc5
JH
117
118# ... and all the rest
215a7ad1 119PROGRAMS = \
79a9d8ea
PA
120 git-apply$X git-cat-file$X \
121 git-checkout-index$X git-clone-pack$X git-commit-tree$X \
122 git-convert-objects$X git-diff-files$X \
123 git-diff-index$X git-diff-stages$X \
124 git-diff-tree$X git-fetch-pack$X git-fsck-objects$X \
9cf6d335 125 git-hash-object$X git-index-pack$X git-init-db$X \
79a9d8ea
PA
126 git-local-fetch$X git-ls-files$X git-ls-tree$X git-merge-base$X \
127 git-merge-index$X git-mktag$X git-pack-objects$X git-patch-id$X \
128 git-peek-remote$X git-prune-packed$X git-read-tree$X \
129 git-receive-pack$X git-rev-list$X git-rev-parse$X \
35eb2d36 130 git-send-pack$X git-show-branch$X git-shell$X \
79a9d8ea
PA
131 git-show-index$X git-ssh-fetch$X \
132 git-ssh-upload$X git-tar-tree$X git-unpack-file$X \
133 git-unpack-objects$X git-update-index$X git-update-server-info$X \
134 git-upload-pack$X git-verify-pack$X git-write-tree$X \
03feddd6 135 git-update-ref$X git-symbolic-ref$X git-check-ref-format$X \
ee72aeaf 136 git-name-rev$X git-pack-redundant$X git-repo-config$X git-var$X
d6ebd259
AE
137
138# what 'all' will build and 'install' will install.
139ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS) git$X
e83c5163 140
894a8a8b 141# Backward compatibility -- to be removed after 1.0
2f29dd52 142PROGRAMS += git-ssh-pull$X git-ssh-push$X
f71a69ab 143
3d32051f
RA
144# Set paths to tools early so that they can be used for version tests.
145ifndef SHELL_PATH
146 SHELL_PATH = /bin/sh
147endif
148ifndef PERL_PATH
149 PERL_PATH = /usr/bin/perl
150endif
151ifndef PYTHON_PATH
152 PYTHON_PATH = /usr/bin/python
153endif
154
720d150c
JH
155PYMODULES = \
156 gitMergeCommon.py
157
0a02ce72 158LIB_FILE=libgit.a
8f3f9b09 159
215a7ad1
JH
160LIB_H = \
161 blob.h cache.h commit.h count-delta.h csum-file.h delta.h \
162 diff.h epoch.h object.h pack.h pkt-line.h quote.h refs.h \
0f56479d 163 run-command.h strbuf.h tag.h tree.h
b1bf95bb 164
215a7ad1
JH
165DIFF_OBJS = \
166 diff.o diffcore-break.o diffcore-order.o diffcore-pathspec.o \
ac1b3d12 167 diffcore-pickaxe.o diffcore-rename.o tree-diff.o
d1df5743 168
215a7ad1
JH
169LIB_OBJS = \
170 blob.o commit.o connect.o count-delta.o csum-file.o \
a9ab586a 171 date.o diff-delta.o entry.o ident.o index.o \
215a7ad1 172 object.o pack-check.o patch-delta.o path.o pkt-line.o \
0f56479d 173 quote.o read-cache.o refs.o run-command.o \
215a7ad1 174 server-info.o setup.o sha1_file.o sha1_name.o strbuf.o \
f3123c4a 175 tag.o tree.o usage.o config.o environment.o ctype.o copy.o \
4546738b 176 $(DIFF_OBJS)
d19938ab 177
cc1ad5c8
LT
178LIBS = $(LIB_FILE)
179LIBS += -lz
cef661fc 180
4769948a
JH
181# Shell quote;
182# Result of this needs to be placed inside ''
183shq = $(subst ','\'',$(1))
184# This has surrounding ''
185shellquote = '$(call shq,$(1))'
186
229a7ed7
JH
187#
188# Platform specific tweaks
189#
f7c15343
JH
190
191# We choose to avoid "if .. else if .. else .. endif endif"
192# because maintaining the nesting to match is a pain. If
193# we had "elif" things would have been much nicer...
194uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
195uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')
196uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')
197
198ifeq ($(uname_S),Darwin)
597c9cc5
JH
199 NEEDS_SSL_WITH_CRYPTO = YesPlease
200 NEEDS_LIBICONV = YesPlease
0cfddacd 201 ## fink
94d23317
JH
202 ALL_CFLAGS += -I/sw/include
203 ALL_LDFLAGS += -L/sw/lib
0cfddacd 204 ## darwinports
94d23317
JH
205 ALL_CFLAGS += -I/opt/local/include
206 ALL_LDFLAGS += -L/opt/local/lib
597c9cc5 207endif
f7c15343 208ifeq ($(uname_S),SunOS)
f0ebff0d 209 NEEDS_SOCKET = YesPlease
5a90d4ac 210 NEEDS_NSL = YesPlease
2fd955cc 211 NEEDS_LIBICONV = YesPlease
229a7ed7
JH
212 SHELL_PATH = /bin/bash
213 NO_STRCASESTR = YesPlease
229a7ed7
JH
214 INSTALL = ginstall
215 TAR = gtar
12aa7456 216 ALL_CFLAGS += -D__EXTENSIONS__
f0ebff0d 217endif
f7c15343 218ifeq ($(uname_O),Cygwin)
17754517
PA
219 NO_STRCASESTR = YesPlease
220 NEEDS_LIBICONV = YesPlease
2e67a5f4
JH
221 # There are conflicting reports about this.
222 # On some boxes NO_MMAP is needed, and not so elsewhere.
223 # Try uncommenting this if you see things break -- YMMV.
224 # NO_MMAP = YesPlease
49744d63 225 NO_IPV6 = YesPlease
a23cd8ec 226 X = .exe
12aa7456 227 ALL_CFLAGS += -DUSE_SYMLINK_HEAD=0
17754517 228endif
f7c15343 229ifeq ($(uname_S),OpenBSD)
5fb41e8a 230 NO_STRCASESTR = YesPlease
18c5a525 231 NEEDS_LIBICONV = YesPlease
94d23317
JH
232 ALL_CFLAGS += -I/usr/local/include
233 ALL_LDFLAGS += -L/usr/local/lib
234endif
235ifeq ($(uname_S),NetBSD)
236 NEEDS_LIBICONV = YesPlease
237 ALL_CFLAGS += -I/usr/pkg/include
238 ALL_LDFLAGS += -L/usr/pkg/lib -Wl,-rpath,/usr/pkg/lib
18c5a525 239endif
f7c15343
JH
240ifneq (,$(findstring arm,$(uname_M)))
241 ARM_SHA1 = YesPlease
242endif
597c9cc5 243
f2d6a256
JS
244-include config.mak
245
b34403aa
TH
246ifdef WITH_OWN_SUBPROCESS_PY
247 PYMODULES += compat/subprocess.py
248else
249 ifneq ($(shell $(PYTHON_PATH) -c 'import subprocess;print"OK"' 2>/dev/null),OK)
250 PYMODULES += compat/subprocess.py
251 endif
252endif
253
254ifdef WITH_SEND_EMAIL
255 SCRIPT_PERL += git-send-email.perl
256endif
257
229a7ed7
JH
258ifndef NO_CURL
259 ifdef CURLDIR
94d23317 260 # This is still problematic -- gcc does not always want -R.
12aa7456 261 ALL_CFLAGS += -I$(CURLDIR)/include
229a7ed7
JH
262 CURL_LIBCURL = -L$(CURLDIR)/lib -R$(CURLDIR)/lib -lcurl
263 else
264 CURL_LIBCURL = -lcurl
265 endif
2f29dd52 266 PROGRAMS += git-http-fetch$X
08900987
NH
267 curl_check := $(shell (echo 070908; curl-config --vernum) | sort -r | sed -ne 2p)
268 ifeq "$(curl_check)" "070908"
269 ifndef NO_EXPAT
270 EXPAT_LIBEXPAT = -lexpat
271 PROGRAMS += git-http-push$X
272 endif
58e60dd2 273 endif
229a7ed7
JH
274endif
275
dd53c7ab
PB
276ifndef NO_OPENSSL
277 LIB_OBJS += epoch.o
215a7ad1 278 OPENSSL_LIBSSL = -lssl
455a7f32
JH
279 ifdef OPENSSLDIR
280 # Again this may be problematic -- gcc does not always want -R.
12aa7456 281 ALL_CFLAGS += -I$(OPENSSLDIR)/include
455a7f32
JH
282 OPENSSL_LINK = -L$(OPENSSLDIR)/lib -R$(OPENSSLDIR)/lib
283 else
284 OPENSSL_LINK =
285 endif
dd53c7ab 286else
12aa7456 287 ALL_CFLAGS += -DNO_OPENSSL
215a7ad1
JH
288 MOZILLA_SHA1 = 1
289 OPENSSL_LIBSSL =
dd53c7ab 290endif
597c9cc5 291ifdef NEEDS_SSL_WITH_CRYPTO
455a7f32 292 LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto -lssl
597c9cc5 293else
455a7f32 294 LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto
597c9cc5
JH
295endif
296ifdef NEEDS_LIBICONV
455a7f32
JH
297 ifdef ICONVDIR
298 # Again this may be problematic -- gcc does not always want -R.
12aa7456 299 ALL_CFLAGS += -I$(ICONVDIR)/include
455a7f32
JH
300 ICONV_LINK = -L$(ICONVDIR)/lib -R$(ICONVDIR)/lib
301 else
302 ICONV_LINK =
303 endif
304 LIB_4_ICONV = $(ICONV_LINK) -liconv
597c9cc5
JH
305else
306 LIB_4_ICONV =
307endif
f0ebff0d
PM
308ifdef NEEDS_SOCKET
309 LIBS += -lsocket
310 SIMPLE_LIB += -lsocket
311endif
5a90d4ac
JH
312ifdef NEEDS_NSL
313 LIBS += -lnsl
314 SIMPLE_LIB += -lnsl
315endif
ef34af24 316ifdef NO_STRCASESTR
12aa7456 317 ALL_CFLAGS += -Dstrcasestr=gitstrcasestr -DNO_STRCASESTR=1
ef34af24
LT
318 LIB_OBJS += compat/strcasestr.o
319endif
730d48a2 320ifdef NO_MMAP
12aa7456 321 ALL_CFLAGS += -Dmmap=gitfakemmap -Dmunmap=gitfakemunmap -DNO_MMAP
730d48a2
JS
322 LIB_OBJS += compat/mmap.o
323endif
49744d63 324ifdef NO_IPV6
12aa7456 325 ALL_CFLAGS += -DNO_IPV6 -Dsockaddr_storage=sockaddr_in
49744d63 326endif
cef661fc 327
7c6ef2f2
NP
328ifdef PPC_SHA1
329 SHA1_HEADER = "ppc/sha1.h"
330 LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
331else
332ifdef ARM_SHA1
333 SHA1_HEADER = "arm/sha1.h"
334 LIB_OBJS += arm/sha1.o arm/sha1_arm.o
335else
336ifdef MOZILLA_SHA1
337 SHA1_HEADER = "mozilla-sha1/sha1.h"
338 LIB_OBJS += mozilla-sha1/sha1.o
339else
340 SHA1_HEADER = <openssl/sha.h>
341 LIBS += $(LIB_4_CRYPTO)
342endif
343endif
344endif
345
12aa7456 346ALL_CFLAGS += -DSHA1_HEADER=$(call shellquote,$(SHA1_HEADER))
cc1ad5c8 347
ec2d1511 348export prefix TAR INSTALL DESTDIR SHELL_PATH template_dir
28818ffa
PB
349### Build rules
350
d6ebd259 351all: $(ALL_PROGRAMS)
89967023 352
d3af621b
JH
353all:
354 $(MAKE) -C templates
b05701c5 355
8e49d503 356# Only use $(CFLAGS). We don't need anything else.
d6ebd259 357git$(X): git.c Makefile
8e49d503 358 $(CC) -DGIT_EXEC_PATH='"$(bindir)"' -DGIT_VERSION='"$(GIT_VERSION)"' \
d6ebd259 359 $(CFLAGS) $< -o $@
6a2e50f9 360
d6ebd259 361$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
bc6146d2 362 rm -f $@
4769948a 363 sed -e '1s|#!.*/sh|#!$(call shq,$(SHELL_PATH))|' \
3ff8cbed
JH
364 -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
365 $@.sh >$@
bc6146d2
JH
366 chmod +x $@
367
368$(patsubst %.perl,%,$(SCRIPT_PERL)) : % : %.perl
369 rm -f $@
4769948a 370 sed -e '1s|#!.*perl|#!$(call shq,$(PERL_PATH))|' \
3ff8cbed
JH
371 -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
372 $@.perl >$@
bc6146d2
JH
373 chmod +x $@
374
720d150c
JH
375$(patsubst %.py,%,$(SCRIPT_PYTHON)) : % : %.py
376 rm -f $@
4769948a
JH
377 sed -e '1s|#!.*python|#!$(call shq,$(PYTHON_PATH))|' \
378 -e 's|@@GIT_PYTHON_PATH@@|$(call shq,$(GIT_PYTHON_DIR))|g' \
3ff8cbed
JH
379 -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
380 $@.py >$@
720d150c
JH
381 chmod +x $@
382
4eba0f37
JS
383git-cherry-pick: git-revert
384 cp $< $@
385
b05701c5
PR
386%.o: %.c
387 $(CC) -o $*.o -c $(ALL_CFLAGS) $<
388%.o: %.S
389 $(CC) -o $*.o -c $(ALL_CFLAGS) $<
a310d434 390
2f29dd52 391git-%$X: %.o $(LIB_FILE)
94d23317 392 $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
623c8a14 393
2f29dd52 394git-mailinfo$X : SIMPLE_LIB += $(LIB_4_ICONV)
bb8c91d6 395$(SIMPLE_PROGRAMS) : $(LIB_FILE)
2f29dd52 396$(SIMPLE_PROGRAMS) : git-%$X : %.o
94d23317
JH
397 $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
398 $(LIB_FILE) $(SIMPLE_LIB)
597c9cc5 399
29508e1e
NH
400git-http-fetch$X: fetch.o http.o
401git-http-push$X: http.o
2f29dd52
PA
402git-local-fetch$X: fetch.o
403git-ssh-fetch$X: rsh.o fetch.o
404git-ssh-upload$X: rsh.o
405git-ssh-pull$X: rsh.o fetch.o
406git-ssh-push$X: rsh.o
a3df1801 407
2f29dd52 408git-http-fetch$X: LIBS += $(CURL_LIBCURL)
58e60dd2 409git-http-push$X: LIBS += $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
2f29dd52 410git-rev-list$X: LIBS += $(OPENSSL_LIBSSL)
a3df1801 411
d3af621b 412init-db.o: init-db.c
b05701c5 413 $(CC) -c $(ALL_CFLAGS) \
4769948a 414 -DDEFAULT_GIT_TEMPLATE_DIR=$(call shellquote,"$(template_dir)") $*.c
d3af621b 415
e468305a 416$(LIB_OBJS): $(LIB_H)
2f29dd52 417$(patsubst git-%$X,%.o,$(PROGRAMS)): $(LIB_H)
e468305a 418$(DIFF_OBJS): diffcore.h
e83c5163 419
28818ffa
PB
420$(LIB_FILE): $(LIB_OBJS)
421 $(AR) rcs $@ $(LIB_OBJS)
422
423doc:
424 $(MAKE) -C Documentation all
425
426
28818ffa
PB
427### Testing rules
428
429test: all
430 $(MAKE) -C t/ all
431
4ccafd7a 432test-date$X: test-date.c date.o ctype.o
94d23317 433 $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) test-date.c date.o ctype.o
28818ffa 434
2f29dd52 435test-delta$X: test-delta.c diff-delta.o patch-delta.o
94d23317 436 $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $^
28818ffa
PB
437
438check:
b05701c5 439 for i in *.c; do sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i; done
28818ffa
PB
440
441
442
443### Installation rules
444
d6ebd259 445install: all
4769948a 446 $(INSTALL) -d -m755 $(call shellquote,$(DESTDIR)$(bindir))
d6ebd259 447 $(INSTALL) $(ALL_PROGRAMS) $(call shellquote,$(DESTDIR)$(bindir))
8d5afef0 448 $(MAKE) -C templates install
4769948a
JH
449 $(INSTALL) -d -m755 $(call shellquote,$(DESTDIR)$(GIT_PYTHON_DIR))
450 $(INSTALL) $(PYMODULES) $(call shellquote,$(DESTDIR)$(GIT_PYTHON_DIR))
28818ffa
PB
451
452install-doc:
453 $(MAKE) -C Documentation install
454
455
456
457
458### Maintainer's dist rules
459
8b649e27 460git.spec: git.spec.in Makefile
a9db2974
CW
461 sed -e 's/@@VERSION@@/$(GIT_VERSION)/g' < $< > $@
462
8b649e27
PA
463GIT_TARNAME=git-$(GIT_VERSION)
464dist: git.spec git-tar-tree
b1de9de2 465 ./git-tar-tree HEAD $(GIT_TARNAME) > $(GIT_TARNAME).tar
a9db2974 466 @mkdir -p $(GIT_TARNAME)
8b649e27
PA
467 @cp git.spec $(GIT_TARNAME)
468 $(TAR) rf $(GIT_TARNAME).tar $(GIT_TARNAME)/git.spec
a9db2974 469 @rm -rf $(GIT_TARNAME)
9dce3c06 470 gzip -f -9 $(GIT_TARNAME).tar
a9db2974
CW
471
472rpm: dist
8b649e27 473 $(RPMBUILD) -ta $(GIT_TARNAME).tar.gz
a9db2974 474
7a590132 475deb: dist
f29eaed1 476 rm -rf $(GIT_TARNAME)
229a7ed7 477 $(TAR) zxf $(GIT_TARNAME).tar.gz
5a571cdd 478 dpkg-source -b $(GIT_TARNAME)
f29eaed1 479 cd $(GIT_TARNAME) && fakeroot debian/rules binary
28818ffa
PB
480
481### Cleaning rules
87a81c83 482
e83c5163 483clean:
9ce392f4
JH
484 rm -f *.o mozilla-sha1/*.o arm/*.o ppc/*.o compat/*.o $(LIB_FILE)
485 rm -f $(PROGRAMS) $(SIMPLE_PROGRAMS) git$X
bc6146d2 486 rm -f $(filter-out gitk,$(SCRIPTS))
8b649e27 487 rm -f *.spec *.pyc *.pyo
f29eaed1 488 rm -rf $(GIT_TARNAME)
5a571cdd 489 rm -f $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
d071e8db
JH
490 rm -f git-core_$(GIT_VERSION)-*.dsc
491 rm -f git-*_$(GIT_VERSION)-*.deb
ca67f002 492 $(MAKE) -C Documentation/ clean
229a7ed7 493 $(MAKE) -C templates clean
4b7581f0 494 $(MAKE) -C t/ clean