diff options
author | kartofen <mladenovnasko0@gmail.com> | 2022-08-31 12:31:38 +0300 |
---|---|---|
committer | kartofen <mladenovnasko0@gmail.com> | 2022-08-31 12:31:38 +0300 |
commit | 675ded0d66b9fd60777d3037ded1446a3f9ef986 (patch) | |
tree | 6db3f0524437304f9e5a7b90175e3f6b043d4d49 /build.sh |
Big Bang
Diffstat (limited to 'build.sh')
-rwxr-xr-x | build.sh | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..d35c2f0 --- /dev/null +++ b/build.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +cd ${0%/*} # go to project root + +FLAGS="-Wall -Wextra -g -pedantic -lpthread -D_GNU_SOURCE" +FGLUT="-lglut -lGLU -lGL" +FV4L2="-lv4l2" +FPASM="-lpulse -lpulse-simple" +SRC="src" +OBJ="obj" +BIN="bin" +RUN=0 + +function __run__ { + RUN=1 +} + +function __clean__ { + rm -rf $BIN + rm -rf $OBJ + kill $( ps -q $$ -o pgid= ) # exit +} + +set -xe + +if ! { [[ $# -eq 0 ]]; } 2> /dev/null +then + __$1__ +fi + +mkdir -p $BIN +mkdir -p $OBJ + +gcc -o $OBJ/socket.o -c $SRC/socket.c +gcc -o $OBJ/display.o -c $SRC/display.c +gcc -o $OBJ/camera.o -c $SRC/camera.c +gcc -o $OBJ/audio.o -c $SRC/audio.c + +gcc -o $BIN/listener $SRC/listener.c $OBJ/socket.o $OBJ/display.o $OBJ/audio.o $FLAGS $FPASM $FGLUT +gcc -o $BIN/talker $SRC/talker.c $OBJ/socket.o $OBJ/camera.o $OBJ/audio.o $FLAGS $FPASM $FV4L2 + +# if ! { [[ $RUN -eq 0 ]]; } 2> /dev/null +# then +# fi |