diff --git a/build-ninja.sh b/build-ninja.sh deleted file mode 100755 index 34e1265..0000000 --- a/build-ninja.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/bash -set -e - -echo build files will be placed in ./build -./third-party/premake5/premake5 premake-ninja -ninja $1 -C build diff --git a/build.sh b/build.sh deleted file mode 100755 index a406ee7..0000000 --- a/build.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/bash -set -e - -echo build files will be placed in ./build -./third-party/premake5/premake5 gmake2 -make -C build config=$1 diff --git a/clean-ninja.sh b/clean-ninja.sh deleted file mode 100755 index eb7b714..0000000 --- a/clean-ninja.sh +++ /dev/null @@ -1,7 +0,0 @@ -#! /bin/bash -if [ -z "$1" ] || [ $# -eq 0 ] - then - ninja -C build -t clean - else - ninja -C build -t clean $1 -fi \ No newline at end of file diff --git a/clean.sh b/clean.sh deleted file mode 100755 index d61a789..0000000 --- a/clean.sh +++ /dev/null @@ -1,7 +0,0 @@ -#! /bin/bash -if [ -z "$1" ] || [ $# -eq 0 ] - then - make -C build config=Debug clean && make config=Release clean - else - make -C build config=$1 clean -fi \ No newline at end of file diff --git a/run.sh b/run.sh deleted file mode 100755 index 37d3189..0000000 --- a/run.sh +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/bash - -./bin/$1-linux-x86_64/snake \ No newline at end of file diff --git a/Create-Solution.bat b/scripts/Create-Solution.bat similarity index 53% rename from Create-Solution.bat rename to scripts/Create-Solution.bat index 4b14c6d..e1a205e 100644 --- a/Create-Solution.bat +++ b/scripts/Create-Solution.bat @@ -1,4 +1,4 @@ @ECHO OFF ECHO Project files will be written to ./build -.\third-party\premake5\premake5.exe vs2022 +..\third-party\premake5\premake5.exe vs2022 PAUSE \ No newline at end of file diff --git a/scripts/build-ninja.sh b/scripts/build-ninja.sh new file mode 100755 index 0000000..c28bc32 --- /dev/null +++ b/scripts/build-ninja.sh @@ -0,0 +1,9 @@ +#! /bin/bash +set -e + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "$SCRIPT_DIR" + +echo build files will be placed in /build +../third-party/premake5/premake5 premake-ninja && ninja $1 -C ../build + diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 0000000..d46c29c --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,8 @@ +#! /bin/bash +set -e + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "$SCRIPT_DIR" + +echo build files will be placed in ./build +./third-party/premake5/premake5 gmake2 && make -C ../build config=$1 diff --git a/scripts/clean-ninja.sh b/scripts/clean-ninja.sh new file mode 100755 index 0000000..0078286 --- /dev/null +++ b/scripts/clean-ninja.sh @@ -0,0 +1,11 @@ +#! /bin/bash + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "$SCRIPT_DIR" + +if [ -z "$1" ] || [ $# -eq 0 ] + then + ninja -C ../build -t clean + else + ninja -C ../build -t clean $1 +fi \ No newline at end of file diff --git a/scripts/clean.sh b/scripts/clean.sh new file mode 100755 index 0000000..4095c54 --- /dev/null +++ b/scripts/clean.sh @@ -0,0 +1,11 @@ +#! /bin/bash + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "$SCRIPT_DIR" + +if [ -z "$1" ] || [ $# -eq 0 ] + then + make -C ../build config=Debug clean && make -C ../build config=Release clean + else + make -C ../build config=$1 clean +fi \ No newline at end of file diff --git a/ecc.sh b/scripts/ecc.sh similarity index 63% rename from ecc.sh rename to scripts/ecc.sh index 555ded6..fc4a4bc 100755 --- a/ecc.sh +++ b/scripts/ecc.sh @@ -1,4 +1,8 @@ #! /bin/bash + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "$SCRIPT_DIR" + if [ -z "$1" ] || [ $# -eq 0 ] then ./third-party/premake5/premake5 --config=Debug ecc diff --git a/premake5.lua b/scripts/premake5.lua similarity index 84% rename from premake5.lua rename to scripts/premake5.lua index 458bd78..c0061a8 100644 --- a/premake5.lua +++ b/scripts/premake5.lua @@ -1,7 +1,7 @@ require "ecc/ecc" require "ninja/ninja" -package.path = package.path .. ";third-party/premake-scripts/?.lua" +package.path = package.path .. ";../third-party/premake-scripts/?.lua" local ogg = require("build-ogg") local sfml = require("build-sfml") @@ -13,11 +13,13 @@ local imguisfml = require("build-imgui-sfml") local snake = require("project") +local rootdir = "../" + workspace "snake" architecture "x64" startproject"snake" configurations{"Debug", "Release"} - location "build" + location (rootdir .. "build") filter"system:linux" staticruntime"Off" @@ -32,9 +34,9 @@ workspace "snake" output_dir = "%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}" - intdir = "intermediate-files/" - bindir = "bin/" .. output_dir - liboutdir = "lib/" .. output_dir + intdir = rootdir .. "intermediate-files/" + bindir = rootdir .. "bin/" .. output_dir + liboutdir = rootdir.. "lib/" .. output_dir externalwarnings "Off" diff --git a/project.lua b/scripts/project.lua similarity index 69% rename from project.lua rename to scripts/project.lua index f5051e5..c5b0e0e 100644 --- a/project.lua +++ b/scripts/project.lua @@ -1,8 +1,8 @@ local m = {} -local scriptdir = path.getabsolute(path.getdirectory(_SCRIPT)) +local rootdir = path.join(path.getabsolute(path.getdirectory(_SCRIPT)), "../") -package.path = package.path .. ";third-party/premake-scripts/?.lua" +package.path = package.path .. ";../third-party/premake-scripts/?.lua" local sfml = require("build-sfml") local imgui = require("build-imgui") @@ -17,7 +17,7 @@ project "snake" kind "WindowedApp" targetname "snake" targetdir (bindir) - debugdir (scriptdir) + debugdir (rootdir) objdir (intdir) -- link order matters on GCC/Clang @@ -27,15 +27,15 @@ project "snake" includedirs { - path.join(scriptdir, "src"), - path.join(scriptdir, "include"), + path.join(rootdir, "src"), + path.join(rootdir, "include"), } files { - path.join(scriptdir, "src/**.cpp"), - path.join(scriptdir, "include/**.h"), - path.join(scriptdir, "include/**.hpp"), + path.join(rootdir, "src/**.cpp"), + path.join(rootdir, "include/**.h"), + path.join(rootdir, "include/**.hpp"), } --windows specific settings-- diff --git a/scripts/run.sh b/scripts/run.sh new file mode 100755 index 0000000..1440b6b --- /dev/null +++ b/scripts/run.sh @@ -0,0 +1,6 @@ +#! /bin/bash + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd "$SCRIPT_DIR" + +../bin/$1-linux-x86_64/snake \ No newline at end of file