summaryrefslogtreecommitdiff
path: root/build_all.sh
blob: 1cc40eea89d7cf1b2757165b649d3de85e19170e (plain)
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
FLAGS_X11="                         \
  -Wall -Wextra -Werror -pedantic   \
  -Wno-old-style-declaration        \
  -Wno-missing-braces               \
  -Wno-unused-variable              \
  -Wno-unused-but-set-variable      \
  -Wno-unused-parameter             \
  -Wno-overlength-strings           \
  -D NDEBUG                         \
  -O3                               \
  -fsanitize=undefined,address,leak \
  -lX11 -lm -lasound"

FLAGS_WEB="                         \
  -Wall -Wextra -Werror -pedantic   \
  -Wno-missing-braces               \
  -Wno-unused-variable              \
  -Wno-unused-but-set-variable      \
  -Wno-unused-parameter             \
  -Wno-overlength-strings           \
  -D NDEBUG                         \
  -O3                               \
  --target=wasm32                   \
  -nostdlib -fno-builtin            \
  -mbulk-memory                     \
  -Wl,--no-entry,--allow-undefined"

mkdir -p bin/x11
mkdir -p bin/web

gcc $FLAGS_X11 -o ./bin/x11/graph        ./examples/graph.c
gcc $FLAGS_X11 -o ./bin/x11/particles    ./examples/particles.c
gcc $FLAGS_X11 -o ./bin/x11/julia_set    ./examples/julia_set.c
gcc $FLAGS_X11 -o ./bin/x11/game_of_life ./examples/game_of_life.c
gcc $FLAGS_X11 -o ./bin/x11/labyrinth    ./examples/labyrinth.c
gcc $FLAGS_X11 -o ./bin/x11/sinewave     ./examples/sinewave.c
gcc $FLAGS_X11 -o ./bin/x11/pixels       ./examples/pixels.c
gcc $FLAGS_X11 -o ./bin/x11/ui           ./examples/ui.c
gcc $FLAGS_X11 -o ./bin/x11/echo         ./examples/echo.c
gcc $FLAGS_X11 -o ./bin/x11/proto        ./examples/proto.c

clang $FLAGS_WEB -o ./bin/web/graph.wasm        ./examples/graph.c
clang $FLAGS_WEB -o ./bin/web/julia_set.wasm    ./examples/julia_set.c
clang $FLAGS_WEB -o ./bin/web/game_of_life.wasm ./examples/game_of_life.c
clang $FLAGS_WEB -o ./bin/web/labyrinth.wasm    ./examples/labyrinth.c
clang $FLAGS_WEB -o ./bin/web/sinewave.wasm     ./examples/sinewave.c
clang $FLAGS_WEB -o ./bin/web/pixels.wasm       ./examples/pixels.c
clang $FLAGS_WEB -o ./bin/web/ui.wasm           ./examples/ui.c
clang $FLAGS_WEB -o ./bin/web/proto.wasm        ./examples/proto.c