-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
52 lines (40 loc) · 1.18 KB
/
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
50
51
52
GIT_COMMIT := $(shell git rev-parse --short HEAD)
ifeq ($(RELEASE), 1)
BINDATA_DEBUG_FLAG :=
else
BINDATA_DEBUG_FLAG := -debug
endif
.PHONY: all
.PHONY: build
build: clean build-css copy-web-assets
go build -tags release -o dist/proxytv -ldflags "-X 'main.gitCommit=$(GIT_COMMIT)'" ./cmd/main.go
.PHONY: linux
linux: clean dist
GOOS=linux GOARCH=arm64 $(MAKE) build
.PHONY: dist
dist:
mkdir -p dist
.PHONY: setup
setup:
go mod download
go install github.com/go-bindata/go-bindata/v3/[email protected]
.PHONY: tidy
tidy:
go mod tidy
.PHONY: test
test: build-css copy-web-assets
go test -tags debug -v ./...
.PHONY: clean
clean:
rm -rf dist data
.PHONY: copy-web-assets
copy-web-assets:
mkdir -p data/static data/templates
go-bindata -fs -prefix "web/static/" -o ./data/static/bindata.go -pkg static $(BINDATA_DEBUG_FLAG) web/static/...
go-bindata -fs -prefix "web/templates/" -o ./data/templates/bindata.go -pkg templates $(BINDATA_DEBUG_FLAG) web/templates/...
.PHONY: build-css
build-css:
tailwindcss -i ./web/static/css/styles.css -o ./web/static/css/output.css --minify
.PHONY: watch-css
watch-css:
tailwindcss -i ./web/static/css/styles.css -o ./web/static/css/output.css --watch