db/Makefile
author Krista Bennett <krista@pep-project.org>
Fri, 04 May 2018 16:30:21 +0200
branchlocal_cpptest
changeset 2652 43b913f99a27
parent 2210 17c30881c885
child 3201 105b50dfaf15
permissions -rw-r--r--
Shelving broken things to break other things
     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 ../default.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~