-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
28 lines (20 loc) · 718 Bytes
/
Copy pathMakefile
File metadata and controls
28 lines (20 loc) · 718 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
EXE=chess3
# only enable SPSA for SPSA tuning.
SPSA ?= 0
GIT_VERSION := $(shell git describe --tags --always --dirty)
LDFLAGS := -X github.com/paulsonkoly/chess-3/uci.GitVersion=$(GIT_VERSION)
files := $(shell find . -name '*.go')
# Optional build tags
ifeq ($(SPSA),1)
GO_TAGS := -tags spsa
else
GO_TAGS :=
endif
$(EXE): chess3.pprof $(files)
go build $(GO_TAGS) -ldflags "$(LDFLAGS)" -pgo chess3.pprof -o $@ main.go
$(EXE).exe: chess3.pprof $(files)
env GOOS=windows GOARCH=amd64 go build $(GO_TAGS) -ldflags "$(LDFLAGS)" -pgo chess3.pprof -o $@ main.go
chess3.pprof: $(EXE).nopgo $(files)
./$(EXE).nopgo -cpuProf $@ bench
$(EXE).nopgo: $(files)
go build $(GO_TAGS) -ldflags "$(LDFLAGS)" -o $@ main.go