-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (40 loc) · 908 Bytes
/
Makefile
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
39
40
41
42
43
44
45
46
47
48
49
PACKAGES := $(shell go list ./...)
name := $(shell basename ${PWD})
all: help
.PHONY: help
help: Makefile
@echo
@echo " Choose a make command to run"
@echo
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
@echo
## init: initialize project (make init module=github.com/user/project)
.PHONY: init
init:
go mod init ${module}
go install github.com/cosmtrek/air@latest
asdf reshim golang
## vet: vet code
.PHONY: vet
vet:
go vet $(PACKAGES)
## test: run unit tests
.PHONY: test
test:
go test -race -cover $(PACKAGES)
## build: build a binary
.PHONY: build
build: test
go build -o ./app -v
## start: build and run local project
.PHONY: start
start: build
air
## css: build tailwindcss
.PHONY: css
css:
tailwindcss -i css/input.css -o css/output.css --minify
## css-watch: watch build tailwindcss
.PHONY: css-watch
css-watch:
tailwindcss -i css/input.css -o css/output.css --watch