-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
31 lines (22 loc) · 1.1 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
all: objs script ./script/game.js ./objs/main.o ./objs/walloc.o ./script/main.wasm ./objs/main.wat
objs:
mkdir -p $@
script:
mkdir -p $@
./objs/main.o: ./source/main.cpp
# clang -Xclang -target-abi -Xclang experimental-mv -g3 -O3 -std=c++20 --target=wasm32-unknown-unknown -fPIC -Wl,--shared -Wl,--allow-undefined -Wl,--no-entry -nostdlib -msimd128 -mbulk-memory -mmultivalue $< -o ./objs/$@
clang -Xclang -target-abi -Xclang experimental-mv -std=c++20 -g3 -O3 --target=wasm32-unknown-unknown -fPIC -msimd128 -mbulk-memory -mmultivalue -nostdlib -c $< -o $@
./objs/walloc.o: ./source/walloc.c
clang -Xclang -target-abi -Xclang experimental-mv -g3 -std=c17 --target=wasm32-unknown-unknown -fPIC -msimd128 -mbulk-memory -mmultivalue -nostdlib -c $< -o $@
./script/main.wasm: ./objs/walloc.o ./objs/main.o
wasm-ld --import-memory --no-entry -o $@ $^
./objs/main.wat: ./script/main.wasm
wasm2wat --enable-all $< > $@
./script/game.js: ./source/game.ts
npx tsc --outDir ./script/
.PHONY: copy
copy:
cp -t $(COPYDIR) -r audio image script
.PHONY: clean
clean:
rm -rf script objs