X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=build.sh;h=fb8efffc8663b1f5d87799269a2e472471039396;hb=c4e640773aac3e864dc45b86f22ee21715119a7d;hp=598e7fe57473fad96f2c69f7d71b5c0431735c27;hpb=87f9f2a4d239b9834afc1fa1ee07cc13b4a8217b;p=fishladder.git diff --git a/build.sh b/build.sh index 598e7fe..fb8efff 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 @@ -81,4 +108,4 @@ else ./$target cd ./../ fi -fi \ No newline at end of file +fi