mirror of
https://github.com/odin-lang/Odin.git
synced 2025-12-31 18:32:12 +00:00
18 lines
677 B
Makefile
18 lines
677 B
Makefile
FILES := $(wildcard *)
|
|
|
|
# NOTE: changing this requires changing the same values in the `web/index.html`.
|
|
INITIAL_MEMORY_PAGES := 2000
|
|
MAX_MEMORY_PAGES := 65536
|
|
|
|
PAGE_SIZE := 65536
|
|
INITIAL_MEMORY_BYTES := $(shell expr $(INITIAL_MEMORY_PAGES) \* $(PAGE_SIZE))
|
|
MAX_MEMORY_BYTES := $(shell expr $(MAX_MEMORY_PAGES) \* $(PAGE_SIZE))
|
|
|
|
web/triangle.wasm: $(FILES) ../wgpu.js ../../wasm/js/runtime.js
|
|
odin build . \
|
|
-target:js_wasm32 -out:web/triangle.wasm -o:size \
|
|
-extra-linker-flags:"--export-table --import-memory --initial-memory=$(INITIAL_MEMORY_BYTES) --max-memory=$(MAX_MEMORY_BYTES)"
|
|
|
|
cp ../wgpu.js web/wgpu.js
|
|
cp ../../wasm/js/runtime.js web/runtime.js
|