-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
24 lines (21 loc) · 763 Bytes
/
Makefile
File metadata and controls
24 lines (21 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
DIST = www/dist
.PHONY: all
all: repl interpreter
.PHONY: repl
repl:
echo build repl
cd repl && npx elm-watch make --optimize
node compress-elm-js.mjs $(DIST)/repl/ulm-repl.js
.PHONY: interpreter
interpreter: miniBill-elm-interpreter/index.html
echo build minibill-elm-interpreter
# build js
cd miniBill-elm-interpreter && make optimize
# copy html file
cp $^ $(DIST)/minibill-elm-interpreter/
# copy js, append the git commit shorthash, compress it and use it in html
DIR=$(DIST)/minibill-elm-interpreter &&\
COMMIT=$$(git rev-parse --short HEAD:miniBill-elm-interpreter) &&\
cp miniBill-elm-interpreter/dist/ui.js $$DIR/ui.$$COMMIT.js &&\
node compress-elm-js.mjs $$DIR/ui.$$COMMIT.js &&\
sed -i "s|dist/ui.js|ui.$$COMMIT.js|" $$DIR/index.html