2023-02-05 13:41:11 -05:00
|
|
|
WASM=pkg/jotdown_wasm_bg.wasm
|
|
|
|
|
2023-04-04 13:27:20 -04:00
|
|
|
SRC=$(shell find . ../../src -name '*.rs')
|
2023-02-05 13:41:11 -05:00
|
|
|
|
|
|
|
${WASM}: ${SRC}
|
|
|
|
wasm-pack build --release --target web
|
|
|
|
|
|
|
|
wasm: ${WASM}
|
|
|
|
|
2023-03-26 10:33:38 -04:00
|
|
|
index.html: Makefile demo.html
|
|
|
|
echo '<!DOCTYPE html><html>' > $@
|
|
|
|
echo '<head>' >> $@
|
|
|
|
echo '<title>Jotdown Demo</title>' >> $@
|
|
|
|
echo '</head>' >> $@
|
2023-03-26 10:15:54 -04:00
|
|
|
echo '<body style="display:flex;flex-direction:column;height:100vh;margin:0">' >> $@
|
2023-03-26 10:33:38 -04:00
|
|
|
cat demo.html >> $@
|
|
|
|
echo '</body>' >> $@
|
|
|
|
echo '</html>' >> $@
|
|
|
|
|
|
|
|
run: ${WASM} index.html
|
2023-02-05 13:41:11 -05:00
|
|
|
python -m http.server
|
|
|
|
|
|
|
|
clean:
|
2023-03-26 10:33:38 -04:00
|
|
|
rm -rf pkg index.html
|
2023-02-05 13:41:11 -05:00
|
|
|
cargo clean
|