1 # make and install sample templates
11 template_instdir ?
= $(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_instdir_SQ = $(subst ','\'',$(template_instdir
))
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 $(INSTALL
) -d
-m
755 blt
/$$dir && \
35 case
"$$boilerplate" in \
37 hooks--
*) cp
-p
$$boilerplate blt
/$${dst}$(NOEXECTEMPL
) ;; \
38 *) cp
-p
$$boilerplate blt
/$$dst ;; \
43 # If you need build-tailored templates, build them into blt/
44 # directory yourself here.
46 $(QUIET
): no custom templates yet
49 $(RM
) -r blt boilerplates.made
52 $(INSTALL
) -d
-m
755 '$(DESTDIR_SQ)$(template_instdir_SQ)'
53 (cd blt
&& $(TAR
) cf
- .
) | \
54 (cd
'$(DESTDIR_SQ)$(template_instdir_SQ)' && umask
022 && $(TAR
) xf
-)