1
0
mirror of https://github.com/strongdm/comply synced 2024-11-25 00:54:54 +00:00
comply/vendor/github.com/Clever/gitsem/Makefile

52 lines
1.3 KiB
Makefile
Raw Normal View History

include golang.mk
.DEFAULT_GOAL := test # override default goal set in library makefile
2019-07-14 16:51:10 +00:00
SHELL := /bin/bash
PKG := github.com/Clever/gitsem
PKGS := $(shell go list ./... | grep -v /vendor)
2019-07-14 16:51:10 +00:00
EXECUTABLE := gitsem
VERSION := $(shell cat VERSION)
2019-07-14 16:51:10 +00:00
BUILDS := \
build/$(EXECUTABLE)-v$(VERSION)-darwin-amd64 \
build/$(EXECUTABLE)-v$(VERSION)-linux-amd64 \
build/$(EXECUTABLE)-v$(VERSION)-windows-amd64
COMPRESSED_BUILDS := $(BUILDS:%=%.tar.gz)
RELEASE_ARTIFACTS := $(COMPRESSED_BUILDS:build/%=release/%)
.PHONY: test golint build vendor
2019-07-14 16:51:10 +00:00
$(eval $(call golang-version-check,1.13))
2019-07-14 16:51:10 +00:00
test: $(PKGS)
$(PKGS): golang-test-all-strict-deps
$(call golang-test-all-strict,$@)
2019-07-14 16:51:10 +00:00
run:
@go run main.go
build:
go build -o bin/$(EXECUTABLE) $(PKG)
2019-07-14 16:51:10 +00:00
build/$(EXECUTABLE)-v$(VERSION)-darwin-amd64:
GOARCH=amd64 GOOS=darwin go build -o "$@/$(EXECUTABLE)"
build/$(EXECUTABLE)-v$(VERSION)-linux-amd64:
GOARCH=amd64 GOOS=linux go build -o "$@/$(EXECUTABLE)"
build/$(EXECUTABLE)-v$(VERSION)-windows-amd64:
GOARCH=amd64 GOOS=windows go build -o "$@/$(EXECUTABLE).exe"
build: $(BUILDS)
%.tar.gz: %
tar -C `dirname $<` -zcvf "$<.tar.gz" `basename $<`
$(RELEASE_ARTIFACTS): release/% : build/%
mkdir -p release
cp $< $@
release: $(RELEASE_ARTIFACTS)
clean:
rm -rf build release
install_deps:
go mod vendor