-
Notifications
You must be signed in to change notification settings - Fork 0
/
GNUmakefile
83 lines (54 loc) · 1.64 KB
/
GNUmakefile
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
.DEFAULT_GOAL := build
CXX ?= c++
CRAMOPTS ?= --shell=/usr/bin/zsh
CRAM_ROOT ?= cram
CRAM_PATH ?= $(CRAM_ROOT)
PREFIX ?= /usr/local
LIBDIR ?= $(DESTDIR)$(PREFIX)/lib
BINDIR ?= $(DESTDIR)$(PREFIX)/bin
MANDIR ?= $(DESTDIR)$(PREFIX)/man/man1
BROOTDIR = _build
BLIBDIR = $(BROOTDIR)/lib
BBINDIR = $(BROOTDIR)/bin
BMANDIR = $(BROOTDIR)/man/man1
DIRS = $(BLIBDIR) $(BBINDIR)
CMDS = $(patsubst src/soapcli/%.zsh,%,$(wildcard src/soapcli/*))
MANS = $(patsubst Documentation/%.rst,%.1,$(wildcard Documentation/soapcli*))
BUILD_DEPS =
BUILD_DEPS += $(BMANDIR)
BUILD_DEPS += $(BBINDIR)/soapcli
BUILD_DEPS += $(addprefix $(BBINDIR)/soapcli-,$(CMDS))
BUILD_DEPS += $(addprefix $(BMANDIR)/,$(MANS))
INSTALL_DEPS += $(MANDIR)
INSTALL_DEPS += $(BINDIR)/soapcli
INSTALL_DEPS += $(addprefix $(BINDIR)/soapcli-,$(CMDS))
INSTALL_DEPS += $(addprefix $(MANDIR)/,$(MANS))
CHECK_PATH = $(PWD)/$(BROOTDIR)/fakeroot/usr/local/bin:/bin:/usr/bin:/usr/local/bin
.PHONY: build
build: $(BUILD_DEPS)
$(BBINDIR)/soapcli-%: src/soapcli/%.zsh
install -m755 -D $< $@
$(BBINDIR)/git-%: src/git/%.zsh
install -m755 -D $< $@
$(BBINDIR)/soapcli: src/soapcli.zsh
install -m755 -D $< $@
$(BMANDIR):
install -d $@
$(BMANDIR)/%.1: Documentation/%.rst
rst2man $< $@
.PHONY: install
install: $(INSTALL_DEPS)
$(BINDIR)/%: $(BBINDIR)/%
install -m755 -D $< $@
$(MANDIR):
install -d $@
$(MANDIR)/%: $(BMANDIR)/%
install -m644 $< $@
.PHONY: clean
clean:
$(RM) -r $(BROOTDIR) $(CRAM_ROOT)/*.t.err
.PHONY: check
check: build
mkdir -p $(BROOTDIR)/fakeroot
DESTDIR=$(BROOTDIR)/fakeroot $(MAKE) install
env -i PATH=$(CHECK_PATH) cram $(CRAMOPTS) $(CRAM_PATH)