forked from tidbyt/pixlet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (33 loc) · 930 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
GIT_COMMIT = $(shell git rev-list -1 HEAD)
ifeq ($(OS),Windows_NT)
BINARY = pixlet.exe
LDFLAGS = -ldflags="-s -extldflags=-static -X 'tidbyt.dev/pixlet/cmd.Version=$(GIT_COMMIT)'"
else
BINARY = pixlet
LDFLAGS = -ldflags="-X 'tidbyt.dev/pixlet/cmd.Version=$(GIT_COMMIT)'"
endif
all: build
test:
go test -v -cover ./...
clean:
rm -f $(BINARY)
rm -rf ./build
rm -rf ./out
bench:
go test -benchmem -benchtime=20s -bench BenchmarkRunAndRender tidbyt.dev/pixlet/encode
build:
go build $(LDFLAGS) -o $(BINARY) tidbyt.dev/pixlet
embedfonts:
go run render/gen/embedfonts.go
release-macos: clean
./scripts/release-macos.sh
release-linux: clean
./scripts/release-linux.sh
release-windows: clean
./scripts/release-windows.sh
install-buildifier:
go install github.com/bazelbuild/buildtools/buildifier@latest
lint:
@ buildifier --version >/dev/null 2>&1 || $(MAKE) install-buildifier
buildifier -r ./
format: lint