~evanj/cms

ref: 5eb977545bd0bfaacf289952a8b7f5a273168ab6 cms/makefile -rw-r--r-- 763 bytes
5eb97754Evan M Jones Chore(Error2 -> Error): Swapped Error impl. for Error2 in all 8 months ago
                                                                                
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
BIN=cms
ENV=`cat .env`
VER=`git rev-parse HEAD`

all: setup vendor gen build

setup:
	@go get git.sr.ht/~evanj/embed/cmd/embed
	@go get github.com/golang/mock/mockgen

vendor: go.mod go.sum
	@go mod tidy
	@go mod vendor

build:
	@echo $(VER) | xargs -I {} go build -ldflags='-s -w -X main.build={}' -o $(BIN)

gen: 
	@go generate ./...

test: 
	@env $(ENV) go test ./... -count 1

coverage: 
	@env $(ENV) go test ./... -cover -coverprofile=coverage.out ; go tool cover -html=coverage.out

lint: 
	@find * -not -name '*_embed.go' | grep -E '*.(sql|go|js|css|html)' | entr -cr go vet ./...

run: gen build
	@clear
	@env $(ENV) ./$(BIN)

dev:
	@find * -not -name '*_embed.go' | grep -E '*.(sql|go|js|css|html)' | entr -cr make run