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 *) if
test -n
"$$(sed -ne '/^#!\//p' -e '1q' < "$$boilerplate")"; then \
38 cp
-p
"$$boilerplate" "blt/$${dst}$(NOEXECTEMPL)"; \
40 cp
-p
"$$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
-m
755 '$(DESTDIR_SQ)$(template_instdir_SQ)'
56 (cd blt
&& $(TAR
) cf
- .
) | \
57 (cd
'$(DESTDIR_SQ)$(template_instdir_SQ)' && umask
022 && $(TAR
) xf
-)