43 lines
1.3 KiB
Makefile
43 lines
1.3 KiB
Makefile
.PHONY: help db-up db-down server agent clean
|
|
|
|
help: ## Show this help message
|
|
@echo 'Usage: make [target]'
|
|
@echo ''
|
|
@echo 'Available targets:'
|
|
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-15s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
|
|
|
db-up: ## Start PostgreSQL database
|
|
docker-compose up -d postgres
|
|
@echo "Waiting for database to be ready..."
|
|
@sleep 3
|
|
|
|
db-down: ## Stop PostgreSQL database
|
|
docker-compose down
|
|
|
|
server: ## Build and run the server
|
|
cd server && go mod tidy && go run cmd/server/main.go
|
|
|
|
agent: ## Build and run the agent
|
|
cd agent && go mod tidy && go run cmd/agent/main.go
|
|
|
|
build-server: ## Build server binary
|
|
cd server && go mod tidy && go build -o bin/server cmd/server/main.go
|
|
|
|
build-agent: ## Build agent binary
|
|
cd agent && go mod tidy && go build -o bin/agent cmd/agent/main.go
|
|
|
|
build-agent-simple: ## Build agent binary with simple script
|
|
@./scripts/build-secure-agent.sh
|
|
|
|
clean: ## Clean build artifacts
|
|
rm -rf server/bin agent/bin
|
|
|
|
build-all: ## Build with go mod tidy for fresh clones
|
|
@echo "Building all components with dependency cleanup..."
|
|
cd server && go mod tidy && go build -o redflag-server cmd/server/main.go
|
|
cd agent && go mod tidy && go build -o redflag-agent cmd/agent/main.go
|
|
@echo "Build complete!"
|
|
|
|
test: ## Run tests
|
|
cd server && go test ./...
|
|
cd agent && go test ./...
|