Sql init script
This commit is contained in:
parent
3ad19d144a
commit
742a7f0bb1
2 changed files with 19 additions and 0 deletions
19
Makefile
Normal file
19
Makefile
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
# Define variables
|
||||||
|
DB_NAME := lab.db3
|
||||||
|
SQL_SCRIPT := database.sql
|
||||||
|
|
||||||
|
# Define targets and their dependencies
|
||||||
|
all: init_db
|
||||||
|
|
||||||
|
init_db: $(DB_NAME)
|
||||||
|
|
||||||
|
# Target to create the database
|
||||||
|
$(DB_NAME): $(SQL_SCRIPT)
|
||||||
|
sqlite3 $@ < $<
|
||||||
|
|
||||||
|
# Clean target
|
||||||
|
clean:
|
||||||
|
rm -f $(DB_NAME)
|
||||||
|
|
||||||
|
# Phony targets
|
||||||
|
.PHONY: all init_db clean
|
0
database.sql
Normal file
0
database.sql
Normal file
Loading…
Reference in a new issue