-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbake.sh
executable file
·25 lines (19 loc) · 917 Bytes
/
bake.sh
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
#!/bin/bash
if [ ! -d "build" ]; then
mkdir build
fi
cd build
# print a horizontal line of dashes; helps separate the output if run serially
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' - | lolcat
if [[ $OSTYPE == 'darwin'* ]]; then
if [[ $(../sokol-tools-bin/bin/osx/sokol-shdc --input ../shaders.glsl --output shaders.glsl.h --slang metal_macos | tee /dev/tty) ]]; then
exit 1
fi
gcc -g -O0 -ObjC ../main.c -Wall -Werror -framework QuartzCore -framework Cocoa -framework MetalKit -framework Metal -framework OpenGL -framework AudioToolbox
else
if [[ $(../sokol-tools-bin/bin/linux/sokol-shdc --input ../shaders.glsl --output shaders.glsl.h --slang glsl330 | tee /dev/tty) ]]; then
exit 1
fi
clang -fsanitize=undefined -g -O0 -L/usr/lib -lX11 -lXi -lXcursor -lGL -ldl -lm -lpthread ../main.c
# gcc -g -O0 ../main.c -Wall -Werror -lX11 -lXi -lXcursor -lGL -ldl -lm -lpthread
fi