BACKEND_DIR=server/backend
AGENT_DIR=player/agent

.PHONY: build build-backend build-agent run-backend run-agent fmt lint lint-backend lint-agent

build: build-backend build-agent

build-backend:
	cd $(BACKEND_DIR) && go build ./...

build-agent:
	cd $(AGENT_DIR) && go build ./...

run-backend:
	cd $(BACKEND_DIR) && go run ./cmd/api

run-agent:
	cd $(AGENT_DIR) && go run ./cmd/agent

fmt:
	cd $(BACKEND_DIR) && go fmt ./...
	cd $(AGENT_DIR) && go fmt ./...

lint: lint-backend lint-agent

lint-backend:
	cd $(BACKEND_DIR) && golangci-lint run --config ../../.golangci.yml ./...

lint-agent:
	cd $(AGENT_DIR) && golangci-lint run --config ../../.golangci.yml ./...
