db/Makefile
author Damiano Boppart <damiano@pep-security.net>
Thu, 17 Aug 2017 13:36:49 +0000
branchENGINE-228
changeset 1969 ba5eb0aa23a4
parent 1960 3e0027330faa
child 1993 efaeadf3e6f0
permissions -rw-r--r--
Do not have make comments as recipes
     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 ../Makefile.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~