-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
103 lines (88 loc) · 2.37 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
95
96
97
98
99
100
101
102
# $Id: Makefile,v 1.1 2010/02/11 10:49:59 ak Exp $
# Haineko.mk
# __ __ _ __ _ _
# | \/ | __ _| | _____ / _(_) | ___
# | |\/| |/ _` | |/ / _ \ |_| | |/ _ \
# | | | | (_| | < __/ _| | | __/
# |_| |_|\__,_|_|\_\___|_| |_|_|\___|
# ---------------------------------------------------------------------------
HERE = $(shell `pwd`)
TIME = $(shell date '+%s')
NAME = Haineko
NEKO = 'http://127.0.0.1:2794/submit'
MAKE = /usr/bin/make
PERL = /usr/local/bin/perl
CURL = /usr/bin/curl -X POST
PROVE = /usr/local/bin/prove -Ilib --timer
MINIL = /usr/local/bin/minil
CF = ./etc/haineko.cf-debug
JQ = /usr/local/bin/jq -M .
CP = /bin/cp
RM = /bin/rm -f
MV = /bin/mv
GIT = /usr/bin/git
CTL = ./bin/hainekoctl
PID = ./run/haineko.pid
.DEFAULT_GOAL = git-status
# -----------------------------------------------------------------------------
.PHONY: clean
start:
if [ -f "$(PID)" ]; then \
kill -0 `head -1 $(PID)` 2> /dev/null || true ;\
else \
export HAINEKO_PROC=1;\
$(CTL) start -d -C $(CF) & \
sleep 1 ;\
fi
start-with-cover:
if [ -f "$(PID)" ]; then \
kill -0 `head -1 $(PID)` 2> /dev/null || true ;\
else \
export HAINEKO_PROC=1 ;\
perl -MDevel::Cover $(CTL) start -d -C $(CF) &
sleep 1 ;\
fi
stop:
$(CTL) stop
send: start
$(CURL) -d'@tmp/email.json' $(NEKO) | $(JQ)
test -n $$HAINEKO_PROC && $(CTL) stop
test: user-test author-test
user-test:
$(PROVE) t/
author-test: start
$(CTL) make-setup-data
sleep 2
$(PROVE) xt/
test -n $$HAINEKO_PROC && $(CTL) stop
cover-test:
$(MAKE) start-with-cover
cover -test
release-test: start
$(CP) ./README.md /tmp/$(NAME)-README.$(TIME).md
$(MAKE) clean
$(MINIL) test
$(CP) /tmp/$(NAME)-README.$(TIME).md ./README.md
$(PERL) -i -ple 's|<.+[@]gmail.com>|<perl.org\@azumakuniyuki.org>|' META.json
test -n $$HAINEKO_PROC && $(CTL) stop
dist: start
$(CP) ./README.md /tmp/$(NAME)-README.$(TIME).md
$(MAKE) clean
$(MINIL) dist
$(CP) /tmp/$(NAME)-README.$(TIME).md ./README.md
$(PERL) -i -ple 's|<.+[@]gmail.com>|<perl.org\@azumakuniyuki.org>|' META.json
test -n $$HAINEKO_PROC && $(CTL) stop
git-status:
git status
push:
for G in pchan github; do \
$(GIT) push --tags $$G master; \
done
clean:
yes | $(MINIL) clean
$(RM) -r nytprof*
$(RM) -r cover_db
$(RM) -r ./build
for F in authinfo haineko.cf mailertable password recipients relayhosts sendermt; do \
$(RM) etc/$$F; \
done