~evanj/cms

ref: 977e0de28ca8f9d30d073665642e89fddfde493f cms/makefile -rw-r--r-- 854 bytes
977e0de2Evan J Feat(cms.go): Retrying if requests last too long. Effective max request 1 year, 10 days 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
36
37
38
BIN=cms
ENV=`cat .env`
VER=`git rev-parse HEAD`
CC=go1.15

all: setup vendor gen build

setup:
	@go get golang.org/dl/go1.15
	@go1.15 download
	@$(CC) get git.sr.ht/~evanj/embed/cmd/embed
	@$(CC) get github.com/golang/mock/mockgen

vendor: go.mod go.sum
	@$(CC) mod tidy
	@$(CC) mod vendor

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

gen: 
	@$(CC) generate ./...

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

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

lint: 
	@find * -not -name '*_embed.go' | grep -E '*.(sql|go|js|css|html)' | entr -cr $(CC) 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