2005-08-06 19:50:14 +00:00
|
|
|
# make and install sample templates
|
2005-08-02 23:45:21 +00:00
|
|
|
|
2005-09-23 17:41:40 +00:00
|
|
|
INSTALL ?= install
|
|
|
|
TAR ?= tar
|
|
|
|
prefix ?= $(HOME)
|
|
|
|
template_dir ?= $(prefix)/share/git-core/templates/
|
2005-08-04 23:56:38 +00:00
|
|
|
# DESTDIR=
|
2005-08-02 23:45:21 +00:00
|
|
|
|
2005-08-06 19:50:14 +00:00
|
|
|
all: boilerplates custom
|
|
|
|
find blt
|
|
|
|
|
|
|
|
# Put templates that can be copied straight from the source
|
|
|
|
# in a file direc--tory--file in the source. They will be
|
|
|
|
# just copied to the destination.
|
|
|
|
boilerplates:
|
|
|
|
ls *--* 2>/dev/null | \
|
|
|
|
while read boilerplate; \
|
|
|
|
do \
|
|
|
|
case "$$boilerplate" in *~) continue ;; esac && \
|
|
|
|
dst=`echo "$$boilerplate" | sed -e 's|^this|.|;s|--|/|g'` && \
|
|
|
|
dir=`expr "$$dst" : '\(.*\)/'` && \
|
|
|
|
mkdir -p blt/$$dir && \
|
|
|
|
case "$$boilerplate" in \
|
|
|
|
*--) ;; \
|
|
|
|
*) cp $$boilerplate blt/$$dst ;; \
|
|
|
|
esac || exit; \
|
|
|
|
done || exit
|
|
|
|
|
|
|
|
# If you need build-tailored templates, build them into blt/
|
|
|
|
# directory yourself here.
|
|
|
|
custom:
|
|
|
|
: no custom templates yet
|
|
|
|
|
2005-08-02 23:45:21 +00:00
|
|
|
clean:
|
2005-08-06 19:50:14 +00:00
|
|
|
rm -rf blt
|
2005-08-02 23:45:21 +00:00
|
|
|
|
2005-08-06 19:50:14 +00:00
|
|
|
install: all
|
2005-08-04 23:56:38 +00:00
|
|
|
$(INSTALL) -d -m755 $(DESTDIR)$(template_dir)
|
2005-09-23 17:41:40 +00:00
|
|
|
(cd blt && $(TAR) cf - .) | \
|
|
|
|
(cd $(DESTDIR)$(template_dir) && $(TAR) xf -)
|