initial commit
This commit is contained in:
65
Makefile
Normal file
65
Makefile
Normal file
@@ -0,0 +1,65 @@
|
||||
.PHONY: build clean test run-server run-cli help
|
||||
|
||||
# Build both server and CLI
|
||||
build:
|
||||
@echo "Building WhatsHooked..."
|
||||
@mkdir -p bin
|
||||
@go build -o bin/whatshook-server ./cmd/server
|
||||
@go build -o bin/whatshook-cli ./cmd/cli
|
||||
@echo "Build complete! Binaries in bin/"
|
||||
|
||||
# Build server only
|
||||
build-server:
|
||||
@echo "Building server..."
|
||||
@mkdir -p bin
|
||||
@go build -o bin/whatshook-server ./cmd/server
|
||||
@echo "Server built: bin/whatshook-server"
|
||||
|
||||
# Build CLI only
|
||||
build-cli:
|
||||
@echo "Building CLI..."
|
||||
@mkdir -p bin
|
||||
@go build -o bin/whatshook-cli ./cmd/cli
|
||||
@echo "CLI built: bin/whatshook-cli"
|
||||
|
||||
# Clean build artifacts (preserves bin directory)
|
||||
clean:
|
||||
@echo "Cleaning..."
|
||||
@mkdir -p bin
|
||||
@rm -f bin/whatshook*
|
||||
@echo "Clean complete!"
|
||||
|
||||
# Run tests
|
||||
test:
|
||||
@echo "Running tests..."
|
||||
@go test ./...
|
||||
|
||||
# Run server (requires config.json)
|
||||
run-server:
|
||||
@go run ./cmd/server -config config.json
|
||||
|
||||
# Run CLI
|
||||
run-cli:
|
||||
@go run ./cmd/cli $(ARGS)
|
||||
|
||||
# Install dependencies
|
||||
deps:
|
||||
@echo "Installing dependencies..."
|
||||
@go mod download
|
||||
@go mod tidy
|
||||
@echo "Dependencies installed!"
|
||||
|
||||
# Help
|
||||
help:
|
||||
@echo "WhatsHooked Makefile"
|
||||
@echo ""
|
||||
@echo "Usage:"
|
||||
@echo " make build - Build server and CLI"
|
||||
@echo " make build-server - Build server only"
|
||||
@echo " make build-cli - Build CLI only"
|
||||
@echo " make clean - Remove build artifacts (preserves bin directory)"
|
||||
@echo " make test - Run tests"
|
||||
@echo " make run-server - Run server (requires config.json)"
|
||||
@echo " make run-cli ARGS='health' - Run CLI with arguments"
|
||||
@echo " make deps - Install dependencies"
|
||||
@echo " make help - Show this help message"
|
||||
Reference in New Issue
Block a user