-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (33 loc) · 1.22 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
all: main.js style.css
main.js: Main.gren Lang.gren Bench.gren
gren make --optimize Main.gren --output main.js
style.css: Main.gren tailwind.config.js
tailwindcss -o style.css
Lang.gren: Lang.gren.in def.m4 Makefile lang/*
sed -s '1s/^/ , { /;1!s/^ / /;1!s/^\([^ ]\)/ , \1/;$$s/$$/\n }/' lang/* > langlist
sed -i '1s/^ , / [ /;$$s/$$/\n ]/' langlist
m4 Lang.gren.in > Lang.gren
echo 'langs =' >> Lang.gren
cat langlist >> Lang.gren
Bench.gren: Makefile
touch helloworld.bench
echo 'module Bench exposing(..)' > Bench.gren
echo >> Bench.gren
echo 'helloworld : String -> Int' >> Bench.gren
echo 'helloworld s = case s of' >> Bench.gren
sed 's/^/ /' helloworld.bench >> Bench.gren
echo ' _ -> 0' >> Bench.gren
echo >> Bench.gren
minify: main.js style.css
minify -o main.js main.js
minify -o style.css style.css
clean:
rm -f main.js style.css Lang.gren langlist Bench.gren helloworld.bench
benchmark: helloworld.bench
$(MAKE) -B Bench.gren
helloworld.bench: $(addsuffix result,$(wildcard benchmark/helloworld/*/))
cat $^ > helloworld.bench
benchmark/helloworld/%/result:
docker build -t helloworld $(dir $@)
docker run --rm helloworld cat result > $(dir $@)result
.PHONY: all minify clean benchmark