db/Makefile
author Krista Bennett <krista@pep-project.org>
Tue, 22 Aug 2017 15:34:17 +0200
changeset 1988 ea7bceda4dc8
parent 1513 e7f7e42385b5
child 1989 d3e5bc4a9854
permissions -rw-r--r--
Rolled back to revision 1982. Sorry all, checked in wrong branch to default
     1 # Copyright 2017, pEp Foundation
     2 # This file is part of pEpEngine
     3 # This file may be used under the terms of the GNU General Public License version 3
     4 # see LICENSE.txt
     5 
     6 include ../Makefile.conf
     7 
     8 .PHONY: db
     9 db: system.db
    10 
    11 DICOS = $(wildcard *.csv)
    12 
    13 # The 'mv' keeps a backup db around
    14 system.db: create_system_db.sql $(DICOS)
    15 	-mv -f $@ $@~ 
    16 	sqlite3 -batch $@ < $<
    17 	for c in $(DICOS) ; do echo "$$c" ; echo .import "$$c" wordlist | sqlite3 -batch -csv $@ ; done
    18 
    19 .PHONY: install
    20 install: system.db
    21 	mkdir -p `dirname $(SYSTEM_DB)`
    22 	cp system.db $(SYSTEM_DB)
    23 
    24 .PHONY: clean
    25 clean:
    26 	rm -f system.db system.db~