cea0e94e1facfe6f20b8523a9b4fa59af47a5f05
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"
44 echo "Unkown param: $1"
52 if [ "$compile_tools" = true
]; then
55 gcc
-Wall -Wstrict-aliasing=3 $lib $flags mdlcomp.c gl
/glad.c
-o tools
/mdlcomp
$libs -Wl,-rpath=.
/ $defines
59 if [ "$compile_models" = true
]; then
60 echo "Recompiling models"
61 for f
in models
/*.obj
;
62 do echo "Compiling $f..";
63 .
/tools
/mdlcomp
$f $f.h
68 if [ "$do_build" = true
]; then
69 gcc
-Wall -Wstrict-aliasing=3 $lib $flags $src gl
/glad.c
-o $target $libs -Wl,-rpath=.
/ $defines
72 echo "GCC build failed"
76 echo "Build succeeded"
79 if [[ "$OSTYPE" == "linux-gnu"* ]]; then
80 # Directories to initialize
81 mkdir build.linux
/cfg
-p
82 mkdir build.linux
/textures
-p
84 cp $target .
/build.linux
/$target
85 cp .
/steam
/libsteam_api.so .
/build.linux
/libsteam_api.so
86 cp -r .
/textures
/ .
/build.linux
/
88 if [ "$run_after" = true
]; then
96 mkdir build.win32
/cfg
-p
97 mkdir build.win32
/textures
-p
99 cp $target .
/build.win32
/$target
100 cp -r .
/textures
/ .
/build.win32
/
101 cp .
/lib
/glfw3.dll .
/build.win32
/glfw3.dll
103 if [ "$run_after" = true
]; then