2005-08-06 23:50:14 +04:00
|
|
|
# make and install sample templates
|
2005-08-03 03:45:21 +04:00
|
|
|
|
2005-09-23 21:41:40 +04:00
|
|
|
INSTALL ?= install
|
|
|
|
TAR ?= tar
|
|
|
|
prefix ?= $(HOME)
|
|
|
|
template_dir ?= $(prefix)/share/git-core/templates/
|
2005-08-05 03:56:38 +04:00
|
|
|
# DESTDIR=
|
2005-08-03 03:45:21 +04:00
|
|
|
|
2006-07-29 20:25:03 +04:00
|
|
|
# Shell quote (do not use $(call) to accomodate ancient setups);
|
|
|
|
DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
|
|
|
|
template_dir_SQ = $(subst ','\'',$(template_dir))
|
2005-10-11 00:50:01 +04:00
|
|
|
|
2005-10-09 05:01:24 +04:00
|
|
|
all: boilerplates.made custom
|
2005-08-06 23:50:14 +04:00
|
|
|
|
|
|
|
# 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.
|
2005-10-09 05:01:24 +04:00
|
|
|
|
|
|
|
bpsrc = $(filter-out %~,$(wildcard *--*))
|
|
|
|
boilerplates.made : $(bpsrc)
|
2005-08-06 23:50:14 +04:00
|
|
|
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
|
2005-10-09 05:01:24 +04:00
|
|
|
date >$@
|
2005-08-06 23:50:14 +04:00
|
|
|
|
|
|
|
# If you need build-tailored templates, build them into blt/
|
|
|
|
# directory yourself here.
|
|
|
|
custom:
|
|
|
|
: no custom templates yet
|
|
|
|
|
2005-08-03 03:45:21 +04:00
|
|
|
clean:
|
2005-10-09 05:01:24 +04:00
|
|
|
rm -rf blt boilerplates.made
|
2005-08-03 03:45:21 +04:00
|
|
|
|
2005-08-06 23:50:14 +04:00
|
|
|
install: all
|
2006-07-29 20:25:03 +04:00
|
|
|
$(INSTALL) -d -m755 '$(DESTDIR_SQ)$(template_dir_SQ)'
|
2005-09-23 21:41:40 +04:00
|
|
|
(cd blt && $(TAR) cf - .) | \
|
2006-07-29 20:25:03 +04:00
|
|
|
(cd '$(DESTDIR_SQ)$(template_dir_SQ)' && $(TAR) xf -)
|