aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMartin Waitz <tali@admingilde.org>2006-08-01 21:34:08 +0200
committerJunio C Hamano <junkio@cox.net>2006-08-01 15:44:47 -0700
commit5d043a3d856bd40d8b34b8836a561e438d23573b (patch)
tree9f90ec3953e7b33066cb93359f21026a33f651f0 /Makefile
parent6326b60cfd9c953e64ddab9659587afeedccd95b (diff)
downloadgit-5d043a3d856bd40d8b34b8836a561e438d23573b.tar.gz
git-5d043a3d856bd40d8b34b8836a561e438d23573b.tar.xz
gitweb: fill in gitweb configuration by Makefile
Generate gitweb/gitweb.cgi to reduce the need to patch gitweb.cgi by the end user. The GIT installation directory is already known by the Makefile, and can be inserted directly into gitweb. All other gitweb configuration parameters can now be specified by providing GITWEB_* variables while building GIT. These are described in gitweb/README. Signed-off-by: Martin Waitz <tali@admingilde.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
1 files changed, 23 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 15864e23b..fb2b28868 100644
--- a/Makefile
+++ b/Makefile
@@ -116,6 +116,13 @@ template_dir = $(prefix)/share/git-core/templates/
GIT_PYTHON_DIR = $(prefix)/share/git-core/python
# DESTDIR=
+# default configuration for gitweb
+GITWEB_SITENAME =
+GITWEB_PROJECTROOT = /pub/git
+GITWEB_LIST =
+GITWEB_HOMETEXT = indextext.html
+GITWEB_CSS = gitweb.css
+
export prefix bindir gitexecdir template_dir GIT_PYTHON_DIR
CC = gcc
@@ -514,7 +521,7 @@ LIB_OBJS += $(COMPAT_OBJS)
export prefix TAR INSTALL DESTDIR SHELL_PATH template_dir
### Build rules
-all: $(ALL_PROGRAMS) $(BUILT_INS) git$X gitk
+all: $(ALL_PROGRAMS) $(BUILT_INS) git$X gitk gitweb/gitweb.cgi
all:
$(MAKE) -C templates
@@ -572,6 +579,20 @@ git-status: git-commit
cp $< $@+
mv $@+ $@
+gitweb/gitweb.cgi: gitweb/gitweb.perl
+ rm -f $@ $@+
+ sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \
+ -e 's|@@GIT_VERSION@@|$(GIT_VERSION)|g' \
+ -e 's|@@GIT_BINDIR@@|$(bindir)|g' \
+ -e 's|@@GITWEB_SITENAME@@|$(GITWEB_SITENAME)|g' \
+ -e 's|@@GITWEB_PROJECTROOT@@|$(GITWEB_PROJECTROOT)|g' \
+ -e 's|@@GITWEB_LIST@@|$(GITWEB_LIST)|g' \
+ -e 's|@@GITWEB_HOMETEXT@@|$(GITWEB_HOMETEXT)|g' \
+ -e 's|@@GITWEB_CSS@@|$(GITWEB_CSS)|g' \
+ $< >$@+
+ chmod +x $@+
+ mv $@+ $@
+
git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css
rm -f $@ $@+
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
@@ -582,7 +603,7 @@ git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css
-e '/@@GITWEB_CGI@@/d' \
-e '/@@GITWEB_CSS@@/r gitweb/gitweb.css' \
-e '/@@GITWEB_CSS@@/d' \
- $@.sh | sed "s|/usr/bin/git|$(bindir)/git|" > $@+
+ $@.sh > $@+
chmod +x $@+
mv $@+ $@