1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
export GO111MODULE=off
GO := go
BUILDDIR := build
all: $(BUILDDIR)
.PHONY: vendor
vendor:
export GO111MODULE=on \
$(GO) mod tidy && \
$(GO) mod vendor && \
$(GO) mod verify
define go-build
$(shell cd `pwd` && $(GO) build -o $(BUILDDIR)/$(shell basename $(1)) $(1))
@echo > /dev/null
endef
.PHONY: clean
clean:
rm -rf $(BUILDDIR)
$(BUILDDIR): \
$(BUILDDIR)/ffjson \
$(BUILDDIR)/git-validation \
$(BUILDDIR)/go-md2man \
$(BUILDDIR)/golangci-lint
$(BUILDDIR)/ffjson:
$(call go-build,./vendor/github.com/pquerna/ffjson)
$(BUILDDIR)/git-validation:
$(call go-build,./vendor/github.com/vbatts/git-validation)
$(BUILDDIR)/go-md2man:
$(call go-build,./vendor/github.com/cpuguy83/go-md2man)
$(BUILDDIR)/golangci-lint:
export \
VERSION=v1.24.0 \
URL=https://raw.githubusercontent.com/golangci/golangci-lint \
BINDIR=$(BUILDDIR) && \
curl -sfL $$URL/$$VERSION/install.sh | sh -s $$VERSION
|