When installing, be prepared that template_dir may be relative.
[gitweb.git] / Makefile
index 723316074375bb04fffc1389333d7bbab549c564..a2a19a85f0188855aca5dbc09b67dc4d8fa399f5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -205,7 +205,7 @@ GITWEB_FAVICON = git-favicon.png
 GITWEB_SITE_HEADER =
 GITWEB_SITE_FOOTER =
 
-export prefix bindir gitexecdir sharedir template_dir htmldir sysconfdir
+export prefix bindir gitexecdir sharedir htmldir sysconfdir
 
 CC = gcc
 AR = ar
@@ -1297,6 +1297,13 @@ remove-dashes:
 
 ### Installation rules
 
+ifeq ($(firstword $(subst /, ,$(template_dir))),..)
+template_instdir = $(gitexecdir)/$(template_dir)
+else
+template_instdir = $(template_dir)
+endif
+export template_instdir
+
 install: all
        $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
        $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexecdir_SQ)'