1 # Copyright (C) 2021 Harry Godden (hgn) - All Rights Reserved
6 libs
="-lGL -lglfw -lX11 -lXxf86vm -lXrandr -lm -lpthread -lXi -ldl" # -l:steam/libsteam_api.so"
7 flags
="-fsanitize=address -ggdb3 -Wno-unused-function -DNO_STEAM"
9 if [[ "$OSTYPE" != "linux-gnu"* ]]; then
10 echo "Operating system is not GNU/Linux, windows will be assumed."
11 target
="fishladder.exe"
12 libs
="-lglfw3 -lopengl32 -lm -mwindows"
13 flags
="-ggdb3 -Wno-unused-function -DNO_STEAM"
34 echo "Unkown param: $1"
43 gcc
-Wall -Wstrict-aliasing=3 $lib $flags mdlcomp.c gl
/glad.c
-o tools
/mdlcomp
$libs -Wl,-rpath=.
/ $defines
45 echo "Recompiling models"
46 for f
in models
/*.obj
;
47 do echo "Compiling $f..";
48 .
/tools
/mdlcomp
$f $f.h
52 if [ "$do_build" = true
]; then
53 gcc
-Wall -Wstrict-aliasing=3 $lib $flags $src gl
/glad.c
-o $target $libs -Wl,-rpath=.
/ $defines
56 echo "GCC build failed"
60 echo "Build succeeded"
63 if [[ "$OSTYPE" == "linux-gnu"* ]]; then
64 # Directories to initialize
65 mkdir build.linux
/cfg
-p
66 mkdir build.linux
/textures
-p
68 cp $target .
/build.linux
/$target
69 cp .
/steam
/libsteam_api.so .
/build.linux
/libsteam_api.so
70 cp -r .
/textures
/ .
/build.linux
/
72 if [ "$run_after" = true
]; then
80 mkdir build.win32
/cfg
-p
81 mkdir build.win32
/textures
-p
83 cp $target .
/build.win32
/$target
84 cp -r .
/textures
/ .
/build.win32
/
85 cp .
/lib
/glfw3.dll .
/build.win32
/glfw3.dll
87 if [ "$run_after" = true
]; then