You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
429 B
Makefile
24 lines
429 B
Makefile
GO ?= go
|
|
GOFMT ?= gofmt
|
|
|
|
NAME = lenpaste
|
|
MAIN_GO = ./cmd/*.go
|
|
|
|
export GOMODULE111=on
|
|
LDFLAGS = -w -s -X "main.Version=$(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')"
|
|
|
|
|
|
.PHONY: all fmt clean
|
|
|
|
all:
|
|
mkdir -p ./dist/bin/
|
|
|
|
$(GO) build -trimpath -ldflags="$(LDFLAGS)" -o ./dist/bin/$(NAME) $(MAIN_GO)
|
|
chmod +x ./dist/bin/$(NAME)
|
|
|
|
fmt:
|
|
@$(GOFMT) -w $(shell find ./ -type f -name '*.go')
|
|
|
|
clean:
|
|
rm -rf ./dist/
|