From d4563c528142588ebd821c1ab37ad909696ffdef Mon Sep 17 00:00:00 2001 From: "Paul N. Baker" Date: Mon, 11 Feb 2019 14:09:50 -0700 Subject: [PATCH 1/2] Buildscripts - Because we like fast interations while also over-engineering solutions --- build.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 build.sh diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..848cf02 --- /dev/null +++ b/build.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -e +BUILD_DIR="build" +BUILD_BIN="tinyraycaster" + +# Take care of dependencies +if [ "$(uname)" == "Darwin" ]; then + if brew help >/dev/null && ! brew list sdl2 >/dev/null 2>&1 ; then + brew install sdl2 + fi +elif [ "$(uname)" == "Linux" ]; then + # Ubuntu/Debian + if [ -f /etc/lsb-release ] && ! dpkg -l libsdl2-dev >/dev/null ; then + sudo apt install -y libsdl2-dev + fi +fi + +# Build the project and run it +if [ ! -d "${BUILD_DIR}" ]; then + mkdir "${BUILD_DIR}" +fi +cd "${BUILD_DIR}" +cmake .. +make +"./${BUILD_BIN}" From b392a764144b8e2851d4dae574bd46c29dbea5b5 Mon Sep 17 00:00:00 2001 From: "Paul N. Baker" Date: Mon, 11 Feb 2019 14:16:41 -0700 Subject: [PATCH 2/2] Ensuring git is installed first (most likely it is, but students are notoriously avoidant). Also fixing typo. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2dd8017..ae4eb50 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ As an example, [here are the sources](https://github.com/stephane-hulot/thanksgi ## Compilation ```sh -sudo apt-get install libsdl2-dev +sudo apt install -y libsdl2-dev git git clone https://github.com/ssloy/tinyraycaster.git cd tinyraycaster mkdir build @@ -44,7 +44,7 @@ cmake .. make ``` -You can open the project in Gitpod, a free online dev evironment for GitHub: +You can open the project in Gitpod, a free online dev environment for GitHub: [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/ssloy/tinyraycaster)