db/Makefile : rename old db before creating new db, add csv files as dependencies
authorEdouard Tisserant
Mon, 05 Oct 2015 19:41:46 +0200
changeset 368c8302f5536c3
parent 367 17ecd771a39a
child 369 906f46ffd840
db/Makefile : rename old db before creating new db, add csv files as dependencies
db/Makefile
     1.1 --- a/db/Makefile	Mon Oct 05 12:23:53 2015 +0200
     1.2 +++ b/db/Makefile	Mon Oct 05 19:41:46 2015 +0200
     1.3 @@ -2,9 +2,12 @@
     1.4  
     1.5  db: system.db
     1.6  
     1.7 -system.db: create_system_db.sql
     1.8 +dicos=$(wildcard *.csv)
     1.9 +
    1.10 +system.db: create_system_db.sql $(dicos)
    1.11 +	-mv -f $@ $@~ 
    1.12  	sqlite3 -batch $@ < $<
    1.13 -	for c in *.csv ; do echo $$c ; echo .import "$$c" wordlist | sqlite3 -batch -csv $@ ; done
    1.14 +	for c in $(dicos); do echo $$c ; echo .import "$$c" wordlist | sqlite3 -batch -csv $@ ; done
    1.15  
    1.16  .PHONY: clean install
    1.17