summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLars Hjemli <hjemli@gmail.com>2007-02-04 23:57:34 +0100
committerLars Hjemli <hjemli@gmail.com>2007-02-05 00:12:04 +0100
commitc52e84135e6272d008f69a9ac00265875ff4e60e (patch)
tree74cb0a76ea7b69f152766cb5510c6f60a7caf2a1 /Makefile
parent74b0db95560e4c11439d7e0e8016d1e8cd48cdda (diff)
downloadcgit-c52e84135e6272d008f69a9ac00265875ff4e60e.tar.gz
cgit-c52e84135e6272d008f69a9ac00265875ff4e60e.tar.bz2
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 '')
-rw-r--r--Makefile18
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 @@
CGIT_VERSION = 0.1
-INSTALL_DIR = /var/www/htdocs/cgit
-CACHE_ROOT = /var/cache/cgit
+prefix = /var/www/htdocs/cgit
+gitsrc = ../git
-EXTLIBS = ../git/libgit.a ../git/xdiff/lib.a -lz -lcrypto
+CACHE_ROOT = /var/cache/cgit
+EXTLIBS = $(gitsrc)/libgit.a $(gitsrc)/xdiff/lib.a -lz -lcrypto
OBJECTS = shared.o cache.o parsing.o html.o ui-shared.o ui-repolist.o \
ui-summary.o ui-log.o ui-view.c ui-tree.c ui-commit.c ui-diff.o
@@ -16,10 +17,11 @@ endif
all: cgit
install: all clean-cache
- install cgit $(INSTALL_DIR)/cgit.cgi
- install cgit.css $(INSTALL_DIR)/cgit.css
+ mkdir -p $(prefix)
+ install cgit $(prefix)/cgit.cgi
+ install cgit.css $(prefix)/cgit.css
-cgit: cgit.c cgit.h git.h $(OBJECTS)
+cgit: cgit.c cgit.h git.h $(OBJECTS) $(gitsrc)/libgit.a
$(CC) $(CFLAGS) -DCGIT_VERSION='"$(CGIT_VERSION)"' cgit.c -o cgit \
$(OBJECTS) $(EXTLIBS)
@@ -27,6 +29,10 @@ $(OBJECTS): cgit.h git.h
ui-diff.o: xdiff.h
+$(gitsrc)/libgit.a:
+ $(MAKE) -C $(gitsrc)
+
+
.PHONY: clean
clean:
rm -f cgit *.o
etions'>-1/+0 2007-04-18finished Qt-Frontendnecoro5-15/+117 2007-04-17marking installed packages in pkglistnecoro5-14/+50 2007-04-16added ebuild window for Qt-Frontendnecoro4-2/+229 2007-04-16added preferences for Qt-Frontendnecoro9-279/+710 2007-04-13Improved masking display and made most of the Qt-Frontend worknecoro7-35/+334 2007-04-10Some more functionality for the Qt-Frontend (complete emerge)necoro8-217/+347 2007-04-07Some more functionality for the Qt-Frontendnecoro11-88/+463 2007-04-07Added Qt-Terminalnecoro4-4/+213 2007-04-06First qt draftnecoro6-1/+796 2007-04-04showed masked packages unmasked by the user similar to stable marked testing ...necoro5-13/+40 2007-03-31changed changelognecoro1-1/+2 2007-03-31Some small changes for etcproposals 1.1necoro1-2/+2 2007-03-31Some small changes for etcproposals 1.1necoro2-3/+3 2007-03-31Some small changes for etcproposals 1.1necoro1-6/+13 2007-03-31Allowed Plugins to have a menunecoro7-201/+315 2007-03-15Added etc-proposals pluginnecoro7-28/+121 2007-03-10Added USE_EXPAND-supportnecoro5-11/+63 2007-03-10Added plugin-data to about-dialognecoro3-197/+264