-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
65 lines (54 loc) · 1.18 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
NODE_BIN = $(PWD)/node_modules/.bin
OS=$(shell uname -s)
VERSION=$(shell cat version)
# no pun intended
out: \
clean \
package.json \
node_modules \
dist \
$(shell find icons) \
$(shell find patch-repo) \
electron.js \
forge.config.js
@$(NODE_BIN)/electron-forge make
@touch -c out
.PHONY: clean
clean:
@echo "Cleaning"
@rm -rf elm-stuff
@rm -rf dist
@rm -rf out
node_modules: package.json
@yarn
@touch -c node_modules
src/manifest.json: version
@echo '{"version": "$(VERSION)", "os": "$(OS)"}' > $@
package.json: version
@jq '.version = "$(VERSION)"' package.json > package.json.tmp
@mv package.json.tmp package.json
EXE=
ifneq (,$(findstring MINGW,$(OS)))
EXE=gc-core.exe
else
EXE=gc-core
endif
dist/$(EXE):
@$(MAKE) -C backend
@mkdir -p dist
@cp backend/result/bin/$(EXE) $@
dist: \
node_modules \
$(shell find src) \
src/manifest.json \
dist/$(EXE)
@$(NODE_BIN)/parcel build --no-source-maps --no-content-hash --target electron --public-url . src/index.html --out-dir $@
@touch -c dist
.PHONY: dev
dev: \
node_modules \
src/manifest.json
@$(NODE_BIN)/parcel watch --target electron --public-url . src/index.html
.PHONY: open
open:
@electron electron.js --dev