-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (31 loc) · 1.04 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
go_src := $(shell find -type f -name *.go)
sandstorm_exe := omd-sandstorm-grain
all: webui $(go_src)
go build ./...
sandstorm: cmd/$(sandstorm_exe)/$(sandstorm_exe)
cmd/$(sandstorm_exe)/$(sandstorm_exe): $(go_src)
cd cmd/$(sandstorm_exe) && go build
pack: omd.spk
omd.spk: sandstorm sandstorm-files.list
spk pack $@
dev: sandstorm
spk dev
clean:
cd $(webui) && rm -rf out
webui := pkg/webui
ui_deps := $(webui)/node_modules/.deps_installed
webui: $(webui)/out/bundle.min.js
ts_src := \
$(shell find $(webui)/src -type f -name '*.ts') \
$(shell find $(webui)/src -type f -name '*.tsx')
$(ui_deps): $(webui)/package.json
cd $(webui) && npm install
touch $@
$(webui)/out/.ts-build: $(ts_src) $(webui)/tsconfig.json $(ui_deps)
cd $(webui) && tsc
touch $@
$(webui)/out/bundle.js: $(webui)/out/.ts-build $(webui)/webpack.config.js
cd $(webui) && npx webpack
$(webui)/out/bundle.min.js: $(webui)/out/bundle.js $(ui_deps)
cd $(webui) && npx uglifyjs --compress --mangle < out/bundle.js > out/bundle.min.js
.PHONY: all webui dev sandstorm pack