diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -1,2 +1,17 @@ -main: src/all.c src/all.h - gcc -Wall -Wextra -Wpedantic -DSDL $$(pkg-config --libs sdl3) -o main src/all.c +build/main: src/all.c src/all.h + mkdir -p build + gcc -Wall -Wextra -Wpedantic -DSDL $$(pkg-config --libs sdl3) -o build/main src/all.c + +build/main.wasm: src/all.c src/all.h + mkdir -p build + clang --target=wasm32 -nostdlib -DWASM -Wall -Wextra -Wpedantic \ + -Wl,--no-entry -fno-builtin -o build/main.wasm src/all.c + +build/main.wasm.b64: build/main.wasm + (printf '"'; base64 < build/main.wasm | tr -d '\n'; printf '"') > build/main.wasm.b64 + +build/index.html: src/index.html.in build/main.wasm.b64 + clang -E -P -undef -nostdinc -x c -o build/index.html src/index.html.in + +clean: + rm -r build |