gohttpserver/Makefile
sneak 876f2d9a98
Some checks failed
continuous-integration/drone/push Build is failing
now supports remote error reporting to sentry, if desired
2020-09-30 21:59:20 -07:00

45 lines
727 B
Makefile

ARCH := $(shell uname -m)
VERSION := $(shell git describe --always --dirty=-dirty --exclude="*")
FN := http
UNAME_S := $(shell uname -s)
GOLDFLAGS += -X main.Version=$(VERSION)
GOLDFLAGS += -X main.Buildarch=$(ARCH)
GOFLAGS := -ldflags "$(GOLDFLAGS)"
default: debug
commit: fmt lint
git commit -a
fmt:
goimports -l -w .
golangci-lint run --fix
lint:
golangci-lint run
sh -c 'test -z "$$(gofmt -l .)"'
debug: ./$(FN)d
DEBUG=1 GOTRACEBACK=all ./$(FN)d
debugger:
cd cmd/$(FN)d && dlv debug main.go
run: ./$(FN)d
./$(FN)d
clean:
-rm -f ./$(FN)d debug.log
docker:
docker build .
get:
cd cmd/$(FN)d && go get -v
./$(FN)d: cmd/$(FN)d/main.go */*.go get
cd cmd/$(FN)d && go build -o ../../$(FN)d $(GOFLAGS) .