-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (33 loc) · 673 Bytes
/
Makefile
File metadata and controls
40 lines (33 loc) · 673 Bytes
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
PRODUCT=fuse
GOOS=linux
GOARCH=amd64
NAME=$(PRODUCT)-$(GOOS)-$(GOARCH)$(EXT)
EXT=
ifeq ($(GOOS),windows)
override EXT=.exe
endif
# alpine image doesn't have git = no vcs info
IMAGE=golang:1.24.5
DOCKER=docker run -t --rm \
-u $$(id -u):$$(id -g) \
-v $$(pwd):$$(pwd) \
-w $$(pwd) \
-e GOCACHE=/tmp \
-e CGO_ENABLED=0 \
-e GOOS=$(GOOS)\
-e GOARCH=$(GOARCH) \
$(IMAGE)
clean:
-rm handlers/testdb.dat*
test: clean
$(DOCKER) go test -v ./...
build:
$(DOCKER) go build -trimpath \
-buildvcs=true \
-o $(NAME)
gen:
-cd seedgen && go run main.go
release: test gen
$(MAKE) GOOS=linux build
$(MAKE) GOOS=windows build
.DEFAULT_GOAL := release