Merge http://www.kernel.org/pub/scm/gitk/gitk
[git.git] / templates / Makefile
1 # make and install sample templates
2
3 INSTALL ?= install
4 TAR ?= tar
5 prefix ?= $(HOME)
6 template_dir ?= $(prefix)/share/git-core/templates/
7 # DESTDIR=
8
9 all: boilerplates custom
10         find blt
11
12 # Put templates that can be copied straight from the source
13 # in a file direc--tory--file in the source.  They will be
14 # just copied to the destination.
15 boilerplates:
16         ls *--* 2>/dev/null | \
17         while read boilerplate; \
18         do \
19                 case "$$boilerplate" in *~) continue ;; esac && \
20                 dst=`echo "$$boilerplate" | sed -e 's|^this|.|;s|--|/|g'` && \
21                 dir=`expr "$$dst" : '\(.*\)/'` && \
22                 mkdir -p blt/$$dir && \
23                 case "$$boilerplate" in \
24                 *--) ;; \
25                 *) cp $$boilerplate blt/$$dst ;; \
26                 esac || exit; \
27         done || exit
28
29 # If you need build-tailored templates, build them into blt/
30 # directory yourself here.
31 custom:
32         : no custom templates yet
33
34 clean:
35         rm -rf blt
36
37 install: all
38         $(INSTALL) -d -m755 $(DESTDIR)$(template_dir)
39         (cd blt && $(TAR) cf - .) | \
40         (cd $(DESTDIR)$(template_dir) && $(TAR) xf -)