]> git.ipfire.org Git - thirdparty/git.git/blame - templates/Makefile
Fix installation of templates on ancient systems.
[thirdparty/git.git] / templates / Makefile
CommitLineData
d3af621b 1# make and install sample templates
8d5afef0 2
229a7ed7
JH
3INSTALL ?= install
4TAR ?= tar
5prefix ?= $(HOME)
6template_dir ?= $(prefix)/share/git-core/templates/
a682ef9f 7# DESTDIR=
8d5afef0 8
7ffe7098
RJ
9# Shell quote (do not use $(call) to accomodate ancient setups);
10DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
11template_dir_SQ = $(subst ','\'',$(template_dir))
4769948a 12
8c512428 13all: boilerplates.made custom
d3af621b
JH
14
15# Put templates that can be copied straight from the source
16# in a file direc--tory--file in the source. They will be
17# just copied to the destination.
8c512428
JH
18
19bpsrc = $(filter-out %~,$(wildcard *--*))
20boilerplates.made : $(bpsrc)
d3af621b
JH
21 ls *--* 2>/dev/null | \
22 while read boilerplate; \
23 do \
24 case "$$boilerplate" in *~) continue ;; esac && \
25 dst=`echo "$$boilerplate" | sed -e 's|^this|.|;s|--|/|g'` && \
26 dir=`expr "$$dst" : '\(.*\)/'` && \
27 mkdir -p blt/$$dir && \
28 case "$$boilerplate" in \
29 *--) ;; \
30 *) cp $$boilerplate blt/$$dst ;; \
31 esac || exit; \
32 done || exit
8c512428 33 date >$@
d3af621b
JH
34
35# If you need build-tailored templates, build them into blt/
36# directory yourself here.
37custom:
38 : no custom templates yet
39
8d5afef0 40clean:
8c512428 41 rm -rf blt boilerplates.made
8d5afef0 42
d3af621b 43install: all
7ffe7098 44 $(INSTALL) -d -m755 '$(DESTDIR_SQ)$(template_dir_SQ)'
229a7ed7 45 (cd blt && $(TAR) cf - .) | \
7ffe7098 46 (cd '$(DESTDIR_SQ)$(template_dir_SQ)' && $(TAR) xf -)