3 ARCH ?
=$(shell dpkg-architecture
-qDEB_HOST_ARCH
)
6 CPPFLAGS
:=$(shell dpkg-buildflags
--get CPPFLAGS
)
7 CFLAGS
:=-Wall
$(shell dpkg-buildflags
--get CFLAGS
) $(CPPFLAGS
)
8 LDFLAGS
:=$(shell dpkg-buildflags
--get LDFLAGS
)
11 OPTS
=NO_OPENSSL
=1 prefix=/usr gitexecdir
=/usr
/lib
/git-core \
12 libexecdir
=/usr
/lib
/git-core \
13 mandir=/usr
/share
/man htmldir
=/usr
/share
/doc
/git
/html \
18 SANE_TOOL_PATH
= INSTALL
=install TAR
=tar \
19 NO_CROSS_DIRECTORY_HARDLINKS
=1 NO_INSTALL_HARDLINKS
=1 \
20 DEFAULT_PAGER
=pager DEFAULT_EDITOR
=editor \
21 CC
='$(CC)' CFLAGS
='$(CFLAGS)' LDFLAGS
='$(LDFLAGS)'
22 DOC_OPTS
=prefix=/usr htmldir
=/usr
/share
/doc
/git
/html \
23 ASCIIDOC8
=1 ASCIIDOC_NO_ROFF
=1
25 ifneq (,$(findstring nostrip
,$(DEB_BUILD_OPTIONS
)))
28 ifneq (,$(findstring nocheck
,$(DEB_BUILD_OPTIONS
)))
31 ifneq (,$(filter parallel
=%,$(DEB_BUILD_OPTIONS
)))
32 NUMJOBS
= $(patsubst parallel
=%,%,$(filter parallel
=%,$(DEB_BUILD_OPTIONS
)))
33 MAKEFLAGS
+= -j
$(NUMJOBS
)
41 PKG_INDEP
+= git-mediawiki
42 PKG_INDEP
+= git-daemon-run
43 PKG_INDEP
+= git-daemon-sysvinit
44 PKG_INDEP
+= git-email
53 GIT
=$(shell pwd
)/debian
/git
55 patch
: deb-checkdir patch-stamp
57 for i in
`ls -1 debian/diff/*.diff debian/diff/*.patch \
58 2>/dev/null || :`; do \
59 patch
-p1
-N
-r-
<$$i ||
test $$?
= 1 || exit
1; \
63 build
: build-arch build-indep
65 build-arch
: deb-checkdir build-arch-stamp
66 build-arch-stamp
: patch-stamp
68 DESTDIR
='$(GIT)' $(MAKE
) all $(OPTS
)
69 DESTDIR
='$(GIT)' $(MAKE
) -C contrib
/subtree
all $(OPTS
)
70 ln
-s contrib
/subtree
/git-subtree
71 test -z
'$(TEST)' || \
72 DESTDIR
='$(GIT)' $(MAKE
) $(TEST
) $(OPTS
) || \
73 GIT_TEST_OPTS
=--verbose DESTDIR
='$(GIT)' $(MAKE
) $(TEST
) $(OPTS
)
74 test -z
'$(TEST)' || \
75 DESTDIR
='$(GIT)' $(MAKE
) -C contrib
/subtree
$(TEST
) $(OPTS
) || \
76 GIT_TEST_OPTS
=--verbose DESTDIR
='$(GIT)' $(MAKE
) -C contrib
/subtree
$(TEST
) $(OPTS
)
77 touch build-arch-stamp
79 build-indep
: deb-checkdir build-indep-stamp
80 build-indep-stamp
: patch-stamp build-arch-stamp
82 $(MAKE
) -CDocumentation man html
$(DOC_OPTS
)
84 $(MAKE
) -Ccontrib
/mw-to-git
all $(OPTS
)
85 touch build-indep-stamp
89 ! test -e patch-stamp || \
92 $(MAKE
) -Ccontrib
/mw-to-git
clean $(OPTS
); \
93 for i in
`ls -1r debian/diff/*.diff debian/diff/*.patch \
94 2>/dev/null || :`; do \
95 patch
-p1
-NR
-r-
<$$i ||
test $$?
= 1 || exit
1; \
99 rm -f patch-stamp build-arch-stamp build-indep-stamp
101 for i in
'' $(patsubst git
%,%,$(PKG_INDEP
)) -core
; do \
102 rm -rf
'$(GIT)'$$i; \
104 rm -f debian
/files debian
/substvars
107 install: install-arch install-indep
108 git.
install: install-arch
109 install-arch
: deb-checkdir deb-checkuid build-arch-stamp
112 install -d
-m0755
'$(GIT)'/usr
/bin
113 DESTDIR
='$(GIT)' $(MAKE
) install $(OPTS
)
114 DESTDIR
='$(GIT)' $(MAKE
) -C contrib
/subtree
install $(OPTS
)
115 install -d
-m0755
'$(GIT)'/var
/lib
/git
116 rm -f
'$(GIT)'/usr
/share
/perl5
/Error.pm
117 rm -rf
'$(GIT)'/usr
/share
/man
118 chmod
644 '$(GIT)'/usr
/share
/perl5
/Git.pm
119 find
'$(GIT)'/usr
/share
/perl5
/Git
-type d | xargs chmod
0755
120 find
'$(GIT)'/usr
/share
/perl5
/Git
-type f | xargs chmod
0644
121 # don't include arch, cvs, svn, email, gui tools, and gitk program
122 for i in git-archimport git-cvs git-svn git-send-email \
123 git-gui git-citool
; do \
124 rm -f
'$(GIT)'/usr
/lib
/git-core
/$$i*; \
126 rm -f
'$(GIT)'/usr
/bin
/git-cvsserver
127 rm -f
'$(GIT)'/usr
/bin
/gitk
128 for i in
'$(GIT)'/usr
/bin
/* '$(GIT)'/usr
/lib
/git-core
/*; do \
130 test "`head -c2 $$i`" = '#!' || \
131 test "`head -c2 $$i`" = '# ' || \
132 $(STRIP
) -R .comment
-R .note
$$i; \
134 # don't include git-gui's lib
135 rm -rf
'$(GIT)'/usr
/share
/git-gui
/
136 # don't include gitk's lib
137 rm -rf
'$(GIT)'/usr
/share
/gitk
/
138 # don't include git-svn's lib
139 rm -rf
'$(GIT)'/usr
/share
/perl5
/Git
/SVN
*
141 install -d
-m0755
'$(GIT)'/usr
/share
/bash-completion
/completions
142 install -m0644 contrib
/completion
/git-completion.bash \
143 '$(GIT)'/usr
/share
/bash-completion
/completions
/git
144 ln
-s git
'$(GIT)'/usr
/share
/bash-completion
/completions
/gitk
146 install -m0644 contrib
/completion
/git-prompt.sh \
147 '$(GIT)'/usr
/lib
/git-core
/git-sh-prompt
148 install -d
-m0755
'$(GIT)'/etc
/bash_completion.d
149 install -m0644 debian
/git-prompt.completion \
150 '$(GIT)'/etc
/bash_completion.d
/git-prompt
151 # sanity check that #642603 fix is still in place
153 '$(GIT)'/usr
/lib
/git-core
/git-branch
) -le
10
155 install -d
-m0755
'$(GIT)'/usr
/share
/gitweb
156 ln
-s gitweb.cgi
'$(GIT)'/usr
/share
/gitweb
/index.cgi
158 install -d
-m0755
'$(GIT)'/usr
/share
/git-core
/contrib
/hooks
159 set
-e
; for i in contrib
/hooks
/*; do \
160 test "$$i" != contrib
/hooks
/multimail || continue
; \
161 install -m0755
"$$i" \
162 '$(GIT)'/usr
/share
/git-core
/contrib
/hooks
/; \
165 install -d
-m0755
'$(GIT)'/usr
/share
/doc
/git
166 cp
-R contrib
'$(GIT)'/usr
/share
/doc
/git
/
167 rm -rf
'$(GIT)'/usr
/share
/doc
/git
/contrib
/completion
168 rm -rf
'$(GIT)'/usr
/share
/doc
/git
/contrib
/emacs
169 rm -rf
'$(GIT)'/usr
/share
/doc
/git
/contrib
/mw-to-git
170 find
'$(GIT)'/usr
/share
/doc
/git
/contrib
-type f | xargs chmod
0644
171 find
'$(GIT)'/usr
/share
/doc
/git
/contrib
-type d | xargs chmod
0755
172 # remove contrib hooks, they are now installed in
173 # /usr/share/git-core/contrib, keep symlink for backward compatibility
174 rm -rf
'$(GIT)'/usr
/share
/doc
/git
/contrib
/hooks
175 ln
-s ..
/..
/..
/git-core
/contrib
/hooks \
176 '$(GIT)'/usr
/share
/doc
/git
/contrib
/
177 find
'$(GIT)'/usr
/share
/doc
/git
/ -name .gitignore | xargs
rm -f
179 $(patsubst %,%.
install,$(PKG_INDEP
)) git-core.
install: install-indep
180 install-indep
: build-arch-stamp build-indep-stamp
182 install -d
-m0755
'$(TMP)'
183 DESTDIR
='$(TMP)' $(MAKE
) install install-doc
$(OPTS
)
184 install -d
-m0755
'$(TMP)/usr/share/perl5/Git'
185 DESTDIR
='$(TMP)' $(MAKE
) -Ccontrib
/mw-to-git
install $(OPTS
) \
186 INSTLIBDIR
=/usr
/share
/perl5
187 $(MAKE
) -CDocumentation install-webdoc WEBDOC_DEST
='$(TMP)'/html \
189 $(MAKE
) -C contrib
/subtree doc
$(OPTS
)
190 install -m
0644 contrib
/subtree
/git-subtree.txt
'$(TMP)'/html
191 install -m
0644 contrib
/subtree
/git-subtree.html
'$(TMP)'/html
192 # RelNotes are shipped in git
193 rm -rf
'$(TMP)'/html
/RelNotes
196 install -d
-m0755
'$(GIT)'-man
/usr
/share
/man
/man3
197 DESTDIR
='$(GIT)'-man
$(MAKE
) install-doc
$(OPTS
)
198 PATH
=$$PATH:$(CURDIR
) DESTDIR
='$(GIT)'-man
$(MAKE
) -C contrib
/subtree install-doc
$(OPTS
)
199 install -m
0644 '$(TMP)'/usr
/share
/man
/man3
/Git
* \
200 '$(GIT)'-man
/usr
/share
/man
/man3
/
201 # don't include arch, cvs, svn, email, gui, and gitk man pages
202 for i in git-archimport git-cvs git-svn git-send-email gitk \
203 git-gui git-citool
; do \
204 rm -f
'$(GIT)'-man
/usr
/share
/man
/man1
/$$i*; \
206 rm -f
'$(GIT)'-man
/usr
/share
/man
/man3
/Git
::SVN
*.3pm
207 chmod
0644 '$(GIT)'-man
/usr
/share
/man
/man?
/*.
[0-9]*
208 gzip
-9 '$(GIT)'-man
/usr
/share
/man
/man?
/*.
[0-9]*
211 install -d
-m0755
'$(GIT)'-doc
/usr
/share
/doc
/git
212 ln
-s ..
/git-doc
'$(GIT)'-doc
/usr
/share
/doc
/git
/html
214 for i in cvs svn
; do \
215 rm -rf
'$(GIT)'-$$i && \
216 install -d
-m0755
'$(GIT)'-$$i/usr
/lib
/git-core
&& \
217 install -m0755
'$(TMP)'/usr
/lib
/git-core
/git-
$$i* \
218 '$(GIT)'-$$i/usr
/lib
/git-core
/ && \
219 install -d
-m0755
'$(GIT)'-$$i/usr
/share
/man
/man1
&& \
220 install -m0644
'$(TMP)'/usr
/share
/man
/man1
/git-
$$i* \
221 '$(GIT)'-$$i/usr
/share
/man
/man1
/ && \
222 gzip
-9 '$(GIT)'-$$i/usr
/share
/man
/man1
/*.1 || exit
1; \
224 install -d
-m0755
'$(GIT)'-svn
/usr
/share
/perl5
/Git
225 cp
-R
'$(TMP)'/usr
/share
/perl5
/Git
/SVN
* \
226 '$(GIT)'-svn
/usr
/share
/perl5
/Git
/
227 find
'$(GIT)'-svn
/usr
/share
/perl5
/Git
-type d | xargs chmod
0755
228 find
'$(GIT)'-svn
/usr
/share
/perl5
/Git
-type f | xargs chmod
0644
229 install -d
-m0755
'$(GIT)'-svn
/usr
/share
/man
/man3
230 install -m
0644 '$(TMP)'/usr
/share
/man
/man3
/Git
::SVN
*.3pm \
231 '$(GIT)'-svn
/usr
/share
/man
/man3
/
232 gzip
-9 '$(GIT)'-svn
/usr
/share
/man
/man3
/*.3pm
234 install -d
-m0755
'$(GIT)'-cvs
/usr
/bin
235 install -m0755
'$(TMP)'/usr
/bin
/git-cvsserver
'$(GIT)'-cvs
/usr
/bin
/
238 install -d
-m0755
'$(GIT)'-arch
/usr
/lib
/git-core
239 install -m0755
'$(TMP)'/usr
/lib
/git-core
/git-archimport \
240 '$(GIT)'-arch
/usr
/lib
/git-core
/
241 install -d
-m0755
'$(GIT)'-arch
/usr
/share
/man
/man1
242 install -m0644
'$(TMP)'/usr
/share
/man
/man1
/git-archimport
.1 \
243 '$(GIT)'-arch
/usr
/share
/man
/man1
/
244 gzip
-9 '$(GIT)'-arch
/usr
/share
/man
/man1
/*.1
246 rm -rf
'$(GIT)'-mediawiki
247 install -d
-m0755
'$(GIT)'-mediawiki
/usr
/share
/perl5
/Git
248 install -m0644
'$(TMP)'/usr
/share
/perl5
/Git
/Mediawiki.pm \
249 '$(GIT)'-mediawiki
/usr
/share
/perl5
/Git
/
250 install -d
-m0755
'$(GIT)'-mediawiki
/usr
/lib
/git-core
251 install -m0755
'$(TMP)'/usr
/lib
/git-core
/git-mw \
252 '$(GIT)'-mediawiki
/usr
/lib
/git-core
/
253 install -m0755
'$(TMP)'/usr
/lib
/git-core
/git-remote-mediawiki \
254 '$(GIT)'-mediawiki
/usr
/lib
/git-core
/
256 rm -rf
'$(GIT)'-email
257 install -d
-m0755
'$(GIT)'-email
/usr
/lib
/git-core
258 install -m0755
'$(TMP)'/usr
/lib
/git-core
/git-send-email \
259 '$(GIT)'-email
/usr
/lib
/git-core
/
260 install -d
-m0755
'$(GIT)'-email
/usr
/share
/man
/man1
261 install -m0644
'$(TMP)'/usr
/share
/man
/man1
/git-send-email
.1 \
262 '$(GIT)'-email
/usr
/share
/man
/man1
/
263 gzip
-9 '$(GIT)'-email
/usr
/share
/man
/man1
/*.1
265 rm -rf
'$(GIT)'-daemon-run
266 install -d
-m0755
'$(GIT)'-daemon-run
/etc
/sv
/git-daemon
/log
267 install -m0755 debian
/git-daemon
/run \
268 '$(GIT)'-daemon-run
/etc
/sv
/git-daemon
/run
269 install -m0755 debian
/git-daemon
/log
/run \
270 '$(GIT)'-daemon-run
/etc
/sv
/git-daemon
/log
/run
271 # git-daemon-sysvinit
272 rm -rf
'$(GIT)'-daemon-sysvinit
273 install -d
-m0755
'$(GIT)'-daemon-sysvinit
/etc
/init.d
274 install -m0755 debian
/git-daemon.init \
275 '$(GIT)'-daemon-sysvinit
/etc
/init.d
/git-daemon
276 install -d
-m0755
'$(GIT)'-daemon-sysvinit
/etc
/default
277 install -m0644 debian
/git-daemon.default \
278 '$(GIT)'-daemon-sysvinit
/etc
/default
/git-daemon
279 install -d
-m0755
'$(GIT)'-daemon-sysvinit
/usr
/share
/git-core
/sysvinit
280 >'$(GIT)'-daemon-sysvinit
/usr
/share
/git-core
/sysvinit
/sentinel
282 '$(GIT)'-daemon-sysvinit
/usr
/share
/git-core
/sysvinit
/sentinel
285 install -m0644
-D debian
/git-el.emacsen-startup \
286 '$(GIT)'-el
/etc
/emacs
/site-start.d
/50git-core.el
287 install -m0755
-D debian
/git-el.emacsen-install \
288 '$(GIT)'-el
/usr
/lib
/emacsen-common
/packages
/install/git
289 install -m0755
-D debian
/git-el.emacsen-remove \
290 '$(GIT)'-el
/usr
/lib
/emacsen-common
/packages
/remove
/git
291 install -d
-m0755
'$(GIT)'-el
/usr
/share
/git-core
/emacs
292 install -m0644 contrib
/emacs
/git-blame.el \
293 '$(GIT)'-el
/usr
/share
/git-core
/emacs
/git-blame.el
294 install -m0644 contrib
/emacs
/git.el \
295 '$(GIT)'-el
/usr
/share
/git-core
/emacs
/git.el
296 install -d
-m0755
'$(GIT)'-el
/usr
/share
/doc
/git-el
297 ln
-s ..
/git
/README.emacs \
298 '$(GIT)'-el
/usr
/share
/doc
/git-el
/README.Debian
299 install -d
-m0755
'$(GIT)'-el
/usr
/share
/doc
/git
/contrib
300 ln
-s ..
/..
/..
/git-core
/emacs \
301 '$(GIT)'-el
/usr
/share
/doc
/git
/contrib
/emacs
304 install -d
-m0755
'$(GIT)'-gui
/usr
/lib
/git-core
305 install -m0755
'$(TMP)'/usr
/lib
/git-core
/git-gui \
306 '$(GIT)'-gui
/usr
/lib
/git-core
/
307 install -m0755
'$(TMP)'/usr
/lib
/git-core
/git-gui--askpass \
308 '$(GIT)'-gui
/usr
/lib
/git-core
/
309 install -m0755
'$(TMP)'/usr
/lib
/git-core
/git-citool \
310 '$(GIT)'-gui
/usr
/lib
/git-core
/
311 install -d
-m0755
'$(GIT)'-gui
/usr
/share
/man
/man1
312 for i in gui citool
; do \
313 install -m0644
'$(TMP)'/usr
/share
/man
/man1
/git-
$$i* \
314 '$(GIT)'-gui
/usr
/share
/man
/man1
/; \
316 gzip
-9 '$(GIT)'-gui
/usr
/share
/man
/man1
/*.1
317 install -d
-m0755
'$(GIT)'-gui
/usr
/share
/git-gui
318 cp
-a
'$(TMP)'/usr
/share
/git-gui
/lib
'$(GIT)'-gui
/usr
/share
/git-gui
/
321 install -d
-m0755
'$(GIT)'k
/usr
/bin
322 install -m0755
'$(TMP)'/usr
/bin
/gitk \
323 '$(GIT)'k
/usr
/bin
/gitk
324 install -d
-m0755
'$(GIT)'k
/usr
/share
/man
/man1
325 install -m0644
'$(TMP)'/usr
/share
/man
/man1
/gitk
.1 \
326 '$(GIT)'k
/usr
/share
/man
/man1
/
327 gzip
-9 '$(GIT)'k
/usr
/share
/man
/man1
/*.1
328 install -d
-m0755
'$(GIT)'k
/usr
/share
/gitk
329 cp
-a
'$(TMP)'/usr
/share
/gitk
/lib
'$(GIT)'k
/usr
/share
/gitk
/
332 install -d
-m0755
'$(GIT)'web
/usr
/lib
/cgi-bin
333 ln
-s ..
/..
/share
/gitweb
/gitweb.cgi \
334 '$(GIT)'web
/usr
/lib
/cgi-bin
/gitweb.cgi
335 install -d
-m0755
'$(GIT)'web
/etc
336 install -m0644 debian
/gitweb.conf
'$(GIT)'web
/etc
/gitweb.conf
337 install -d
-m0755
'$(GIT)'web
/etc
/apache2
/conf.d
338 install -m0644 debian
/gitweb.apache2.conf \
339 '$(GIT)'web
/etc
/apache2
/conf.d
/gitweb
342 install -d
-m0755
'$(GIT)'-all
345 install -d
-m0755
'$(GIT)'-core
/usr
/share
/doc
346 ln
-s git
'$(GIT)'-core
/usr
/share
/doc
/git-core
351 binary
: binary-arch binary-indep
352 binary-arch
: install-arch git.deb
353 rm -f debian
/substvars
354 dpkg-shlibdeps
'$(GIT)'/usr
/bin
/* '$(GIT)'/usr
/lib
/git-core
/*
355 dpkg-gencontrol
-isp
-pgit
-P
'$(GIT)'
357 binary-indep
: install-indep
$(patsubst %,%.deb
,$(PKG_INDEP
)) git-core.deb-DEBIAN
358 rm -f debian
/substvars
359 for i in
$(patsubst git
%,%,$(PKG_INDEP
)) -core
; do \
360 dpkg-gencontrol
-isp
-pgit
$$i -P
'$(GIT)'$$i && \
361 dpkg
-b
'$(GIT)'$$i .. || exit
1; \
365 .PHONY
: build build-arch build-indep
366 .PHONY
: install install-arch install-indep
367 .PHONY
: binary binary-arch binary-indep
369 # Git's build system supports parallelism (-j) but does not handle
370 # multiple concurrent "make" invocations.
373 include debian
/implicit