-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
105 lines (95 loc) · 3.22 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
103
104
NAME=flon
#default: $(NAME).o
.DEFAULT spec clean dispatcher executor listener:
$(MAKE) -C tmp/ $@
# copy up-to-date versions of dep libs into src/
#
stamp:
cd $(REP) && git log -n 1 | sed 's/^/\/\//' >> ../$(NAME)/$(FIL)
upgrade:
cp -v ../shervin/src/*.[ch] src/lib/
cp -v ../gajeta/src/*.[ch] src/lib/
cp -v ../djan/src/*.[ch] src/lib/
cp -v ../flutil/src/*.[ch] src/lib/
cp -v ../mnemo/src/*.[ch] src/lib/
cp -v ../tsifro/src/*.[ch] src/lib/
cp -v ../dollar/src/dollar.[ch] src/lib/
rm src/lib/todjan.c # no
find src/lib/sh*.[ch] -exec $(MAKE) --quiet stamp REP=../shervin FIL={} \;
find src/lib/gaj*.[ch] -exec $(MAKE) --quiet stamp REP=../gajeta FIL={} \;
find src/lib/djan.[ch] -exec $(MAKE) --quiet stamp REP=../djan FIL={} \;
find src/lib/flu*.[ch] -exec $(MAKE) --quiet stamp REP=../flutil FIL={} \;
find src/lib/mnemo.[ch] -exec $(MAKE) --quiet stamp REP=../mnemo FIL={} \;
find src/lib/tsifro.[ch] -exec $(MAKE) --quiet stamp REP=../tsifro FIL={} \;
find src/lib/dollar.[ch] -exec $(MAKE) --quiet stamp REP=../dollar FIL={} \;
clean-tst-time:
find tst/var/spool/tdis/ -mindepth 1 -maxdepth 1 -type d | xargs rm -fR
clean-tst-basic:
rm -f tst/var/spool/dis/*.json
rm -f tst/var/spool/exe/*.json
rm -f tst/var/spool/tsk/*.json
rm -f tst/var/spool/rejected/nada
rm -f tst/var/spool/rejected/*.json
rm -f tst/var/spool/rejected/*.jon
find tst/var/spool/tdis/ -mindepth 1 -maxdepth 1 -type d | xargs rm -fR
find tst/var/run/ -mindepth 1 -maxdepth 1 -type d | xargs rm -fR
find tst/var/archive/ -mindepth 1 -maxdepth 1 -type d | xargs rm -fR
find tst/var/log/ -mindepth 1 -maxdepth 1 -type d | xargs rm -fR
rm -f tst/var/run/*.pid
#rm -f tst/var/log/dispatcher.log
echo "" > tst/var/log/dispatcher.log
echo "" > tst/var/log/tsk.log
ctst: clean-tst-basic clean-tst-time
dis: clean tasker executor dispatcher
./tst/bin/flon-dispatcher
vdis: clean tasker executor dispatcher
valgrind --leak-check=full -v ./tst/bin/flon-dispatcher
lis: clean listener
./tst/bin/flon-listener
vlis: clean listener
valgrind --leak-check=full -v ./tst/bin/flon-listener
ps:
ps aux | grep flon
killall:
killall -i -r flon
tt:
tree -L 3 tst/usr/local/
last: fflon
./tst/bin/flon scope
lastl: fflon
./tst/bin/flon scope | less +F -R
vlast: fflon
valgrind --leak-check=full -v ./tst/bin/flon scope
vlastl: fflon
valgrind --leak-check=full -v ./tst/bin/flon scope | less +F -R
catdis:
cat tst/var/log/dispatcher.log
provision:
@if [ -z "$(T)" ]; then echo "missing T={target/path}"; exit 1; fi
@echo "\n======= prepare binaries\n"
$(MAKE) bins
@echo "\n======= prepare tree\n"
mkdir -p $(T)/bin
mkdir -p $(T)/etc
mkdir -p $(T)/usr/local/etc/vars
mkdir -p $(T)/usr/local/lib/any
mkdir -p $(T)/usr/local/tsk/any
mkdir -p $(T)/var/archive
mkdir -p $(T)/var/log
mkdir -p $(T)/var/run
mkdir -p $(T)/var/spool/dis
mkdir -p $(T)/var/spool/exe
mkdir -p $(T)/var/spool/rejected
mkdir -p $(T)/var/spool/tdis
mkdir -p $(T)/var/spool/tsk
@echo "\n======= copy items\n"
cp tst/bin/flon-* $(T)/bin/
cp tst/bin/flon $(T)/bin/
cp -pR tst/usr/local/tsk/any/hello $(T)/usr/local/tsk/any/
cp misc/*.json $(T)/etc/
cp -pR tst/var/www $(T)/var/
@echo
.PHONY: \
spec clean upgrade clean-tst-basic clean-tst-time dis vdis lis vlis \
ps killall tt \
provision