db/Makefile
author Edouard Tisserant
Mon, 05 Oct 2015 19:41:46 +0200
changeset 368 c8302f5536c3
parent 366 cfc6e24badaa
child 944 e97cf5e73b64
permissions -rw-r--r--
db/Makefile : rename old db before creating new db, add csv files as dependencies
vb@365
     1
include ../Makefile.conf
vb@365
     2
vb@365
     3
db: system.db
vb@365
     4
Edouard@368
     5
dicos=$(wildcard *.csv)
Edouard@368
     6
Edouard@368
     7
system.db: create_system_db.sql $(dicos)
Edouard@368
     8
	-mv -f $@ $@~ 
vb@365
     9
	sqlite3 -batch $@ < $<
Edouard@368
    10
	for c in $(dicos); do echo $$c ; echo .import "$$c" wordlist | sqlite3 -batch -csv $@ ; done
vb@365
    11
vb@365
    12
.PHONY: clean install
vb@365
    13
vb@365
    14
install: system.db
vb@365
    15
	cp system.db $(SYSTEM_DB)
vb@365
    16
vb@365
    17
clean:
vb@365
    18
	rm -f system.db