Files

26 lines
541 B
Makefile
Raw Permalink Normal View History

2025-04-21 21:13:23 +05:30
GO := go
BIN_DIR := bin
BIN := $(BIN_DIR)/pmg
2025-05-16 09:41:48 +05:30
SHELL := /bin/bash
GITCOMMIT := $(shell git rev-parse HEAD)
VERSION := "$(shell git describe --tags --abbrev=0)-$(shell git rev-parse --short HEAD)"
2025-08-21 23:01:30 +05:30
GO_CFLAGS=-X 'github.com/safedep/pmg/internal/version.Commit=$(GITCOMMIT)' -X 'github.com/safedep/pmg/internal/version.Version=$(VERSION)'
2025-05-16 09:41:48 +05:30
GO_LDFLAGS=-ldflags "-w $(GO_CFLAGS)"
2025-04-21 21:13:23 +05:30
.PHONY: all
all: pmg
pmg: create_bin
2025-05-16 09:41:48 +05:30
$(GO) build ${GO_LDFLAGS} -o $(BIN) main.go
2025-04-21 21:13:23 +05:30
create_bin:
mkdir -p $(BIN_DIR)
clean:
rm -rf $(BIN_DIR)
test:
go test ./...