forked from wowsims/wotlk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
68 lines (52 loc) · 1.48 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
OUT_DIR=dist/wotlk
$(OUT_DIR):
task
ui_shared:
task ui_shared -- $(OUT_DIR)
.PHONY: clean
clean:
task clean
.PHONY: host
host:
task host -- $(OUT_DIR)
.PHONY: wasm
wasm:
task wasm -- $(OUT_DIR)
# Builds the web server with the compiled client.
.PHONY: wowsimwotlk
wowsimwotlk:
task devserver
.PHONY: devserver
devserver:
task devserver
rundevserver:
task rundevserver
.PHONY: test
test:
task test
.PHONY: update-tests
update-tests:
task update-tests
release: wowsimwotlk
GOOS=windows GOARCH=amd64 go build -o wowsimwotlk-windows.exe -ldflags="-X 'main.Version=$(VERSION)'" ./sim/web/main.go
GOOS=darwin GOARCH=amd64 go build -o wowsimwotlk-amd64-darwin -ldflags="-X 'main.Version=$(VERSION)'" ./sim/web/main.go
GOOS=linux GOARCH=amd64 go build -o wowsimwotlk-amd64-linux -ldflags="-X 'main.Version=$(VERSION)'" ./sim/web/main.go
.PHONY: items
items: sim/core/items/all_items.go sim/core/proto/api.pb.go
sim/core/items/all_items.go: generate_items/*.go $(call rwildcard,sim/core/proto,*.go)
go run generate_items/*.go -outDir=sim/core/items
gofmt -w ./sim/core/items
.PHONY: fmt
fmt: tsfmt
gofmt -w ./sim
gofmt -w ./generate_items
.PHONY: tsfmt
tsfmt:
for dir in $$(find ./ui -maxdepth 1 -type d -not -path "./ui" -not -path "./ui/worker"); do \
echo $$dir; \
npx tsfmt -r --useTsfmt ./tsfmt.json --baseDir $$dir; \
done
# one time setup to install pre-commit hook for gofmt and npm install needed packages
setup:
cp pre-commit .git/hooks
chmod +x .git/hooks/pre-commit