-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
64 lines (49 loc) · 1.45 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
SERVER = http://localhost:3000
JSONDIR = json
NEWJSONDIR = newJson
JSONFILES = $(wildcard $(JSONDIR)/*.js)
NEWJSONFILES = $(addprefix $(NEWJSONDIR)/,$(notdir $(JSONFILES)))
.PHONY: all clean
all: hayooContexts.js $(NEWJSONFILES)
clean:
- rm -f hayooContexts.js
- rm -rf $(NEWJSONDIR)/
hayooContexts.js: makeJs.py
./makeJs.py --contexts hayooContexts.js
$(NEWJSONDIR)/%.js: makeJs.py $(JSONDIR)/%.js
./makeJs.py $(JSONDIR)/$*.js $@
insert-package: hayooContexts.js $(NEWJSONFILES)
curl -X POST -d @hayooContexts.js $(SERVER)/eval; \
echo ""; \
i=1; \
for file in $(NEWJSONDIR)/*.js; do \
echo -n "\n$$i - $$file"; \
curl -X POST -d @"$$file" $(SERVER)/eval; \
i=$$(($$i+1)); \
done
packed: hayooContexts.js
./makeJs.py --concat 10 packedFiles $(NEWJSONFILES)
clean-packed:
rm -rf packedFiles
insert-packed: hayooContexts.js
curl -X POST -d @hayooContexts.js $(SERVER)/eval; \
echo ""; \
i=1; \
for file in packedFiles/*.js; do \
echo -n "\n$$i - $$file"; \
curl -X POST -d @"$$file" $(SERVER)/eval; \
i=$$(($$i+1)); \
done
## insert complete hayoo index and save index
JHOST = $(SERVER)
JSONFILES = $(shell find json -name '*.js.bz2' -print | sort)
insert-json:
i=1; \
for file in $(JSONFILES); do \
echo -n "\n$$i - $$(date) - $$file "; \
bzcat $$file > xxx.js ; \
curl -X POST -d @"xxx.js" $(JHOST)/eval; \
rm -f xxx.js ; \
i=$$(($$i+1)); \
done ; \
curl $(JHOST)/binary/save/hayoo-ix.$$(date +%FT%T)