db/Makefile
author Damiano Boppart <damiano@pep-security.net>
Fri, 11 Aug 2017 15:25:16 +0200
branchENGINE-228
changeset 1952 4722b371f609
parent 1513 e7f7e42385b5
child 1958 433df9ee336d
permissions -rw-r--r--
Cleanup db/Makefile
vb@1513
     1
# This file is under GNU General Public License 3.0
vb@1513
     2
# see LICENSE.txt
vb@1513
     3
vb@365
     4
include ../Makefile.conf
vb@365
     5
damiano@1952
     6
.PHONY: db
vb@365
     7
db: system.db
vb@365
     8
damiano@1952
     9
DICOS = $(wildcard *.csv)
Edouard@368
    10
damiano@1952
    11
system.db: create_system_db.sql $(DICOS)
damiano@1952
    12
	# Keep a backup db around
Edouard@368
    13
	-mv -f $@ $@~ 
vb@365
    14
	sqlite3 -batch $@ < $<
damiano@1952
    15
	for c in $(DICOS) ; do echo "$$c" ; echo .import "$$c" wordlist | sqlite3 -batch -csv $@ ; done
vb@365
    16
damiano@1952
    17
.PHONY: install
vb@365
    18
install: system.db
vb@944
    19
	mkdir -p `dirname $(SYSTEM_DB)`
vb@365
    20
	cp system.db $(SYSTEM_DB)
vb@365
    21
damiano@1952
    22
.PHONY: clean
vb@365
    23
clean:
damiano@1952
    24
	-rm -f system.db system.db~