From d8b5b2e876831a03fbe636effa96c06ded89b46c Mon Sep 17 00:00:00 2001 From: Rebekah Rowe Date: Tue, 13 Feb 2024 10:52:22 -0500 Subject: [PATCH] New Easy Build scripts for linux. I want to go fast, these allow you to simply run the script and it goes. --- build-clean.sh | 12 ++++++++++++ build-client.sh | 12 ++++++++++++ build-fastcompile.sh | 12 ++++++++++++ build-release.sh | 12 ++++++++++++ build.sh | 12 ++++++++++++ start.sh | 22 ++++++++++++++++++++++ 6 files changed, 82 insertions(+) create mode 100755 build-clean.sh create mode 100755 build-client.sh create mode 100755 build-fastcompile.sh create mode 100755 build-release.sh create mode 100755 build.sh create mode 100755 start.sh diff --git a/build-clean.sh b/build-clean.sh new file mode 100755 index 000000000..671b375e1 --- /dev/null +++ b/build-clean.sh @@ -0,0 +1,12 @@ +#!/bin/sh -e + +# Purpose of this is to in theroy be safer than rm -r... + +if [ -f CMakeLists.txt ]; then + mkdir -p build + cd build +fi + +if [ -f CMakeCache.txt ]; then + rm -r * +fi diff --git a/build-client.sh b/build-client.sh new file mode 100755 index 000000000..53e3942eb --- /dev/null +++ b/build-client.sh @@ -0,0 +1,12 @@ +#!/bin/sh -e + +if [ -f CMakeLists.txt ]; then + mkdir -p build + cd build +fi + +if ! [ -f CMakeCache.txt ]; then + cmake -DCMAKE_BUILD_TYPE=Release -DUNITY_BUILDS=OFF -DWHOLE_PROGRAM_OPTIMISATION=OFF -DBUILD_CLIENT=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .. +fi + +make -j$(nproc) diff --git a/build-fastcompile.sh b/build-fastcompile.sh new file mode 100755 index 000000000..2b5d1c6fc --- /dev/null +++ b/build-fastcompile.sh @@ -0,0 +1,12 @@ +#!/bin/sh -e + +if [ -f CMakeLists.txt ]; then + mkdir -p build + cd build +fi + +if ! [ -f CMakeCache.txt ]; then + cmake -DCMAKE_BUILD_TYPE=Release -DUNITY_BUILDS=OFF -DWHOLE_PROGRAM_OPTIMISATION=OFF .. +fi + +make -j$(nproc) diff --git a/build-release.sh b/build-release.sh new file mode 100755 index 000000000..dcd108325 --- /dev/null +++ b/build-release.sh @@ -0,0 +1,12 @@ +#!/bin/sh -e + +if [ -f CMakeLists.txt ]; then + mkdir -p build + cd build +fi + +if ! [ -f CMakeCache.txt ]; then + cmake -DCMAKE_BUILD_TYPE=Release .. +fi + +make -j$(nproc) diff --git a/build.sh b/build.sh new file mode 100755 index 000000000..af8ed086f --- /dev/null +++ b/build.sh @@ -0,0 +1,12 @@ +#!/bin/sh -e + +if [ -f CMakeLists.txt ]; then + mkdir -p build + cd build +fi + +if ! [ -f CMakeCache.txt ]; then + cmake .. +fi + +make -j$(nproc) diff --git a/start.sh b/start.sh new file mode 100755 index 000000000..fe53e530a --- /dev/null +++ b/start.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +if [ -f CMakeLists.txt ]; then + mkdir -p build + cd build +fi + +if ! [ -f CMakeCache.txt ]; then + cmake .. +fi + +if ! [ -f Server/Cuberite ]; then + make -j$(nproc) +fi + +if ! [ -d res ]; then + ln -s ../client-resources/ res +fi + +cd Server +LD_PRELOAD=/usr/local/lib/libhydride.so ./Cuberite +#LD_PRELOAD=/usr/local/lib/libhydride.so gdb ./Cuberite