Created
October 11, 2017 11:53
-
-
Save ukdave/4078a559af8acaa110780eed0e1cba37 to your computer and use it in GitHub Desktop.
Makefile for go projects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: vet test build ok | |
vet: | |
$(call announce,"Running vet") | |
go vet ./... | |
test: | |
$(call announce,"Running tests") | |
go test ./... | |
build: | |
$(call announce,"Building") | |
go build | |
ok: | |
@echo | |
@export TERM=xterm; echo "$$(tput setaf 1)*$$(tput setaf 3)*$$(tput setaf 2)*$$(tput setaf 4)*$$(tput setaf 5)*$$(tput setaf 2) ALL TESTS PASSED $$(tput setaf 5)*$$(tput setaf 4)*$$(tput setaf 2)*$$(tput setaf 3)*$$(tput setaf 1)*$$(tput sgr0)" | |
define announce | |
@echo | |
@export TERM=xterm; echo "$$(tput setaf 4)$$(tput smul)* $(1)$$(tput rmul)$$(tput sgr0)" | |
endef | |
.PHONY: vet test build ok |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment