merp/Makefile

31 lines
616 B
Makefile
Raw Normal View History

2019-10-03 19:30:04 +00:00
VERSION := $(shell git rev-parse --short HEAD)
BUILDTIME := $(shell date -u '+%Y-%m-%dT%H:%M:%SZ')
BUILDUSER := $(shell whoami)
BUILDHOST := $(shell hostname -s)
BUILDARCH := $(shell uname -m)
GOLDFLAGS += -X main.Version=$(VERSION)
GOLDFLAGS += -X main.Buildtime=$(BUILDTIME)
GOLDFLAGS += -X main.Builduser=$(BUILDUSER)@$(BUILDHOST)
GOLDFLAGS += -X main.Buildarch=$(BUILDARCH)
GOFLAGS = -ldflags "$(GOLDFLAGS)"
default: run
run: build
2019-10-25 15:09:31 +00:00
DEBUG=1 ./pooteeweet
2019-10-03 19:30:04 +00:00
build: ./pooteeweet
./pooteeweet: *.go
go build -o $@ $(GOFLAGS) .
2019-10-03 19:35:33 +00:00
clean:
rm pooteeweet
2019-10-03 19:30:04 +00:00
fmt:
go fmt *.go
test:
docker build -t sneak/pooteeweet .