1 # make and install sample templates
6 template_dir ?
= $(prefix)/share
/git-core
/templates
/
9 all: boilerplates.made custom
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.
16 bpsrc
= $(filter-out %~
,$(wildcard *--*))
17 boilerplates.made
: $(bpsrc
)
18 ls
*--* 2>/dev
/null | \
19 while read boilerplate
; \
21 case
"$$boilerplate" in
*~
) continue
;; esac
&& \
22 dst
=`echo "$$boilerplate" | sed -e 's|^this|.|;s|--|/|g'` && \
23 dir=`expr "$$dst" : '\(.*\)/'` && \
24 mkdir
-p blt
/$$dir && \
25 case
"$$boilerplate" in \
27 *) cp
$$boilerplate blt
/$$dst ;; \
32 # If you need build-tailored templates, build them into blt/
33 # directory yourself here.
35 : no custom templates yet
38 rm -rf blt boilerplates.made
41 $(INSTALL
) -d
-m755
$(DESTDIR
)$(template_dir
)
42 (cd blt
&& $(TAR
) cf
- .
) | \
43 (cd
$(DESTDIR
)$(template_dir
) && $(TAR
) xf
-)