Update build scripts
This commit is contained in:
parent
dd290f4094
commit
df5557d1fc
8
compile
8
compile
@ -4,11 +4,13 @@ CC=clang
|
|||||||
CFLAGS="-g -Wall -Werror -pedantic -Iinclude $(pkg-config --cflags sdl2)"
|
CFLAGS="-g -Wall -Werror -pedantic -Iinclude $(pkg-config --cflags sdl2)"
|
||||||
LIBS="$(pkg-config --libs sdl2)"
|
LIBS="$(pkg-config --libs sdl2)"
|
||||||
|
|
||||||
SRC="src/*.c"
|
RAYTRACER_SRC="src/window/*.c \
|
||||||
|
src/raytracer/*.c \
|
||||||
|
"
|
||||||
|
|
||||||
BUILD=build_dir
|
BUILD=build_dir
|
||||||
OUT="$BUILD/main"
|
RAYTRACER_OUT="$BUILD/raytracer"
|
||||||
|
|
||||||
mkdir -p $BUILD
|
mkdir -p $BUILD
|
||||||
|
|
||||||
(set -x ; $CC $CFLAGS $LIBS $SRC -o $OUT)
|
(set -x ; $CC $CFLAGS $LIBS $RAYTRACER_SRC -o $RAYTRACER_OUT)
|
||||||
|
22
run
22
run
@ -1,3 +1,23 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
./build_dir/main
|
USAGE="Usage: run (raytracer | rasteriser)"
|
||||||
|
|
||||||
|
if [[ $# == 0 ]]; then
|
||||||
|
echo $USAGE
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
while [[ $# -gt 0 ]]; do
|
||||||
|
case $1 in
|
||||||
|
raytracer)
|
||||||
|
RENDERER="raytracer"
|
||||||
|
shift # past argument
|
||||||
|
;;
|
||||||
|
-*|--*|*)
|
||||||
|
echo $USAGE
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
./build_dir/$RENDERER
|
||||||
|
Loading…
Reference in New Issue
Block a user