forked from cask/cask
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
94 lines (67 loc) · 2.81 KB
/
Makefile
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
84
85
86
87
88
89
90
91
92
93
94
CASK ?= cask
EMACS ?= emacs
SERVANT ?= servant
SPHINX-BUILD = sphinx-build
SPHINXFLAGS =
SERVANT_DIR = servant
SERVANT_TMP_DIR = $(SERVANT_DIR)/tmp
SERVANT_PACKAGES_DIR = $(SERVANT_DIR)/packages
SERVANT_NEW_PACKAGES_DIR = $(SERVANT_DIR)/new-packages
SERVANT_ARCHIVE_CONTENTS = $(SERVANT_PACKAGES_DIR)/archive-contents
SERVANT_NEW_ARCHIVE_CONTENTS = $(SERVANT_NEW_PACKAGES_DIR)/archive-contents
DOCBUILDDIR=build/doc
DOCTREEDIR=$(DOCBUILDDIR)/doctrees
FIXTURES_DIR = fixtures
all: test
test: unit ecukes
unit:
$(CASK) exec ert-runner
ecukes:
$(CASK) exec ecukes
doc: html
html:
$(SPHINX-BUILD) -b html -d $(DOCTREEDIR) $(SPHINXFLAGS) doc $(DOCBUILDDIR)/html
linkcheck :
$(SPHINX-BUILD) -b linkcheck -d $(DOCTREEDIR) $(SPHINXFLAGS) doc $(DOCBUILDDIR)/linkcheck
start-server: $(SERVANT_DIR)
$(CASK) exec $(SERVANT) start > $(SERVANT_TMP_DIR)/servant.log 2>&1 &
stop-server:
kill $$(cat $(SERVANT_TMP_DIR)/servant.pid)
$(SERVANT_DIR): clean
$(SERVANT_DIR): $(SERVANT_TMP_DIR)
$(SERVANT_DIR): $(SERVANT_PACKAGES_DIR)/archive-contents
$(SERVANT_DIR): $(SERVANT_NEW_PACKAGES_DIR)/archive-contents
$(SERVANT_TMP_DIR):
@mkdir -p $@
$(SERVANT_PACKAGES_DIR):
@mkdir -p $@
$(SERVANT_NEW_PACKAGES_DIR):
@mkdir -p $@
$(SERVANT_PACKAGES_DIR)/package-a-0.0.1.el: $(SERVANT_PACKAGES_DIR)
cp $(FIXTURES_DIR)/package-a-0.0.1/package-a.el $@
$(SERVANT_PACKAGES_DIR)/package-b-0.0.1.el: $(SERVANT_PACKAGES_DIR)
cp $(FIXTURES_DIR)/package-b-0.0.1/package-b.el $@
$(SERVANT_PACKAGES_DIR)/package-c-0.0.1.tar: $(SERVANT_PACKAGES_DIR)
tar -cvf $@ -C $(FIXTURES_DIR) package-c-0.0.1
$(SERVANT_PACKAGES_DIR)/package-d-0.0.1.tar: $(SERVANT_PACKAGES_DIR)
tar -cvf $@ -C $(FIXTURES_DIR) package-d-0.0.1
$(SERVANT_PACKAGES_DIR)/package-e-0.0.1.tar: $(SERVANT_PACKAGES_DIR)
tar -cvf $@ -C $(FIXTURES_DIR) package-e-0.0.1
$(SERVANT_PACKAGES_DIR)/package-f-0.0.1.el: $(SERVANT_PACKAGES_DIR)
cp $(FIXTURES_DIR)/package-f-0.0.1/package-f.el $@
$(SERVANT_NEW_PACKAGES_DIR)/package-a-0.0.2.el: $(SERVANT_NEW_PACKAGES_DIR)
cp $(FIXTURES_DIR)/package-a-0.0.2/package-a.el $@
$(SERVANT_ARCHIVE_CONTENTS): $(SERVANT_PACKAGES_DIR)/package-a-0.0.1.el
$(SERVANT_ARCHIVE_CONTENTS): $(SERVANT_PACKAGES_DIR)/package-b-0.0.1.el
$(SERVANT_ARCHIVE_CONTENTS): $(SERVANT_PACKAGES_DIR)/package-c-0.0.1.tar
$(SERVANT_ARCHIVE_CONTENTS): $(SERVANT_PACKAGES_DIR)/package-d-0.0.1.tar
$(SERVANT_ARCHIVE_CONTENTS): $(SERVANT_PACKAGES_DIR)/package-e-0.0.1.tar
$(SERVANT_ARCHIVE_CONTENTS): $(SERVANT_PACKAGES_DIR)/package-f-0.0.1.el
$(CASK) exec $(SERVANT) index --packages-path $(SERVANT_PACKAGES_DIR)
$(SERVANT_NEW_ARCHIVE_CONTENTS): $(SERVANT_NEW_PACKAGES_DIR)/package-a-0.0.2.el
$(CASK) exec $(SERVANT) index --packages-path $(SERVANT_NEW_PACKAGES_DIR)
clean:
rm -rf $(SERVANT_DIR)
rm -rf $(DOCBUILDDIR)
.PHONY: start-server stop-server unit ecukes test all clean \
doc html linkcheck