db/Makefile
author Thomas
Fri, 07 Jun 2019 07:41:36 +0200
branchsequoia_windows
changeset 3819 0c1bcfa6f9f3
parent 3201 105b50dfaf15
child 4089 b3a067ff79f5
permissions -rw-r--r--
Merge with sync
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@3201
     6
include ../Makefile.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~