Files
pmg/Makefile
T

26 lines
531 B
Makefile
Raw 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)"
GO_CFLAGS=-X 'github.com/safedep/pmg/cmd/version.commit=$(GITCOMMIT)' -X 'github.com/safedep/pmg/cmd/version.version=$(VERSION)'
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 ./...