summaryrefslogtreecommitdiffabout
authorLars Hjemli <hjemli@gmail.com>2007-05-11 18:41:14 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2007-05-11 18:41:14 (UTC)
commitf596d10d7391ed72b73019e037a7f7eec7a50d02 (patch) (unidiff)
tree5ff2b0949adfa588363e01c0455f52f536a50135
parentdad80d1ff8e065002cdf4e37252164a7f8517a5b (diff)
downloadcgit-f596d10d7391ed72b73019e037a7f7eec7a50d02.zip
cgit-f596d10d7391ed72b73019e037a7f7eec7a50d02.tar.gz
cgit-f596d10d7391ed72b73019e037a7f7eec7a50d02.tar.bz2
Makefile: add support for building w.o. preinstalled git
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--Makefile14
1 files changed, 13 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 86b2a70..ccc7582 100644
--- a/Makefile
+++ b/Makefile
@@ -18,8 +18,20 @@ endif
18 18
19CFLAGS += -Igit -DSHA1_HEADER='$(SHA1_HEADER)' 19CFLAGS += -Igit -DSHA1_HEADER='$(SHA1_HEADER)'
20 20
21 21
22#
23# If make is run on a nongit platform, we need to get the git sources as a tarball.
24# But there is currently no recent enough tarball available on kernel.org, so download
25# a zipfile from hjemli.net instead
26#
27GITVER = $(shell git version 2>/dev/null || echo nogit)
28ifeq ($(GITVER),nogit)
29GITURL = http://hjemli.net/git/git/snapshot/?id=v1.5.2-rc2
30INITGIT = test -e git/git.c || (curl "$(GITURL)" > tmp.zip && unzip tmp.zip)
31else
32INITGIT = ./submodules.sh -i
33endif
22 34
23 35
24# 36#
25# basic build rules 37# basic build rules
@@ -32,9 +44,9 @@ cgit: cgit.c cgit.h $(OBJECTS)
32 44
33$(OBJECTS): cgit.h git/libgit.a 45$(OBJECTS): cgit.h git/libgit.a
34 46
35git/libgit.a: 47git/libgit.a:
36 ./submodules.sh -i 48 $(INITGIT)
37 $(MAKE) -C git 49 $(MAKE) -C git
38 50
39# 51#
40# phony targets 52# phony targets