hl-pak0-gen/build_tools.sh

71 lines
1.2 KiB
Bash
Raw Normal View History

#!/bin/sh
set -e
2023-05-07 09:37:23 -07:00
MAKEVER=$(make --version | awk '{ print $1 }' | head -n 1)
# is this GNU?
if [ "$MAKEVER" = "GNU" ]
then
MAKETOOL="make"
else
# guess not, do we have gmake?
if [ -x "$(command -v gmake)" ]
then
MAKEVER=$(gmake --version | awk '{ print $1 }' | head -n 1)
if [ "$MAKEVER" = "GNU" ]
then
MAKETOOL="gmake"
else
echo "Please install GNU Make."
exit 2
fi
fi
fi
DEPSDIR="$(pwd)/_deps"
BINDIR="$(pwd)/_bin"
INCTOOLDIR="$(pwd)/tools"
if [ -d "$DEPSDIR" ]
then
rm -rf "$DEPSDIR"
fi
if [ -d "$BINDIR" ]
then
rm -rf "$BINDIR"
fi
mkdir "$DEPSDIR"
mkdir "$BINDIR"
cd "$DEPSDIR"
2023-05-07 09:37:23 -07:00
git clone https://vcs.vera-visions.com/eukara/REWise
cd REWise
2023-05-07 09:37:23 -07:00
$MAKETOOL CC=cc
mv -v rewise "$BINDIR/rewise"
cd "$DEPSDIR"
2023-05-07 09:37:23 -07:00
git clone https://vcs.vera-visions.com/eukara/HLLib
cd HLLib/HLLib
$MAKETOOL CC=cc CXX=c++
cd ../HLExtract
2023-05-07 09:37:23 -07:00
$MAKETOOL CC=cc CXX=c++
mv -v hlextract "$BINDIR/hlextract"
cd "$DEPSDIR"
git clone https://github.com/yquake2/pakextract
cd pakextract
2023-05-07 09:37:23 -07:00
$MAKETOOL CC=cc
mv -v pakextract "$BINDIR/pakextract"
cd "$INCTOOLDIR/bmpfix"
cc -o bmpfix bmpfix.c
mv -v bmpfix "$BINDIR/bmpfix"
cd "$INCTOOLDIR/gpl-quake"
cc -o qfiles cmdlib.c qfiles.c
mv -v qfiles "$BINDIR/qfiles"