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
krista@1988
     1
# Copyright 2017, pEp Foundation
krista@1988
     2
# This file is part of pEpEngine
krista@1988
     3
# This file may be used under the terms of the GNU General Public License version 3
vb@1513
     4
# see LICENSE.txt
vb@1513
     5
vb@365
     6
include ../Makefile.conf
vb@365
     7
krista@1988
     8
.PHONY: db
vb@365
     9
db: system.db
vb@365
    10
krista@1988
    11
DICOS = $(wildcard *.csv)
Edouard@368
    12
krista@1988
    13
# The 'mv' keeps a backup db around
krista@1988
    14
system.db: create_system_db.sql $(DICOS)
Edouard@368
    15
	-mv -f $@ $@~ 
vb@365
    16
	sqlite3 -batch $@ < $<
krista@1988
    17
	for c in $(DICOS) ; do echo "$$c" ; echo .import "$$c" wordlist | sqlite3 -batch -csv $@ ; done
vb@365
    18
krista@1988
    19
.PHONY: install
vb@365
    20
install: system.db
vb@944
    21
	mkdir -p `dirname $(SYSTEM_DB)`
vb@365
    22
	cp system.db $(SYSTEM_DB)
vb@365
    23
krista@1988
    24
.PHONY: clean
vb@365
    25
clean:
krista@1988
    26
	rm -f system.db system.db~