-
Notifications
You must be signed in to change notification settings - Fork 35
/
Makefile
75 lines (58 loc) · 2.3 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
.PHONY: all prepare
all: prepare
prepare: dist
template_sources = \
lib/templates/*.genie \
lib/templates/*/*.genie
sources = \
lib/*.ts \
lib/*/*.js \
lib/*/*.ts \
lib/*/*/*.js \
lib/*/*/*.ts \
lib/*/*/*/*.js \
lib/*/*/*/*.ts \
tool/*.js \
tool/*.ts \
tool/*/*.js \
tool/*/*.ts \
tool/*/*/*.js \
tool/*/*/*.ts
languages = en
bundled_templates := \
lib/templates/basic.genie \
lib/templates/single-command.genie \
lib/templates/dialogue.genie
built_bundled_templates := $(addsuffix .out.ts,$(bundled_templates))
generated_early := \
lib/sentence-generator/compiler/grammar.js \
lib/utils/template-string/grammar.js
generated := \
$(generated_early) \
$(patsubst %.po,%.mo,$(wildcard po/*.po)) \
$(built_bundled_templates) \
data/builtins/org.thingpedia.builtin.thingengine.builtin/dataset.tt \
lib/engine/db/sqlite/schema.json \
lib/engine/devices/builtins/org.thingpedia.builtin.test.tt.json \
lib/engine/devices/builtins/org.thingpedia.builtin.thingengine.tt.json \
lib/engine/devices/builtins/org.thingpedia.builtin.thingengine.builtin.tt.json \
lib/engine/devices/builtins/org.thingpedia.volume-control.tt.json \
lib/engine/devices/builtins/faq.json
$(built_bundled_templates) : $(template_sources) lib/sentence-generator/compiler/*.ts $(generated_early)
ts-node ./lib/sentence-generator/compiler $(patsubst %.genie.out.ts,%.genie,$@)
dist: $(wildcard $(sources)) $(generated) tsconfig.json
tsc --build tsconfig.json
touch dist
bundle: bundle/en.zip
%.json : %.sql
node -e 'console.log(JSON.stringify(require("fs").readFileSync(process.argv[1]).toString("utf8")))' $< > [email protected]
mv [email protected] $@
lib/engine/devices/builtins/%.tt.json : data/builtins/%/manifest.tt
node -e 'console.log(JSON.stringify(require("fs").readFileSync(process.argv[1]).toString("utf8")))' $< > [email protected]
mv [email protected] $@
data/builtins/org.thingpedia.builtin.thingengine.builtin/dataset.tt data/builtins/org.thingpedia.builtin.thingengine.builtin/manifest.tt lib/engine/devices/builtins/faq.json &: data/builtins/org.thingpedia.builtin.thingengine.builtin/dataset.tt.in data/builtins/org.thingpedia.builtin.thingengine.builtin/manifest.tt.in data/builtins/org.thingpedia.builtin.thingengine.builtin/faq.yaml
ts-node data/builtins/org.thingpedia.builtin.thingengine.builtin/merge-faq
%.mo : %.po
msgfmt $< -o $@
%.js : %.pegjs
pegjs $<