-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
69 lines (56 loc) · 1.69 KB
/
Copy pathmakefile
File metadata and controls
69 lines (56 loc) · 1.69 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
.PHONY: all upx ptf wasm js run test testsoft test60 dbg grind clean
name = MachineDeposition
SHELL := /bin/bash
all:
gcc main.c -Ofast -lSDL2 -lGLESv2 -lEGL -lm -o $(name)_linux
upx:
strip --strip-unneeded $(name)_linux
upx --lzma --best $(name)_linux
ptf:
cc dev/ptf.c -lm -Ofast -march=native -o dev/ptf
wasm:
source ~/emsdk/emsdk_env.sh && emcc main.c -DWEB -O3 --closure 1 \
-s USE_SDL=2 \
-s FILESYSTEM=0 \
-s ENVIRONMENT=web \
-s ABORTING_MALLOC=0 \
-s NO_EXIT_RUNTIME=1 \
-s TOTAL_MEMORY=1MB \
-o web/index.html --shell-file t.html && emrun web/index.html
js:
source ~/emsdk/emsdk_env.sh && emcc main.c -DWEB -O3 --closure 1 \
-s MINIFY_HTML=0 \
-s WASM=0 \
-s USE_SDL=2 \
-s FILESYSTEM=0 \
-s LEGACY_VM_SUPPORT=1 \
-s ABORTING_MALLOC=0 \
-s NO_EXIT_RUNTIME=1 \
-s ENVIRONMENT=web \
-s TOTAL_MEMORY=1MB \
-o web/index.html --shell-file t.html && emrun web/index.html
run:
source ~/emsdk/emsdk_env.sh && emrun web/index.html
test:
gcc main.c -I inc -Ofast -lSDL2 -lGLESv2 -lEGL -lm -o /tmp/$(name)_test
/tmp/$(name)_test
rm /tmp/$(name)_test
testsoft:
gcc main.c -Ofast -lSDL2 -lGLESv2 -lEGL -lm -o /tmp/$(name)_test
LIBGL_ALWAYS_SOFTWARE=1 /tmp/$(name)_test
rm /tmp/$(name)_test
test60:
gcc main.c -Ofast -lSDL2 -lGLESv2 -lEGL -lm -o /tmp/$(name)_test
xrandr --rate 60 && /tmp/$(name)_test && xrandr --rate 160
rm /tmp/$(name)_test
dbg:
cc main.c -fsanitize=leak -fsanitize=undefined -fsanitize=address -ggdb3 -lSDL2 -lGLESv2 -lEGL -lm -o $(name)_dbg
$(name)_dbg
grind:
valgrind --track-origins=yes --leak-check=full --leak-check=full ./$(name)_linux
clean:
rm -f $(name)_linux
rm -f web/index.html
rm -f web/index.js
rm -f web/index.wasm
rm -f dev/ptf