30 lines
563 B
Makefile
30 lines
563 B
Makefile
# Define variables
|
|
DB_NAME := lab.db3
|
|
SQL_SCRIPT := database.sql
|
|
|
|
# Define targets and their dependencies
|
|
all: init_db
|
|
|
|
run:
|
|
./mvnw compile exec:java -Dexec.mainClass="launch.Main"
|
|
|
|
watch:
|
|
watchexec -c -r -w src make run
|
|
|
|
init_db: $(DB_NAME)
|
|
|
|
# Target to create the database
|
|
$(DB_NAME): $(SQL_SCRIPT)
|
|
sqlite3 $@ < $<
|
|
|
|
# Clean target
|
|
clean:
|
|
rm -f $(DB_NAME)
|
|
|
|
dumptables:
|
|
sqlite3 $(DB_NAME) "SELECT * FROM Respondents;"
|
|
sqlite3 $(DB_NAME) "SELECT * FROM Answers;"
|
|
sqlite3 $(DB_NAME) "SELECT * FROM ProjectDetails;"
|
|
|
|
# Phony targets
|
|
.PHONY: all init_db clean
|