2d24274af9ae26b2346b7fbffe1b18281938b1b8
[userv-utils] / git-daemon / Makefile
1 # Makefile for userv-git-daemon
2 #
3 # This was written by Tony Finch <dot@dotat.at> and subsequently
4 # heavily modified by Ian Jackson <ijackson@chiark.greenend.org.uk>
5 # You may do anything with it, at your own risk.
6 # http://creativecommons.org/publicdomain/zero/1.0/
7
8 include ../settings.make
9
10 TARGETS= git-upload-pack inetd.conf git-daemon git-service
11
12 SUBSTVARS= libuserv etcuserv
13
14 all: $(TARGETS)
15
16 sedscript: Makefile
17 echo >$@.new '$(foreach f, $(SUBSTVARS), s,@$f@,$($f),g; )'
18 echo >>$@.new '/@@READ_URLMAP@@/c\'
19 perl >>$@.new -pe 's/$$/\\/' <read-urlmap
20 mv -f $@.new $@
21
22 %: %.in sedscript
23 set -e; \
24 sed -f sedscript <$< >$@.new; \
25 if test -x $<; then chmod +x $@.new; fi; \
26 mv -f $@.new $@
27
28 install: all
29 mkdir -p $(libuserv) $(etcuserv) $(services)
30 cp git-daemon git-service $(libuserv)
31 cp git-upload-pack $(services)
32 cp git-urlmap $(etcuserv)
33
34 clean:
35 rm -f $(TARGETS)
36
37 # end