1 # make and install sample templates
11 template_dir
= $(prefix)/share
/git-core
/templates
13 # set NOEXECTEMPL to non-empty to change the names of hook scripts
14 # so that the tools will not find them
16 # Shell quote (do not use $(call) to accommodate ancient setups);
17 DESTDIR_SQ
= $(subst ','\'',$(DESTDIR))
18 template_dir_SQ = $(subst ','\'',$(template_dir
))
20 all: boilerplates.made custom
22 # Put templates that can be copied straight from the source
23 # in a file direc--tory--file in the source. They will be
24 # just copied to the destination.
26 bpsrc
= $(filter-out %~
,$(wildcard *--*))
27 boilerplates.made
: $(bpsrc
)
28 $(QUIET
)ls
*--* 2>/dev
/null | \
29 while read boilerplate
; \
31 case
"$$boilerplate" in
*~
) continue
;; esac
&& \
32 dst
=`echo "$$boilerplate" | sed -e 's|^this|.|;s|--|/|g'` && \
33 dir=`expr "$$dst" : '\(.*\)/'` && \
34 mkdir
-p blt
/$$dir && \
35 case
"$$boilerplate" in \
37 *) if head
-1 $$boilerplate | grep
-q
'^#!/'; then \
38 cp
$$boilerplate blt
/$${dst}$(NOEXECTEMPL
); \
40 cp
$$boilerplate blt
/$$dst; \
46 # If you need build-tailored templates, build them into blt/
47 # directory yourself here.
49 $(QUIET
): no custom templates yet
52 $(RM
) -r blt boilerplates.made
55 $(INSTALL
) -d
-m755
'$(DESTDIR_SQ)$(template_dir_SQ)'
56 (cd blt
&& $(TAR
) cf
- .
) | \
57 (cd
'$(DESTDIR_SQ)$(template_dir_SQ)' && $(TAR
) xf
-)