69 lines
1.4 KiB
Bash
Executable file
69 lines
1.4 KiB
Bash
Executable file
#!/bin/bash -e
|
|
|
|
|
|
BUILD="${JOEY}/joeylib/build"
|
|
SRC="${JOEY}/joeylib/src"
|
|
|
|
|
|
function doBuild() {
|
|
if [ -d "${BUILD}" ]; then
|
|
rm -rf "${BUILD}"
|
|
fi
|
|
mkdir -p "${BUILD}"
|
|
if [ -d "${DIST}" ]; then
|
|
rm -rf "${DIST}"
|
|
fi
|
|
mkdir -p "${DIST}"
|
|
|
|
pushd "${BUILD}"
|
|
${CC} ${CFLAGS} -c -o jPC.o ${SRC}/jPC.c
|
|
${CC} ${CFLAGS} -c -o joey.o ${SRC}/joey.c
|
|
cp -f *.o "${DIST}"/.
|
|
popd
|
|
|
|
pushd ${DIST}
|
|
ar -x ${INSTALLED}/libSDL2.a
|
|
ar -x ${INSTALLED}/libSDL2_mixer.a
|
|
ar -x ${INSTALLED}/libmikmod.a
|
|
ar rcs joeylib.a *.o
|
|
rm *.o
|
|
popd
|
|
}
|
|
|
|
CC="gcc"
|
|
CFLAGS="-Wall -D_REENTRANT -I${SRC}"
|
|
DIST="${JOEY}/dist/linux/x64"
|
|
INSTALLED="${JOEY}/SDL2/installed/linux/x64/lib"
|
|
doBuild
|
|
|
|
CC="gcc"
|
|
CFLAGS="-m32 -Wall -D_REENTRANT -I${SRC}"
|
|
DIST="${JOEY}/dist/linux/x86"
|
|
INSTALLED="${JOEY}/SDL2/installed/linux/x86/lib"
|
|
doBuild
|
|
|
|
CC="x86_64-w64-mingw32-gcc"
|
|
CFLAGS="-Wall -D_REENTRANT -I${SRC}"
|
|
DIST="${JOEY}/dist/windows/x64"
|
|
INSTALLED="${JOEY}/SDL2/installed/windows/x64/lib"
|
|
doBuild
|
|
|
|
CC="i686-w64-mingw32-gcc"
|
|
CFLAGS="-Wall -D_REENTRANT -I${SRC}"
|
|
DIST="${JOEY}/dist/windows/x86"
|
|
INSTALLED="${JOEY}/SDL2/installed/windows/x86/lib"
|
|
doBuild
|
|
|
|
CC="o32-clang"
|
|
CFLAGS="-Wall -D_REENTRANT -I${SRC}"
|
|
DIST="${JOEY}/dist/macos/x86"
|
|
INSTALLED="${JOEY}/SDL2/installed/macos/x86/lib"
|
|
doBuild
|
|
|
|
CC="o64-clang"
|
|
CFLAGS="-Wall -D_REENTRANT -I${SRC}"
|
|
DIST="${JOEY}/dist/macos/x64"
|
|
INSTALLED="${JOEY}/SDL2/installed/macos/x64/lib"
|
|
doBuild
|
|
|
|
rm -rf build
|