~evanj/cms

ref: tip cms/makefile -rw-r--r-- 916 bytes
26671b0cEvan J Feat(file.go): Upload files concurrently complete. Fixed bug in E3 path 2 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
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 ./... -cover -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