gohttpserver/Makefile
sneak c19f9d0eb2
Some checks failed
continuous-integration/drone/push Build is failing
seems to embed files
2020-10-28 16:46:22 -07:00

49 lines
895 B
Makefile

ARCH := $(shell uname -m)
VERSION := $(shell git describe --always --dirty=-dirty)
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
# get golangci-lint with:
# go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.31.0
# get gofumports with:
# go get mvdan.cc/gofumpt/gofumports
fmt:
gofumports -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 --progress plain .
./$(FN)d: cmd/$(FN)d/main.go */*.go
cd httpserver && \
go generate && \
cd ../cmd/$(FN)d && \
go build -o ../../$(FN)d $(GOFLAGS) .