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