-
-
Notifications
You must be signed in to change notification settings - Fork 28
/
Makefile
86 lines (66 loc) · 2.6 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
help:
@echo "Simple Makefile to build LiaScript locally"
@echo ""
@echo "make install - same as 'npm i' will install"
@echo "make all - will build the entire app as a PWA"
@echo "make all2 - same as above, but with elm-optimize2"
@echo "make editor - will build the editor in branch 'editor'"
@echo " note that the target is different"
@echo " no indexeddb support"
@echo "make editor2 - same as above, but with elm-optimize2"
@echo "make lib - make the library"
@echo "make lib2 - make the library with elm-optimize2"
@echo "make clean - delete dist folder"
@echo "make ... KEY='adfia2' - if you want to host this app by your own,"
@echo " you will have to get a responsivevoice-API key"
@echo " your key can be passed via the KEY parameter"
clean:
rm -rf dist
minify:
npm run minify:js
all: clean app index manifest responsivevoice preview
rm dist/*.md
all2: optimize all deoptimize minify
editor: base index responsivevoice
rm dist/README.md
editor2: optimize editor deoptimize minify
library: lib index
rm dist/README.md
library2: optimize lib deoptimize minify
base:
npm run build:base
lib:
npm run build:library
app:
npm run build
index:
sed -i "s/href=\"logo\./href=\".\/logo./g" dist/index.html
sed -i "s/href=\"index\./href=\".\/index./g" dist/index.html
sed -i "s/href=\"manifest\./href=\".\/manifest./g" dist/index.html
sed -i "s/href=\"up\_/href=\".\/up_/g" dist/index.html
sed -i "s/src=\"index\./src=\".\/index./g" dist/index.html
sed -i "s/content=\"up\_\/up\_/content=\".\/up_\/up_/g" dist/index.html
sed -i "s/src:local(\"\")/src:local(\"\.\")/g" dist/index.*.css
sed -i "s/url(\//url(/g" dist/index.*.css
responsivevoice:
if [ -z "$(KEY)" ]; then \
echo "NO responsivevoice key ... "; \
else \
sed -i "s/<\/head>/<script defer async src=\"https:\/\/code.responsivevoice.org\/responsivevoice.js?key=$(KEY)\"><\/script><\/head>/g" dist/index.html ; \
fi
manifest:
sed -i "s/\"logo_/\".\/logo_/g" dist/manifest.webmanifest
sed -i "s/\"up_/\".\/up_/g" dist/manifest.webmanifest
sed -i "s/\"index\.html/\".\/index.html/g" dist/manifest.webmanifest
preview:
npm run build:preview
watch:
npm run watch
install:
npm run i
optimize:
sed -i "s/elm\/Main.elm/..\/elm.js/g" src/typescript/liascript/index.ts
elm-optimize-level-2 -O3 src/elm/Main.elm
deoptimize:
sed -i "s/\.\.\/elm.js/elm\/Main\.elm/g" src/typescript/liascript/index.ts
rm elm.js