git-project-manager/Makefile

34 lines
920 B
Makefile
Raw Normal View History

2024-12-19 19:51:26 +00:00
CMD_NAME := git-project-manager
.PHONY: all test build install docs clean
2025-01-01 01:51:04 +00:00
VERSION ?= development # Default to "development" if VERSION is not set
2025-01-01 02:16:05 +00:00
PLATFORMS := linux/amd64 linux/arm64 darwin/amd64 darwin/arm64
OUTPUT_DIR := bin
PKG := gitea.libretechconsulting.com/rmcguire/git-project-manager
2025-01-01 01:51:04 +00:00
2024-12-19 19:51:26 +00:00
all: test build install docs
test:
go test -v ./...
build: test
2025-01-01 02:16:05 +00:00
@echo "Building for platforms: $(PLATFORMS)"
@for platform in $(PLATFORMS); do \
OS=$$(echo $$platform | cut -d/ -f1); \
ARCH=$$(echo $$platform | cut -d/ -f2); \
OUTPUT="$(OUTPUT_DIR)/$(CMD_NAME)-$$OS-$$ARCH"; \
GOOS=$$OS GOARCH=$$ARCH go build -ldflags "-X $(PKG)/cmd.Version=$(VERSION)" -o $$OUTPUT; \
echo "Built $$OUTPUT"; \
done
go build -ldflags "-X $(PKG)/cmd.Version=$(VERSION)" -o bin/${CMD_NAME}
2024-12-19 19:51:26 +00:00
install:
2025-01-01 02:16:05 +00:00
go install -v -ldflags "-X $(PKG)/cmd.Version=$(VERSION)" .
2024-12-19 19:51:26 +00:00
docs:
bin/${CMD_NAME} docs md
clean:
rm -rf bin/${CMD_NAME}