aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 10 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 8743043..a6b777f 100644
--- a/Makefile
+++ b/Makefile
@@ -13,16 +13,20 @@ openrussian : openrussian.lua
chmod a+x $@
# Marking the ZIP intermediate makes sure it is automatically deleted after
-# generating the SQLITE database while we don't always re-download it.
+# generating the SQLite database while we don't always re-download it.
# Effectively, it will behave like a temporary file.
-.INTERMEDIATE: openrussian-sql.zip
+# NOTE: This is disabled for the time being since the database schema changes
+# from time to time, so a rebuild could easily break the script.
+# Instead, we add the file to Git, so every clone is guaranteed to contain
+# a database matching the openrussian.lua script.
+#.INTERMEDIATE: openrussian-sql.zip
openrussian-sql.zip:
wget -O $@ 'https://en.openrussian.org/downloads/openrussian-sql.zip'
-# NOTE: VACUUMing the database saves a few megabytes
-openrussian-sqlite3.db : openrussian-sql.zip mysql2sqlite
+openrussian-sqlite3.db : openrussian-sql.zip mysql2sqlite postprocess.sql
+ $(RM) $@
unzip -p $< openrussian.sql | ./mysql2sqlite - | sqlite3 $@
- sqlite3 $@ VACUUM
+ sqlite3 $@ -batch <postprocess.sql
# NOTE: Installation of the Bash completions depends on the Debain bash-completion
# package being installed or something similar
@@ -33,4 +37,4 @@ install : openrussian openrussian-sqlite3.db openrussian-completion.bash
cp openrussian-completion.bash $(DESTDIR)$(COMPLETIONSDIR)/openrussian
clean:
- $(RM) -f openrussian openrussian-sql.zip openrussian-sqlite3.db
+ $(RM) openrussian openrussian-sql.zip openrussian-sqlite3.db