~evanj/cms

ref: tmp cms/makefile -rw-r--r-- 507 bytes
c2127369Evan M Jones ignore 5 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
include .env
export $(shell sed 's/=.*//' .env)

BIN=cms

all: vendor gen build

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

build:
	go build -ldflags="-s -w" -o $(BIN)

gen: 
	go generate ./...

test: 
	go test ./...

run: all
	./$(BIN)

dev: dev-server dev-client

dev-client:
	find . -type f \( -name '*.html' -o -name '*.css' -o -name '*.js' \) | entr -r sh -c "make gen"

dev-server:
	find . -type f -name '*.go' | entr -r sh -c "clear && make build && ./$(BIN)"