Skip more symbolic link tests.
[git/mingw.git] / templates / Makefile
blobab2c823ae028f8c0a829982c8ee179b5721873f0
1 # make and install sample templates
3 ifndef V
4 QUIET = @
5 endif
7 INSTALL ?= install
8 TAR ?= tar
9 RM ?= rm -f
10 prefix ?= $(HOME)
11 template_instdir ?= $(prefix)/share/git-core/templates
12 # DESTDIR=
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; \
30 do \
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 \
36 *--) ;; \
37 hooks--*) cp -p $$boilerplate blt/$${dst}$(NOEXECTEMPL) ;; \
38 *) cp -p $$boilerplate blt/$$dst ;; \
39 esac || exit; \
40 done && \
41 date >$@
43 # If you need build-tailored templates, build them into blt/
44 # directory yourself here.
45 custom:
46 $(QUIET): no custom templates yet
48 clean:
49 $(RM) -r blt boilerplates.made
51 install: all
52 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(template_instdir_SQ)'
53 (cd blt && $(TAR) cf - .) | \
54 (cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) xf -)