blob: 5924f08143a2673ae8402881bfe3fd0eab7dac2f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
prefix=/usr/local
libreconfdir = /etc/libretools.d
# in a bind, thes can all be set to the same directory
pbs-bindir = $(prefix)/lib/pbs-core
git-bindir = $(prefix)/lib/git-core
bindir = $(prefix)/bin
pbs-progs := $(shell printf '%s\n' pbs-* | fgrep -v .)
git-progs := $(shell printf '%s\n' git-* | fgrep -v .)
bin-progs = pbs
libreconf := $(wildcard pbs-*.conf)
install-targets := \
$(addprefix $(DESTDIR)$(pbs-bindir)/,$(pbs-progs)) \
$(addprefix $(DESTDIR)$(git-bindir)/,$(git-progs)) \
$(addprefix $(DESTDIR)$(bindir)/,$(bin-progs)) \
$(addprefix $(DESTDIR)$(libreconfdir)/,$(libreconf))
# phony rules
all: PHONY $(pbs-progs) $(git-progs) $(bin-progs) $(libreconf)
clean: PHONY
rm -f pbs
install: PHONY $(install-targets)
uninstall: PHONY
rm -f -- $(install-targets)
# actual file rules
pbs: pbs.in
sed 's|@pbs-bindir@|$(pbs-bindir)|g' < $< > $@
chmod 755 $@
$(DESTDIR)$(pbs-bindir)/%: % | $(DESTDIR)$(pbs-bindir)
cp '$*' '${@D}'
$(DESTDIR)$(git-bindir)/%: % | $(DESTDIR)$(git-bindir)
cp '$*' '${@D}'
$(DESTDIR)$(bindir)/%: % | $(DESTDIR)$(bindir)
cp '$*' '${@D}'
$(DESTDIR)$(libreconfdir)/%: % | $(DESTDIR)$(libreconfdir)
install -m644 '$*' '${@D}'
$(addprefix $(DESTDIR),$(pbs-bindir) $(git-bindir) $(bindir) $(libreconfdir)):
install -d '$@'
# tricks
.PHONY: PHONY
|