~evanj/cms

ref: f2ad8887d95788430ed361e00b18eec1699b2253 cms/makefile -rw-r--r-- 909 bytes
f2ad8887Evan J Feat(vendor): Updating deps. 1 year, 18 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:
	@env GOMOD=off go get golang.org/dl/go1.15
	@env GOMOD=off $(CC) download
	@env GOMOD=off $(CC) get git.sr.ht/~evanj/embed/cmd/embed
	@env GOMOD=off $(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