diff options
author | Lars Hjemli | 2007-02-04 23:57:34 +0100 |
---|---|---|
committer | Lars Hjemli | 2007-02-05 00:12:04 +0100 |
commit | c52e84135e6272d008f69a9ac00265875ff4e60e (patch) | |
tree | 74cb0a76ea7b69f152766cb5510c6f60a7caf2a1 /Makefile | |
parent | Update cgitrc template (diff) | |
download | cgit-c52e84135e6272d008f69a9ac00265875ff4e60e.tar.gz cgit-c52e84135e6272d008f69a9ac00265875ff4e60e.zip |
Add support for prefix and gitsrc arguments to 'make'
This should improve the installation a little, especially since the new options are mentioned in the README. Also, add a make-rule to build the git binaries if necessary + a dependency between cgit and libgit.a. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/Makefile b/Makefile index 72a1cff..e863205 100644 --- a/Makefile +++ b/Makefile | |||
@@ -1,9 +1,10 @@ | |||
1 | CGIT_VERSION = 0.1 | 1 | CGIT_VERSION = 0.1 |
2 | 2 | ||
3 | INSTALL_DIR = /var/www/htdocs/cgit | 3 | prefix = /var/www/htdocs/cgit |
4 | CACHE_ROOT = /var/cache/cgit | 4 | gitsrc = ../git |
5 | 5 | ||
6 | EXTLIBS = ../git/libgit.a ../git/xdiff/lib.a -lz -lcrypto | 6 | CACHE_ROOT = /var/cache/cgit |
7 | EXTLIBS = $(gitsrc)/libgit.a $(gitsrc)/xdiff/lib.a -lz -lcrypto | ||
7 | OBJECTS = shared.o cache.o parsing.o html.o ui-shared.o ui-repolist.o \ | 8 | OBJECTS = shared.o cache.o parsing.o html.o ui-shared.o ui-repolist.o \ |
8 | ui-summary.o ui-log.o ui-view.c ui-tree.c ui-commit.c ui-diff.o | 9 | ui-summary.o ui-log.o ui-view.c ui-tree.c ui-commit.c ui-diff.o |
9 | 10 | ||
@@ -16,10 +17,11 @@ endif | |||
16 | all: cgit | 17 | all: cgit |
17 | 18 | ||
18 | install: all clean-cache | 19 | install: all clean-cache |
19 | install cgit $(INSTALL_DIR)/cgit.cgi | 20 | mkdir -p $(prefix) |
20 | install cgit.css $(INSTALL_DIR)/cgit.css | 21 | install cgit $(prefix)/cgit.cgi |
22 | install cgit.css $(prefix)/cgit.css | ||
21 | 23 | ||
22 | cgit: cgit.c cgit.h git.h $(OBJECTS) | 24 | cgit: cgit.c cgit.h git.h $(OBJECTS) $(gitsrc)/libgit.a |
23 | $(CC) $(CFLAGS) -DCGIT_VERSION='"$(CGIT_VERSION)"' cgit.c -o cgit \ | 25 | $(CC) $(CFLAGS) -DCGIT_VERSION='"$(CGIT_VERSION)"' cgit.c -o cgit \ |
24 | $(OBJECTS) $(EXTLIBS) | 26 | $(OBJECTS) $(EXTLIBS) |
25 | 27 | ||
@@ -27,6 +29,10 @@ $(OBJECTS): cgit.h git.h | |||
27 | 29 | ||
28 | ui-diff.o: xdiff.h | 30 | ui-diff.o: xdiff.h |
29 | 31 | ||
32 | $(gitsrc)/libgit.a: | ||
33 | $(MAKE) -C $(gitsrc) | ||
34 | |||
35 | |||
30 | .PHONY: clean | 36 | .PHONY: clean |
31 | clean: | 37 | clean: |
32 | rm -f cgit *.o | 38 | rm -f cgit *.o |