Something went wrong. Try again.
A Transparent and Verifiable Way to Sync the AT Protocol's PLC Directory
Something went wrong. Try again.
plcbundle Makefile
3.0 kB · 112 lines
Makefile
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113.PHONY: all build install test clean fmt lint help version bump-patch bump-minor bump-major release
# Binary nameBINARY_NAME=plcbundleINSTALL_PATH=$(GOPATH)/bin
# Version informationVERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")GIT_COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown")BUILD_DATE := $(shell date -u '+%Y-%m-%d_%H:%M:%S')
# Go commandsGOCMD=goGOBUILD=$(GOCMD) buildGOINSTALL=$(GOCMD) installGOCLEAN=$(GOCMD) cleanGOTEST=$(GOCMD) testGOGET=$(GOCMD) getGOFMT=$(GOCMD) fmtGOMOD=$(GOCMD) mod
# Build flagsLDFLAGS=-ldflags "-X main.version=$(VERSION) -X main.gitCommit=$(GIT_COMMIT) -X main.buildDate=$(BUILD_DATE)"
# Default targetall: build
# Build the CLI tool with version infobuild: @echo "Building $(BINARY_NAME) $(VERSION)..." $(GOBUILD) $(LDFLAGS) -o $(BINARY_NAME) ./cmd/plcbundle
# Install the CLI tool globallyinstall: @echo "Installing $(BINARY_NAME) $(VERSION)..." $(GOINSTALL) $(LDFLAGS) ./cmd/plcbundle
# Run teststest: @echo "Running tests..." $(GOTEST) -v ./...
# Run tests with coveragetest-coverage: @echo "Running tests with coverage..." $(GOTEST) -v -cover ./...
# Clean build artifactsclean: @echo "Cleaning..." $(GOCLEAN) rm -f $(BINARY_NAME)
# Format codefmt: @echo "Formatting code..." $(GOFMT) ./...
# Download dependenciesdeps: @echo "Downloading dependencies..." $(GOMOD) download $(GOMOD) tidy
# Verify dependenciesverify: @echo "Verifying dependencies..." $(GOMOD) verify
# Show current versionversion: @echo "Current version: $(VERSION)" @echo "Git commit: $(GIT_COMMIT)" @echo "Build date: $(BUILD_DATE)"
# Bump patch version (0.1.0 -> 0.1.1)bump-patch: @echo "Bumping patch version..." @./scripts/bump-version.sh patch
# Bump minor version (0.1.0 -> 0.2.0)bump-minor: @echo "Bumping minor version..." @./scripts/bump-version.sh minor
# Bump major version (0.1.0 -> 1.0.0)bump-major: @echo "Bumping major version..." @./scripts/bump-version.sh major
# Create a release (tags and pushes)release: @echo "Creating release for version $(VERSION)..." @./scripts/release.sh
# Show helphelp: @echo "Available targets:" @echo " make build - Build the CLI tool" @echo " make install - Install CLI tool globally" @echo " make test - Run tests" @echo " make test-coverage - Run tests with coverage" @echo " make clean - Clean build artifacts" @echo " make fmt - Format code" @echo " make deps - Download dependencies" @echo " make verify - Verify dependencies" @echo " make version - Show current version" @echo " make bump-patch - Bump patch version (0.1.0 -> 0.1.1)" @echo " make bump-minor - Bump minor version (0.1.0 -> 0.2.0)" @echo " make bump-major - Bump major version (0.1.0 -> 1.0.0)" @echo " make release - Create and push release tag" @echo " make help - Show this help"