-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathMakefile
127 lines (94 loc) · 2.36 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
default: build
PACKAGES := node_modules/.build
BUILD := build.json
ifeq ($(OS),Windows_NT)
WINBLOWS := true
#SHELL := powershell.exe
#.SHELLFLAGS := -C
else
T := $(shell uname -s)
ifeq ($(T),Linux)
LINUX := true
endif
ifeq ($(UNAME_S),Darwin)
MAC := true
endif
endif
MODS := $(CURDIR)/node_modules
NPATH := $(MODS)/.bin
TOOLPATH := $(CURDIR)/tools/bin
ifndef WINBLOWS
PAGES_SRC := $(shell find pages -type f)
endif
$(PACKAGES): package.json
npm install
echo "" > $@
$(BUILD): $(PAGES_SRC) $(PACKAGES) sass deps Makefile .git/index
node tools/bin/buildenv $@
build: $(BUILD)
run: $(BUILD)
npm start
run-debug: $(BUILD)
npm run start-debug
run-debug-brk: $(BUILD)
npm run start-debug-brk
unpacked: $(BUILD)
ifndef WINBLOWS
SKIP_NOTARIZE=1 npm run unpacked
else
npm run unpacked
endif
packed: $(BUILD)
ifndef WINBLOWS
SKIP_NOTARIZE=1 npm run build
else
npm run build
endif
publish: $(BUILD)
ifndef WINBLOWS
GH_TOKEN="$${GH_TOKEN_SAUCE4ZWIFT_RELEASE}" npm run publish
else
npm run publish
endif
publish-docker-linux-native:
docker build --build-arg arch=amd64 -t linux-s4z-build -f ./build/linux.Dockerfile .
docker run -it -v $$HOME/.git-credentials:/root/.git-credentials \
-e GH_TOKEN_SAUCE4ZWIFT_RELEASE -v $(CURDIR)/dist/docker-dist:/sauce4zwift/dist linux-s4z-build make publish
_publis-docker-linux-arm_DO_NOT_USE:
# Artifacts collide with non arm builds. I think this is possible to avoid but haven't dived in
# Also this takes like an hour or more to finish on highend 2023 AMD CPU, yikes.
docker build --build-arg arch=arm64 -t linux-s4z-build-arm -f ./build/linux.Dockerfile .
docker run -it -v $$HOME/.git-credentials:/root/.git-credentials \
-e GH_TOKEN_SAUCE4ZWIFT_RELEASE linux-s4z-build-arm make publish
deps:
$(MAKE) -j 32 -C pages/deps
$(MAKE) -j 32 -C shared/deps
sass:
$(NPATH)/sass pages/scss:pages/css
sass-watch:
$(NPATH)/sass pages/scss:pages/css --watch
lint:
$(NPATH)/eslint src shared pages/src
lint-watch:
ifndef WINBLOWS
ifdef LINUX
tools/bin/lintwatch
else
while true ; do \
$(MAKE) lint; \
sleep 5; \
done
endif
else
@echo Unsupported on winblows
endif
realclean: clean
rm -rf node_modules
clean:
rm -f $(BUILD)
rm -rf pages/css
$(MAKE) -C shared/deps clean
$(MAKE) -C pages/deps clean
test:
npm run test
.PHONY: build packed unpacked publish lint sass deps clean realclean test