Skip to content

Commit

Permalink
Aligned Makefile with the release in Github remote
Browse files Browse the repository at this point in the history
  • Loading branch information
mdm-code committed Feb 4, 2024
1 parent 4cc6d8f commit b8795f9
Showing 1 changed file with 18 additions and 25 deletions.
43 changes: 18 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,45 +1,38 @@
GO=go
GOFLAGS=-race
DEV_BIN=bin
COV_PROFILE=cp.out
GOFLAGS=
COV_PROFILE=coverage.txt

export CGO_ENABLED = 1
export CGO_ENABLED=0

.DEFAULT_GOAL := build

.PHONY: fmt vet lint test install build cover clean

fmt:
$(GO) fmt ./...
.PHONY: fmt
@$(GO) fmt ./...

vet: fmt
$(GO) vet ./...
.PHONY: vet
@$(GO) vet ./...

lint: vet
golint -set_exit_status=1 ./...
.PHONY: lint
@golint -set_exit_status=1 ./...

test: lint
$(GO) clean -testcache
$(GO) test ./... -v
.PHONY: test
@$(GO) clean -testcache
@$(GO) test ./... -v

install: test
$(GO) install ./...
.PHONY: install
@$(GO) install ./...

build: test
$(GO) build $(GOFLAGS) github.com/mdm-code/termcols/...
.PHONY: build
@$(GO) build $(GOFLAGS) github.com/mdm-code/termcols/...

cover:
$(GO) test -coverprofile=$(COV_PROFILE) -covermode=atomic ./...
$(GO) tool cover -html=$(COV_PROFILE)
.PHONY: cover
@$(GO) test -coverprofile=$(COV_PROFILE) -covermode=atomic ./...
@$(GO) tool cover -html=$(COV_PROFILE)

clean:
$(GO) clean github.com/mdm-code/termcols/...
$(GO) mod tidy
$(GO) clean -testcache
rm -f $(COV_PROFILE)
.PHONY: clean
@$(GO) clean github.com/mdm-code/termcols/...
@$(GO) mod tidy
@$(GO) clean -testcache
@rm -f $(COV_PROFILE)

0 comments on commit b8795f9

Please sign in to comment.