SQL = sqlite3 DICT_DB = dict.db USER_DB = user.db 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 all: $(DICT_DB) $(USER_DB) $(DICT_DB): dict/full.sql $(SQL) $@ < $< $(USER_DB): user/full.sql $(SQL) $@ < $< dict/base.sql: dict/reset.sql dict/init.sql dict/deinflections.sql dict/tags.sql cat $^ > $@ dict/full.sql: dict/base.sql dict/dict.sql cat $^ > $@ dict/dict.sql: $(DEFAULT_DICTS) cat $^ > $@ user/base.sql: user/reset.sql user/init.sql cat $^ > $@ user/full.sql: user/base.sql # user/root.sql cat $^ > $@ %.sql: %.dict.sql $(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 $(DEFAULT_DICTS) user/base.sql user/full.sql test: $(DICT_DB) find.sql ./test/find '浮上しました' ./test/find 'ならない' ./test/find '浮上した' ./test/find 'なって' ./test/find 'の下にて'