]> git.ipfire.org Git - thirdparty/git.git/blame - templates/Makefile
fast-import: introduce "feature notes" command
[thirdparty/git.git] / templates / Makefile
CommitLineData
d3af621b 1# make and install sample templates
8d5afef0 2
2314c947 3ifndef V
74f2b2a8
SP
4 QUIET = @
5endif
6
229a7ed7
JH
7INSTALL ?= install
8TAR ?= tar
4cb08df5 9RM ?= rm -f
229a7ed7 10prefix ?= $(HOME)
0b50b860 11template_instdir ?= $(prefix)/share/git-core/templates
a682ef9f 12# DESTDIR=
8d5afef0 13
3dff5379 14# Shell quote (do not use $(call) to accommodate ancient setups);
7ffe7098 15DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
0b50b860 16template_instdir_SQ = $(subst ','\'',$(template_instdir))
4769948a 17
8c512428 18all: boilerplates.made custom
d3af621b
JH
19
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.
8c512428
JH
23
24bpsrc = $(filter-out %~,$(wildcard *--*))
25boilerplates.made : $(bpsrc)
d8bdc492 26 $(QUIET)umask 022 && ls *--* 2>/dev/null | \
d3af621b
JH
27 while read boilerplate; \
28 do \
29 case "$$boilerplate" in *~) continue ;; esac && \
30 dst=`echo "$$boilerplate" | sed -e 's|^this|.|;s|--|/|g'` && \
31 dir=`expr "$$dst" : '\(.*\)/'` && \
d8bdc492 32 mkdir -p blt/$$dir && \
d3af621b 33 case "$$boilerplate" in \
d8bdc492
JH
34 *--) continue;; \
35 esac && \
36 cp $$boilerplate blt/$$dst && \
37 if test -x "blt/$$dst"; then rx=rx; else rx=r; fi && \
38 chmod a+$$rx "blt/$$dst" || exit; \
74f2b2a8 39 done && \
8c512428 40 date >$@
d3af621b
JH
41
42# If you need build-tailored templates, build them into blt/
43# directory yourself here.
44custom:
74f2b2a8 45 $(QUIET): no custom templates yet
d3af621b 46
8d5afef0 47clean:
4cb08df5 48 $(RM) -r blt boilerplates.made
8d5afef0 49
d3af621b 50install: all
0b50b860 51 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(template_instdir_SQ)'
229a7ed7 52 (cd blt && $(TAR) cf - .) | \
36e56106 53 (cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) xof -)