1 # make and install sample templates
11 template_dir ?= $(prefix)/share/git-core/templates
14 # Shell quote (do not use $(call) to accommodate ancient setups);
15 DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
16 template_dir_SQ = $(subst ','\'',$(template_dir))
18 all: boilerplates.made custom
20 # Put templates that can be copied straight from the source
21 # in a file direc--tory--file in the source. They will be
22 # just copied to the destination.
24 bpsrc = $(filter-out %~,$(wildcard *--*))
25 boilerplates.made : $(bpsrc)
26 $(QUIET)ls *--* 2>/dev/null | \
27 while read boilerplate; \
29 case "$$boilerplate" in *~) continue ;; esac && \
30 dst=`echo "$$boilerplate" | sed -e 's|^this|.|;s|--|/|g'` && \
31 dir=`expr "$$dst" : '\(.*\)/'` && \
32 mkdir -p blt/$$dir && \
33 case "$$boilerplate" in \
35 *) cp $$boilerplate blt/$$dst ;; \
40 # If you need build-tailored templates, build them into blt/
41 # directory yourself here.
43 $(QUIET): no custom templates yet
46 $(RM) -r blt boilerplates.made
49 $(INSTALL) -d -m755 '$(DESTDIR_SQ)$(template_dir_SQ)'
50 (cd blt && $(TAR) cf - .) | \
51 (cd '$(DESTDIR_SQ)$(template_dir_SQ)' && $(TAR) xf -)