Implement 'db-init' Makefile rule
This commit is contained in:
parent
011d66d2d1
commit
c3ac435524
1 changed files with 15 additions and 0 deletions
15
Makefile
15
Makefile
|
@ -1,8 +1,23 @@
|
||||||
DOCKER = docker
|
DOCKER = docker
|
||||||
DOCKER_TAG = xmet:latest
|
DOCKER_TAG = xmet:latest
|
||||||
|
|
||||||
|
SQLITE = sqlite3
|
||||||
|
SQLITE_SCHEMA = db/xmet.sql
|
||||||
|
SQLITE_DB = xmet.db
|
||||||
|
|
||||||
|
DB_INIT = ./bin/xmet-db-init
|
||||||
|
DB_INIT_RADARS = doc/radars.tsv
|
||||||
|
DB_INIT_WFO = doc/wfo.tsv
|
||||||
|
DB_INIT_IGRA = doc/igra2-station-list.txt
|
||||||
|
DB_INIT_FILES = $(DB_INIT_RADARS) $(DB_INIT_WFO) $(DB_INIT_IGRA)
|
||||||
|
|
||||||
all:
|
all:
|
||||||
$(DOCKER) image build --tag $(DOCKER_TAG) .
|
$(DOCKER) image build --tag $(DOCKER_TAG) .
|
||||||
|
|
||||||
|
db-init:
|
||||||
|
$(RM) $(SQLITE_DB)
|
||||||
|
$(SQLITE) -init $(SQLITE_SCHEMA) $(SQLITE_DB) .quit
|
||||||
|
$(DB_INIT) $(SQLITE_DB) $(DB_INIT_FILES)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(DOCKER) rmi $(DOCKER_TAG)
|
$(DOCKER) rmi $(DOCKER_TAG)
|
||||||
|
|
Loading…
Add table
Reference in a new issue