aboutsummaryrefslogtreecommitdiff
path: root/db/makefile
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-06-29 11:33:23 +0200
committerlonkaars <loek@pipeframe.xyz>2023-06-29 11:33:23 +0200
commitc998e1c0477d51c886f9e4246e102dec4d7ef8dd (patch)
tree4d979c57f16b138ff4b2ce5fb3151ce241af6881 /db/makefile
parent67dbb6421976254658c5e38045513129dd18187a (diff)
add jmdict importer to repo
Diffstat (limited to 'db/makefile')
-rw-r--r--db/makefile14
1 files changed, 10 insertions, 4 deletions
diff --git a/db/makefile b/db/makefile
index c1e527e..88d4bba 100644
--- a/db/makefile
+++ b/db/makefile
@@ -2,7 +2,13 @@ SQL = sqlite3
DICT_DB = dict.db
USER_DB = user.db
-DICT_TEMPLATE = dict/template.sql.m4
+DICT_TEMPLATE = dict/template.sql
+
+# comment any of these lines to disable including in the default DB
+DEFAULT_DICTS += dict/test_a.sql
+DEFAULT_DICTS += dict/test_b.sql
+DEFAULT_DICTS += dict/test_pitch_accent.sql
+DEFAULT_DICTS += ../import/jmdict/jmdict.sql
.PHONY: clean test
@@ -20,7 +26,7 @@ dict/base.sql: dict/reset.sql dict/init.sql dict/deinflections.sql dict/tags.sql
dict/full.sql: dict/base.sql dict/dict.sql
cat $^ > $@
-dict/dict.sql: dict/test_a.sql dict/test_b.sql dict/test_pitch_accent.sql dict/jmdict.sql
+dict/dict.sql: $(DEFAULT_DICTS)
cat $^ > $@
user/base.sql: user/reset.sql user/init.sql
@@ -30,11 +36,11 @@ user/full.sql: user/base.sql user/root.sql
cat $^ > $@
%.sql: %.dict.sql $(DICT_TEMPLATE)
- m4 $(DICT_TEMPLATE) < $< > $@
+ echo "" | cat - $< | m4 -P $(DICT_TEMPLATE) > $@
# delete generated sql files and database
clean:
- $(RM) $(DICT_DB) $(USER_DB) dict/base.sql dict/full.sql dict/dict.sql dict/test_a.sql dict/test_b.sql dict/test_pitch_accent.sql user/base.sql user/full.sql
+ $(RM) $(DICT_DB) $(USER_DB) dict/base.sql dict/full.sql dict/dict.sql $(DEFAULT_DICTS) user/base.sql user/full.sql
test: $(DICT_DB) find.sql
./test/find '浮上しました'