forked from video-db/Director
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
77 lines (61 loc) · 2.21 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Detect the shell (sh, bash, etc.)
SHELL := $(shell echo $$SHELL)
# Default target
.DEFAULT_GOAL := help
# Variables
BACKEND_DIR := backend
FRONTEND_DIR := frontend
# Phony targets
.PHONY: help venv init-sqlite-db install-be test lint run-be install-fe update-fe run-fe run
help:
@echo "------------------------ HELP ------------------------"
@echo "Database:"
@echo " init-sqlite-db Initialize the SQLite database"
@echo " init-postgres-db Initialize the PostgreSQL database"
@echo " init-turso-db Initialize the Turso database"
@echo ""
@echo "Backend:"
@echo " install-be Install backend dependencies"
@echo " test Run backend tests"
@echo " lint Run linter on backend code"
@echo " run-be Start the backend development server"
@echo ""
@echo "Frontend:"
@echo " install-fe Install frontend dependencies"
@echo " update-fe Update frontend dependencies"
@echo " run-fe Start the frontend development server"
@echo ""
@echo "Application:"
@echo " run Run both backend and frontend"
@echo "------------------------------------------------------"
# Delegate backend-related tasks to backend/Makefile
venv:
$(MAKE) --no-print-directory -C $(BACKEND_DIR) venv
init-sqlite-db:
$(MAKE) --no-print-directory -C $(BACKEND_DIR) init-sqlite-db
init-postgres-db:
$(MAKE) --no-print-directory -C $(BACKEND_DIR) init-postgres-db
init-turso-db:
$(MAKE) --no-print-directory -C $(BACKEND_DIR) init-turso-db
install-be:
$(MAKE) --no-print-directory -C $(BACKEND_DIR) install
test:
$(MAKE) --no-print-directory -C $(BACKEND_DIR) test
lint:
$(MAKE) --no-print-directory -C $(BACKEND_DIR) lint
run-be:
$(MAKE) --no-print-directory -C $(BACKEND_DIR) run
# Delegate frontend-related tasks to frontend/Makefile
install-fe:
$(MAKE) --no-print-directory -C $(FRONTEND_DIR) install
update-fe:
$(MAKE) --no-print-directory -C $(FRONTEND_DIR) update
run-fe:
$(MAKE) --no-print-directory -C $(FRONTEND_DIR) run
# Start both backend and frontend
run:
@echo "Starting backend and frontend..."
@trap 'kill $(jobs -p)' INT; \
($(MAKE) run-be 2>&1 | sed 's/^/[BACKEND] /' ) & \
($(MAKE) run-fe 2>&1 | sed 's/^/[FRONTEND] /' ) & \
wait