forked from playmint/ds
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
97 lines (73 loc) · 2.72 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# configure path to unity
UNITY_EDITOR_VERSION := 2021.3.13f1
ifeq ($(OS),Windows_NT)
UNITY_EDITOR := C:\Program Files\Unity\Hub\Editor\$(UNITY_EDITOR_VERSION)\Editor\Unity.exe
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
UNITY_EDITOR := /Applications/Unity/Hub/Editor/$(UNITY_EDITOR_VERSION)/Unity.app/Contents/MacOS/Unity
else
UNITY_EDITOR := /Applications/Unity/Hub/Editor/$(UNITY_EDITOR_VERSION)/Unity.app/Contents/Linux/Unity
endif
endif
# srcs
COG_SERVICES_SRC := $(shell find contracts/lib/cog/services -name '*.go')
CORE_GRAPHQL_SRC := $(shell find core/src -name '*.graphql')
CORE_TS_SRC := $(shell find core/src -maxdepth 1 -name '*.ts')
# paths to tools
NODE := node
NPM := npm
all: node_modules contracts/lib/cog/services/bin/ds-node cli core/dist/core.js frontend/public/ds-unity/Build/ds-unity.wasm
map:
$(UNITY_EDITOR) -batchmode -quit -projectPath ./map -executeMethod BuildScript.GitHubBuild -buildTarget WebGL -logFile -
debugmap:
$(UNITY_EDITOR) -batchmode -quit -projectPath ./map -executeMethod BuildScript.DevBuild -buildTarget WebGL -logFile -
dev: all docs
$(NODE) .devstartup.js
compose: frontend/public/ds-unity/Build/ds-unity.wasm
docker compose up --build
contracts/out/Actions.sol/Actions.json:
(cd contracts && forge build)
contracts:
(cd contracts && forge build)
core: core/dist/core.js
core/dist/core.js: $(CORE_GRAPHQL_SRC) $(CORE_TS_SRC) contracts/out/Actions.sol/Actions.json
(cd core && npm run build)
frontend/public/ds-unity/Build/ds-unity.wasm:
$(MAKE) map
node_modules: package.json package-lock.json
$(NPM) ci
touch $@
contracts/lib/cog/services/bin/ds-node: contracts/lib/cog/services/Makefile $(COG_SERVICES_SRC)
$(MAKE) -C contracts/lib/cog/services bin/ds-node
cli: node_modules core/dist/core.js
(cd cli && $(NPM) run build && $(NPM) install -g --force .)
docs/node_modules: docs/package.json docs/package-lock.json
(cd docs && $(NPM) ci)
docs: docs/node_modules
publish: cli
(cd cli && $(NPM) version patch && $(NPM) publish)
release: contracts node_modules cli
./scripts/release.mjs -i
clean:
rm -rf cli/dist
rm -rf cli/node_modules
rm -f contracts/lib/cog/services/bin/ds-node
rm -rf contracts/out
rm -rf contracts/broadcast
rm -rf contracts/cache
rm -rf core/dist
rm -rf core/src/gql
rm -rf core/src/abi
rm -rf core/node_modules
rm -f frontend/public/ds-unity/Build/ds-unity.wasm
rm -rf frontend/public/ds-unity
rm -rf frontend/dist
rm -rf frontend/node_modules
rm -rf docs/node_modules
rm -rf docs/.docusaurus
rm -rf docs/build
rm -rf node_modules
$(MAKE) -C contracts/lib/cog/services clean
.PHONY: all clean dev docs map compose debugmap cli contracts release
.SILENT: contracts/lib/cog/services/bin/ds-node frontend/public/ds-unity/Build/ds-unity.wasm