~evanj/cms

ref: 398a8759a304b7c11624c9f3642c3c6c07d2ab79 cms/makefile -rw-r--r-- 763 bytes
398a8759Evan M Jones WIP(rbac): Large DB interface refactor. Prep for rbac work. TODO: All 1 year, 1 month 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