1010
1111# Generate README.md from lexer definitions
1212readme :
13- #!/usr/bin/env sh
13+ #!/usr/bin/env bash
1414 GOOS= GOARCH= ./ table.py
1515
1616# Generate tokentype_string.go
@@ -23,24 +23,30 @@ format-js:
2323
2424# Build chromad binary
2525chromad : wasm-exec chroma-wasm
26+ #!/usr/bin/env bash
2627 rm -rf build
27- esbuild --platform=browser --format=esm --bundle cmd/ chromad/ static/ index.js --minify --external:./ wasm_exec.js --outfile=cmd/ chromad/ static/ index.min.js
28- esbuild --bundle cmd/ chromad/ static/ index.css --minify --outfile=cmd/ chromad/ static/ index.min.css
28+ mk cmd/ chromad/ static/ index.min.js : cmd/ chromad/ static/ {index,chroma}.js -- \
29+ esbuild --platform=browser --format=esm --bundle cmd/ chromad/ static/ index.js --minify --external:./ wasm_exec.js --outfile=cmd/ chromad/ static/ index.min.js
30+ mk cmd/ chromad/ static/ index.min.css : cmd/ chromad/ static/ index.css -- \
31+ esbuild --bundle cmd/ chromad/ static/ index.css --minify --outfile=cmd/ chromad/ static/ index.min.css
2932 cd cmd/ chromad && CGOENABLED=0 go build -ldflags=" -X 'main.version={{ version }} '" -o ../ ../ build/ chromad .
3033
3134# Copy wasm_exec.js from TinyGo
3235wasm-exec :
33- #!/usr/bin/env sh
36+ #!/usr/bin/env bash
3437 tinygoroot=$(tinygo env TINYGOROOT)
35- install -m644 " $tinygoroot/targets/wasm_exec.js" cmd/ chromad/ static/ wasm_exec.js
38+ mk cmd/ chromad/ static/ wasm_exec.js : " $tinygoroot/targets/wasm_exec.js" -- \
39+ install -m644 " $tinygoroot/targets/wasm_exec.js" cmd/ chromad/ static/ wasm_exec.js
3640
3741# Build WASM binary
3842chroma-wasm :
39- #!/usr/bin/env sh
43+ #!/usr/bin/env bash
4044 if type tinygo > / dev/ null 2 >&1 ; then
41- tinygo build -no-debug -target wasm -o cmd/ chromad/ static/ chroma.wasm cmd/ libchromawasm/ main.go
45+ mk cmd/ chromad/ static/ chroma.wasm : cmd/ libchromawasm/ main.go -- \
46+ tinygo build -no-debug -target wasm -o cmd/ chromad/ static/ chroma.wasm cmd/ libchromawasm/ main.go
4247 else
43- GOOS=js GOARCH=wasm go build -o cmd/ chromad/ static/ chroma.wasm cmd/ libchromawasm/ main.go
48+ mk cmd/ chromad/ static/ chroma.wasm : cmd/ libchromawasm/ main.go -- \
49+ GOOS=js GOARCH=wasm go build -o cmd/ chromad/ static/ chroma.wasm cmd/ libchromawasm/ main.go
4450 fi
4551
4652# Upload chromad to server
0 commit comments