leaderboard seems to have segfault. fixed typos
[fishladder.git] / build.sh
index 63891f6238109708a1f33facbefb4dec890da946..b449611c5cbbcb1d6e3ce212996e2c0973925771 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -4,22 +4,24 @@ src="fishladder.c"
 target="fishladder"
 lib="-I. -L./lib -L./"
 libs="-lGL -lglfw -lX11 -lXxf86vm -lXrandr -lm -lpthread -lXi -ldl -l:steam/libsteam_api.so"
-flags="-fsanitize=address -ggdb3 -Wno-unused-function -DNO_STEAM"
+flags="-fsanitize=address -ggdb3 -Wno-unused-function"
 build_dir="build.linux"
+steam_api="libsteam_api.so"
 
 if [[ "$OSTYPE" != "linux-gnu"* ]]; then
        echo "Operating system is not GNU/Linux, windows will be assumed."
 
        target="fishladder.exe"
-       libs="-lglfw3 -lopengl32 -lm -mwindows"
-       flags="-ggdb3 -Wno-unused-function -DNO_STEAM"
+       libs="-lglfw3 -lopengl32 -lm -mwindows -l:steam/steam_api.dll"
+       flags="-ggdb3 -Wno-unused-function"
        build_dir="build.win32"
+       steam_api="steam_api.dll"
 fi
 
 run_after=false
 do_build=true
 compile_tools=false
-compile_models=false
+#compile_models=false
 
 while (( "$#" )); do
        case $1 in
@@ -39,10 +41,10 @@ while (( "$#" )); do
                        compile_tools=true
                        echo "build-tools"
                ;;
-               -m|--models)
-                       compile_models=true
-                       echo "build-models"
-               ;;
+               #-m|--models)
+               #       compile_models=true
+               #       echo "build-models"
+               #;;
                *) 
                        echo "Unkown param: $1" 
                        exit 1
@@ -61,22 +63,22 @@ if [ "$compile_tools" = true ]; then
 fi
 
 # Resources
-if [ "$compile_models" = true ]; then
-       echo "Recompiling models"
-       for f in models/*.obj; 
-               do echo "Compiling $f..";
-               ./tools/mdlcomp $f $f.h
-       done
-fi
-
+mkdir _temp_textures
 # Convert all png to qoi
 echo "Compiling textures"
-mkdir _temp_textures
 for f in textures/*.png;
        do echo "-> qoi: $f";
        ./tools/qoiconv $f ./_temp_textures/"$(basename "$f" .png).qoi"
 done
 
+#if [ "$compile_models" = true ]; then
+#      echo "Recompiling models"
+#      for f in models/*.obj; 
+#              do echo "Compiling $f..";
+#              ./tools/mdlcomp $f $f.h
+#      done
+#fi
+
 # Main build
 if [ "$do_build" = true ]; then
        gcc -Wall -Wstrict-aliasing=3 $lib $flags $src gl/glad.c -o $target $libs -Wl,-rpath=./ $defines
@@ -96,7 +98,7 @@ mkdir $build_dir/maps -p
 mkdir $build_dir/sav -p
 
 cp $target $build_dir/$target
-cp ./steam/libsteam_api.so $build_dir/libsteam_api.so
+cp ./steam/$steam_api $build_dir/$steam_api
 rm -r $build_dir/textures
 mv ./_temp_textures/ $build_dir/textures
 cp -r ./sound/ $build_dir