Back to shtanton's homepage
summaryrefslogtreecommitdiff
path: root/Makefile
blob: fc6af8f6099388d0f3b2e8a746943f62e83ee7ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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