author | Lars Hjemli <hjemli@gmail.com> | 2007-05-10 09:25:12 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2007-05-11 09:03:52 (UTC) |
commit | cc1dbd1b5d610bd5e626f54d310f11cf47684ea1 (patch) (unidiff) | |
tree | ceede74f95d643b085232aa66a7d69d04e255208 /Makefile | |
parent | e743443811f5816f02a9ca67404613be97bfa615 (diff) | |
download | cgit-cc1dbd1b5d610bd5e626f54d310f11cf47684ea1.zip cgit-cc1dbd1b5d610bd5e626f54d310f11cf47684ea1.tar.gz cgit-cc1dbd1b5d610bd5e626f54d310f11cf47684ea1.tar.bz2 |
Add submodules.sh and use it during builds
This adds a shell script which can be be used to initialize, list and
update submodules in a git repository. It reads the file .gitmodules
to find a mapping between submodule path and repository url for the
initial clone of all submodules.
The script is used during cgit builds to enable automatic download and
checkout of the git git repository.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | Makefile | 49 |
1 files changed, 36 insertions, 13 deletions
@@ -1,44 +1,67 @@ | |||
1 | CGIT_VERSION = 0.2 | 1 | CGIT_VERSION = 0.2 |
2 | 2 | ||
3 | prefix = /var/www/htdocs/cgit | 3 | prefix = /var/www/htdocs/cgit |
4 | gitsrc = git | ||
5 | 4 | ||
6 | SHA1_HEADER = <openssl/sha.h> | 5 | SHA1_HEADER = <openssl/sha.h> |
7 | 6 | ||
8 | CACHE_ROOT = /var/cache/cgit | 7 | CACHE_ROOT = /var/cache/cgit |
9 | EXTLIBS = $(gitsrc)/libgit.a $(gitsrc)/xdiff/lib.a -lz -lcrypto | 8 | EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lcrypto |
10 | OBJECTS = shared.o cache.o parsing.o html.o ui-shared.o ui-repolist.o \ | 9 | OBJECTS = shared.o cache.o parsing.o html.o ui-shared.o ui-repolist.o \ |
11 | ui-summary.o ui-log.o ui-view.o ui-tree.o ui-commit.o ui-diff.o \ | 10 | ui-summary.o ui-log.o ui-view.o ui-tree.o ui-commit.o ui-diff.o \ |
12 | ui-snapshot.o ui-blob.o | 11 | ui-snapshot.o ui-blob.o |
13 | 12 | ||
14 | CFLAGS += -Wall | 13 | CFLAGS += -Wall |
15 | 14 | ||
16 | ifdef DEBUG | 15 | ifdef DEBUG |
17 | CFLAGS += -g | 16 | CFLAGS += -g |
18 | endif | 17 | endif |
19 | 18 | ||
20 | CFLAGS += -I$(gitsrc) -DSHA1_HEADER='$(SHA1_HEADER)' | 19 | CFLAGS += -Igit -DSHA1_HEADER='$(SHA1_HEADER)' |
21 | 20 | ||
21 | |||
22 | |||
23 | |||
24 | # | ||
25 | # basic build rules | ||
26 | # | ||
22 | all: cgit | 27 | all: cgit |
23 | 28 | ||
29 | cgit: cgit.c cgit.h $(OBJECTS) | ||
30 | $(CC) $(CFLAGS) -DCGIT_VERSION='"$(CGIT_VERSION)"' cgit.c -o cgit \ | ||
31 | $(OBJECTS) $(EXTLIBS) | ||
32 | |||
33 | $(OBJECTS): cgit.h git/libgit.a | ||
34 | |||
35 | git/libgit.a: | ||
36 | ./submodules.sh -i | ||
37 | $(MAKE) -C git | ||
38 | |||
39 | # | ||
40 | # phony targets | ||
41 | # | ||
24 | install: all clean-cache | 42 | install: all clean-cache |
25 | mkdir -p $(prefix) | 43 | mkdir -p $(prefix) |
26 | install cgit $(prefix)/cgit.cgi | 44 | install cgit $(prefix)/cgit.cgi |
27 | install cgit.css $(prefix)/cgit.css | 45 | install cgit.css $(prefix)/cgit.css |
28 | 46 | ||
29 | cgit: cgit.c cgit.h $(OBJECTS) $(gitsrc)/libgit.a | 47 | clean-cgit: |
30 | $(CC) $(CFLAGS) -DCGIT_VERSION='"$(CGIT_VERSION)"' cgit.c -o cgit \ | 48 | rm -f cgit *.o |
31 | $(OBJECTS) $(EXTLIBS) | ||
32 | |||
33 | $(OBJECTS): cgit.h | ||
34 | 49 | ||
35 | $(gitsrc)/libgit.a: | 50 | distclean-cgit: clean-cgit |
36 | $(MAKE) -C $(gitsrc) | 51 | git clean -d -x |
37 | 52 | ||
53 | clean-sub: | ||
54 | $(MAKE) -C git clean | ||
38 | 55 | ||
39 | .PHONY: clean | 56 | distclean-sub: clean-sub |
40 | clean: | 57 | $(shell cd git && git clean -d -x) |
41 | rm -f cgit *.o | ||
42 | 58 | ||
43 | clean-cache: | 59 | clean-cache: |
44 | rm -rf $(CACHE_ROOT)/* | 60 | rm -rf $(CACHE_ROOT)/* |
61 | |||
62 | clean: clean-cgit clean-sub | ||
63 | |||
64 | distclean: distclean-cgit distclean-sub | ||
65 | |||
66 | .PHONY: all install clean clean-cgit clean-sub clean-cache \ | ||
67 | distclean distclean-cgit distclean-sub | ||