]> git.ipfire.org Git - thirdparty/git.git/blobdiff - Makefile
gitweb: require $ENV{'GITWEB_CONFIG'}
[thirdparty/git.git] / Makefile
index e9dce268f86cab1bbfe987acb041c3c05fcc72ea..a2b4acaaaecb223f9e08c0a3446957b89ba28d77 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -116,6 +116,15 @@ template_dir = $(prefix)/share/git-core/templates/
 GIT_PYTHON_DIR = $(prefix)/share/git-core/python
 # DESTDIR=
 
+# default configuration for gitweb
+GITWEB_CONFIG = gitweb_config.perl
+GITWEB_SITENAME =
+GITWEB_PROJECTROOT = /pub/git
+GITWEB_LIST =
+GITWEB_HOMETEXT = indextext.html
+GITWEB_CSS = gitweb.css
+GITWEB_LOGO = git-logo.png
+
 export prefix bindir gitexecdir template_dir GIT_PYTHON_DIR
 
 CC = gcc
@@ -265,6 +274,9 @@ LIBS = $(GITLIBS) -lz
 ifeq ($(uname_S),Linux)
        NO_STRLCPY = YesPlease
 endif
+ifeq ($(uname_S),GNU/kFreeBSD)
+       NO_STRLCPY = YesPlease
+endif
 ifeq ($(uname_S),Darwin)
        NEEDS_SSL_WITH_CRYPTO = YesPlease
        NEEDS_LIBICONV = YesPlease
@@ -511,7 +523,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
@@ -569,6 +581,22 @@ 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_CONFIG@@|$(GITWEB_CONFIG)|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' \
+           -e 's|@@GITWEB_LOGO@@|$(GITWEB_LOGO)|g' \
+           $< >$@+
+       chmod +x $@+
+       mv $@+ $@
+
 git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css
        rm -f $@ $@+
        sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
@@ -579,7 +607,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 $@+ $@
 
@@ -778,6 +806,7 @@ clean:
        rm -rf $(GIT_TARNAME) .doc-tmp-dir
        rm -f $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
        rm -f $(htmldocs).tar.gz $(manpages).tar.gz
+       rm -f gitweb/gitweb.cgi
        $(MAKE) -C Documentation/ clean
        $(MAKE) -C templates clean
        $(MAKE) -C t/ clean