Minor update to build script and removed binaries again
This commit is contained in:
parent
5377458895
commit
2d37e05b7e
4 changed files with 33 additions and 30 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -3,5 +3,5 @@ cscope.out
|
|||
cscope.in.out
|
||||
cscope.po.out
|
||||
transformation_visualizer
|
||||
libraries/raylib/linux/*
|
||||
libraries/raylib/wasm/*
|
||||
src/libraries/raylib/linux/*
|
||||
src/libraries/raylib/wasm/*
|
||||
|
|
|
|||
|
|
@ -1,31 +1,34 @@
|
|||
#!/usr/bin/env bash
|
||||
# Currently not cross compiling for windows and darwin
|
||||
# Usage: <script> <DEBUG/RELEASE>
|
||||
set -euo pipefail
|
||||
|
||||
if [[ -v 1 ]]; then
|
||||
if [ "$1" = "DEBUG" ]; then
|
||||
MFLAGS="RAYLIB_BUILD_MODE=DEBUG"
|
||||
CFLAGS="-g"
|
||||
elif [ "$1" = "RELEASE" ]; then
|
||||
MFLAGS="RAYLIB_BUILD_MODE=RELEASE"
|
||||
CFLAGS="-Os -ffunction-sections -fdata-sections"
|
||||
else
|
||||
echo "Usage: <script> <DEBUG/RELEASE>"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "Usage: <script> <DEBUG/RELEASE>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
emsdk_env="$HOME/programs/emsdk/emsdk_env.sh"
|
||||
modules="RAYLIB_MODULE_AUDIO=FALSE RAYLIB_MODULE_RAYGUI=FALSE RAYLIB_MODULE_MODELS=FALSE"
|
||||
linux_library_dest="../../linux"
|
||||
windows_library_dest="../../windows"
|
||||
darwin_library_dest="../../darwin"
|
||||
wasm_library_dest="../../wasm"
|
||||
linux_library_dest_here="linux/"
|
||||
windows_library_dest_here="windows/"
|
||||
darwin_library_dest_here="darwin/"
|
||||
wasm_library_dest_here="wasm/"
|
||||
linux_library_dest="linux"
|
||||
windows_library_dest="windows"
|
||||
darwin_library_dest="darwin"
|
||||
wasm_library_dest="wasm"
|
||||
|
||||
mkdir -p $linux_library_dest_here
|
||||
mkdir -p $windows_library_dest_here
|
||||
mkdir -p $darwin_library_dest_here
|
||||
mkdir -p $wasm_library_dest_here
|
||||
|
||||
if [ "$1" = "DEBUG" ]; then
|
||||
MFLAGS="RAYLIB_BUILD_MODE=DEBUG"
|
||||
CFLAGS="-g"
|
||||
else
|
||||
MFLAGS="RAYLIB_BUILD_MODE=RELEASE"
|
||||
CFLAGS=""
|
||||
fi
|
||||
mkdir -p $linux_library_dest
|
||||
mkdir -p $windows_library_dest
|
||||
mkdir -p $darwin_library_dest
|
||||
mkdir -p $wasm_library_dest
|
||||
|
||||
config_cflags="\
|
||||
-DSUPPORT_MODULE_RSHAPES=1 \
|
||||
|
|
@ -91,8 +94,8 @@ source $emsdk_env
|
|||
|
||||
pushd raylib/src
|
||||
echo "Compiling raylib static library for linux"
|
||||
make --silent $modules $MFLAGS RAYLIB_CONFIG_FLAGS="$config_cflags" CUSTOM_CFLAGS="-Os -ffunction-sections -fdata-sections" PLATFORM_OS=LINUX
|
||||
mv libraylib.a $linux_library_dest
|
||||
make --silent $modules $MFLAGS RAYLIB_CONFIG_FLAGS="$config_cflags" CUSTOM_CFLAGS="$CFLAGS" PLATFORM_OS=LINUX
|
||||
mv libraylib.a "../../${linux_library_dest}"
|
||||
make --silent clean
|
||||
|
||||
# echo "Compiling static library for windows"
|
||||
|
|
@ -100,21 +103,21 @@ make --silent clean
|
|||
# mv libraylib.a $windows_library_dest
|
||||
# make --silent clean
|
||||
|
||||
echo "Compiling static library for web"
|
||||
echo "Compiling raylib static library for web"
|
||||
make --silent $modules RAYLIB_CONFIG_FLAGS="$config_cflags" PLATFORM=PLATFORM_WEB
|
||||
mv libraylib.web.a libraylib.a
|
||||
mv libraylib.a $wasm_library_dest
|
||||
mv libraylib.a "../../${wasm_library_dest}"
|
||||
make --silent clean
|
||||
popd
|
||||
|
||||
pushd raygui
|
||||
echo "Compiling raygui static library for linux"
|
||||
gcc $CFLAGS -c -Os -ffunction-sections -fdata-sections -fPIC -x c -DRAYGUI_IMPLEMENTATION -I../raylib/src raygui.h -o raygui.o
|
||||
ar rcs ../linux/libraygui.a raygui.o
|
||||
gcc $CFLAGS -c -fPIC -x c -DRAYGUI_IMPLEMENTATION -I../raylib/src raygui.h -o raygui.o
|
||||
ar rcs ../${linux_library_dest}/libraygui.a raygui.o
|
||||
rm raygui.o
|
||||
|
||||
echo "Compiling raygui static library for web"
|
||||
emcc -c -Os -ffunction-sections -fdata-sections -x c -DRAYGUI_IMPLEMENTATION -DPLATFORM_WEB -I../raylib/src raygui.h -o raygui_wasm.o
|
||||
emar rcs ../wasm/libraygui.a raygui_wasm.o
|
||||
emar rcs ../${wasm_library_dest}/libraygui.a raygui_wasm.o
|
||||
rm raygui_wasm.o
|
||||
popd
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue