# Token Bucket Makefile # Build system for the Nim token bucket rate limiting library .PHONY: all build test clean install deps help # Default target all: deps build test # Help target help: @echo "Token Bucket Build System" @echo "=========================" @echo "Available targets:" @echo " all - Install deps, build, and test" @echo " build - Build the library" @echo " test - Run tests" @echo " deps - Install dependencies" @echo " clean - Clean build artifacts" @echo " help - Show this help message" # Install dependencies deps: @echo "Installing dependencies..." nimble install -d # Build the library build: @echo "Building token bucket library..." nim c --mm:refc src/token_bucket.nim # Run tests test: @echo "Running tests..." nim c -r tests/test_token_bucket.nim # Clean build artifacts clean: @echo "Cleaning build artifacts..." rm -rf src/nimcache tests/nimcache rm -f src/token_bucket tests/test_token_bucket find . -name "*.pdb" -delete 2>/dev/null || true # Install the package install: @echo "Installing package..." nimble install # Development build with debug info debug: @echo "Building with debug info..." nim c --debuginfo --linedir:on src/token_bucket.nim # Run tests with coverage (if available) test-coverage: @echo "Running tests with coverage..." nim c -r --passC:"-fprofile-arcs -ftest-coverage" --passL:"-lgcov" tests/test_token_bucket.nim