db/Makefile
author Krista Bennett <krista@pep-project.org>
Thu, 18 Jan 2018 00:46:19 +0100
changeset 2410 721952accdee
parent 2210 17c30881c885
child 3201 105b50dfaf15
permissions -rw-r--r--
DANGER! MERGED IN ENGINE-289! SOME DOC BUGS STILL EXIST - USE WITH CARE!!!
damiano@1960
     1
# Copyright 2017, pEp Foundation
damiano@1958
     2
# This file is part of pEpEngine
damiano@1958
     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
damiano@2210
     6
include ../default.conf
vb@365
     7
damiano@1952
     8
.PHONY: db
vb@365
     9
db: system.db
vb@365
    10
damiano@1952
    11
DICOS = $(wildcard *.csv)
Edouard@368
    12
damiano@1969
    13
# The 'mv' keeps a backup db around
damiano@1952
    14
system.db: create_system_db.sql $(DICOS)
Edouard@368
    15
	-mv -f $@ $@~ 
vb@365
    16
	sqlite3 -batch $@ < $<
damiano@1952
    17
	for c in $(DICOS) ; do echo "$$c" ; echo .import "$$c" wordlist | sqlite3 -batch -csv $@ ; done
vb@365
    18
damiano@1952
    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
damiano@1952
    24
.PHONY: clean
vb@365
    25
clean:
damiano@1958
    26
	rm -f system.db system.db~