forked from foxtri4/Kasen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (31 loc) · 836 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
PLATFORMS=linux
ARCHITECTURES=386 amd64
LDFLAGS=-ldflags="-s -w"
default: build
all: vet test build build-view
vet:
go vet
test:
go test ./... -v -timeout 10m
pprof-profile:
go tool pprof -http=:41001 http://localhost:42072/debug/pprof/profile
pprof-heap:
go tool pprof -http=:41002 http://localhost:42072/debug/pprof/heap
build:
$(foreach GOOS,$(PLATFORMS),\
$(foreach GOARCH,$(ARCHITECTURES),\
$(shell GOOS=$(GOOS) GOARCH=$(GOARCH))\
$(shell go build $(LDFLAGS) -o bin/kasen_$(GOOS)-$(GOARCH))\
$(shell go build $(LDFLAGS) -o bin/kasen-image_$(GOOS)-$(GOARCH) internal/cmd/image/image.go)\
)\
)
build-web:
cd web && yarn && yarn prod
run:
cd bin && ./kasen_linux-amd64
dev:
cd bin && ./kasen_linux-amd64 -mode=development
dev-web:
cd web && yarn && yarn dev
.EXPORT_ALL_VARIABLES:
MALLOC_ARENA_MAX=2