X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=build.sh;h=9acfd368af55f6fde749dff7598d3e200089d5e9;hb=d94e286c52dcfd5faf7cbd12690268f9d68957ef;hp=db1a526e8bf802d09f5d39b3c6cf86375dcd7d59;hpb=d6f6c5c2162df557a6614d4f2abef5bab73e70d1;p=fishladder.git diff --git a/build.sh b/build.sh index db1a526..9acfd36 100755 --- a/build.sh +++ b/build.sh @@ -15,6 +15,8 @@ fi run_after=false do_build=true +compile_tools=false +compile_models=false while (( "$#" )); do case $1 in @@ -30,6 +32,14 @@ while (( "$#" )); do do_build=false echo "no-build" ;; + -t|--tools) + compile_tools=true + echo "build-tools" + ;; + -m|--models) + compile_models=true + echo "build-models" + ;; *) echo "Unkown param: $1" exit 1 @@ -38,6 +48,23 @@ while (( "$#" )); do shift done +# Tools +if [ "$compile_tools" = true ]; then + echo "Building tools" + mkdir tools -p + gcc -Wall -Wstrict-aliasing=3 $lib $flags mdlcomp.c gl/glad.c -o tools/mdlcomp $libs -Wl,-rpath=./ $defines + gcc -Wall -Wstrict-aliasing=3 $lib $flags fontcomp.c gl/glad.c -o tools/fontcomp $libs -Wl,-rpath=./ $defines +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 + # Main build if [ "$do_build" = true ]; then gcc -Wall -Wstrict-aliasing=3 $lib $flags $src gl/glad.c -o $target $libs -Wl,-rpath=./ $defines @@ -54,10 +81,12 @@ if [[ "$OSTYPE" == "linux-gnu"* ]]; then # Directories to initialize mkdir build.linux/cfg -p mkdir build.linux/textures -p + mkdir build.linux/sound -p cp $target ./build.linux/$target cp ./steam/libsteam_api.so ./build.linux/libsteam_api.so cp -r ./textures/ ./build.linux/ + cp -r ./sound/ ./build.linux/ if [ "$run_after" = true ]; then echo "Playing" @@ -69,9 +98,11 @@ if [[ "$OSTYPE" == "linux-gnu"* ]]; then else mkdir build.win32/cfg -p mkdir build.win32/textures -p + mkdir build.win32/sound -p cp $target ./build.win32/$target cp -r ./textures/ ./build.win32/ + cp -r ./sound/ ./build.win32/ cp ./lib/glfw3.dll ./build.win32/glfw3.dll if [ "$run_after" = true ]; then