Projektutvecklingslab/Makefile

32 lines
614 B
Makefile
Raw Permalink Normal View History

2024-02-14 17:33:24 +01:00
# Define variables
DB_NAME := lab.db3
SQL_SCRIPT := database.sql
# Define targets and their dependencies
all: init_db
2024-02-14 19:55:17 +01:00
run:
./mvnw compile exec:java -Dexec.mainClass="launch.Main"
watch:
watchexec -c -r -w src make run
2024-02-14 17:33:24 +01:00
init_db: $(DB_NAME)
# Target to create the database
$(DB_NAME): $(SQL_SCRIPT)
sqlite3 $@ < $<
# Clean target
clean:
rm -f $(DB_NAME)
2024-02-14 19:09:00 +01:00
dumptables:
sqlite3 $(DB_NAME) "SELECT * FROM Respondents;"
sqlite3 $(DB_NAME) "SELECT * FROM Answers;"
2024-02-14 19:55:17 +01:00
sqlite3 $(DB_NAME) "SELECT * FROM ProjectDetails;"
sqlite3 $(DB_NAME) "SELECT * FROM SurveyResults;"
2024-02-14 19:09:00 +01:00
2024-02-14 17:33:24 +01:00
# Phony targets
.PHONY: all init_db clean