db/Makefile
author Damiano Boppart <damiano@pep-security.net>
Mon, 14 Aug 2017 02:26:09 +0200
branchENGINE-228
changeset 1958 433df9ee336d
parent 1952 4722b371f609
child 1960 3e0027330faa
permissions -rw-r--r--
More Makefile cleanup
damiano@1958
     1
# Copyright 2017, pEp Security SA
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
vb@365
     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@1952
    13
system.db: create_system_db.sql $(DICOS)
damiano@1952
    14
	# Keep a backup db around
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~