diff --git a/Makefile b/Makefile index 27db635..63700fb 100644 --- a/Makefile +++ b/Makefile @@ -21,14 +21,20 @@ agent: ## Build and run the agent cd aggregator-agent && go mod tidy && go run cmd/agent/main.go build-server: ## Build server binary - cd aggregator-server && go build -o bin/aggregator-server cmd/server/main.go + cd aggregator-server && go mod tidy && go build -o bin/aggregator-server cmd/server/main.go build-agent: ## Build agent binary - cd aggregator-agent && go build -o bin/aggregator-agent cmd/agent/main.go + cd aggregator-agent && go mod tidy && go build -o bin/aggregator-agent cmd/agent/main.go clean: ## Clean build artifacts rm -rf aggregator-server/bin aggregator-agent/bin +build-all: ## Build with go mod tidy for fresh clones + @echo "Building all components with dependency cleanup..." + cd aggregator-server && go mod tidy && go build -o redflag-server cmd/server/main.go + cd aggregator-agent && go mod tidy && go build -o redflag-agent cmd/agent/main.go + @echo "Build complete!" + test: ## Run tests cd aggregator-server && go test ./... cd aggregator-agent && go test ./... diff --git a/README.md b/README.md index 509d57a..970f3b8 100644 --- a/README.md +++ b/README.md @@ -82,8 +82,14 @@ A self-hosted, cross-platform update management platform built for homelabs and ```bash # Clone and build git clone https://github.com/Fimeg/RedFlag.git -cd RedFlag/aggregator-server -go build -o redflag-server cmd/server/main.go +cd RedFlag + +# Option 1: Use Makefile (recommended) +make build-all + +# Option 2: Manual build +cd aggregator-server && go mod tidy && go build -o redflag-server cmd/server/main.go +cd ../aggregator-agent && go mod tidy && go build -o redflag-agent cmd/agent/main.go # Interactive setup wizard sudo ./redflag-server --setup diff --git a/TEST-CLONE.md b/TEST-CLONE.md index 235af53..dc52dfe 100644 --- a/TEST-CLONE.md +++ b/TEST-CLONE.md @@ -12,7 +12,7 @@ git clone https://github.com/Fimeg/RedFlag.git cd RedFlag # Build components (requires Go) -make build +make build-all # Start database docker-compose up -d postgres