1# make and install sample templates
2
3INSTALL ?= install
4TAR ?= tar
5prefix ?= $(HOME)
6template_dir ?= $(prefix)/share/git-core/templates/
7# DESTDIR=
8
9all: 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.
15boilerplates:
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.
31custom:
32 : no custom templates yet
33
34clean:
35 rm -rf blt
36
37install: all
38 $(INSTALL) -d -m755 $(DESTDIR)$(template_dir)
39 (cd blt && $(TAR) cf - .) | \
40 (cd $(DESTDIR)$(template_dir) && $(TAR) xf -)