-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (27 loc) · 717 Bytes
/
Copy pathMakefile
File metadata and controls
33 lines (27 loc) · 717 Bytes
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
.PHONY: setup build run test clean
# Name of your database for local development
DB_NAME=dev.db
PORT=8085
HOST=http://localhost:$(PORT)
setup:
@echo "Setting up development database..."
@if [ ! -f $(DB_NAME) ]; then \
cp internal/testdata/test_db $(DB_NAME); \
echo "$(DB_NAME) created successfully."; \
else \
echo "$(DB_NAME) already exists."; \
fi
build:
@echo "Tidying go modules and building..."
go mod tidy
go build -o bookmarks_run_binary main.go
run: build setup
@echo "Starting bookmarks server on $(HOST)..."
./bookmarks_run_binary $(HOST) $(PORT) $(DB_NAME)
test:
@echo "Running tests..."
go test -v ./...
clean:
@echo "Cleaning up..."
rm -f bookmarks_run_binary
rm -f $(DB_NAME)