diff --git a/Makefile b/Makefile deleted file mode 100644 index fd57751..0000000 --- a/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -BUILD_DIR = build -EDITOR_DIR = editor -NAME = ferx - -RM += -r - -all: debug run - -release: - cmake -S . -B $(BUILD_DIR) -G Ninja -DCMAKE_BUILD_TYPE=Release - cmake --build $(BUILD_DIR) -j8 - -debug: - cmake -S . -B $(BUILD_DIR) -G Ninja -DCMAKE_BUILD_TYPE=Debug - cmake --build $(BUILD_DIR) -j8 - -run: - cd $(BUILD_DIR)/${EDITOR_DIR} && ./${NAME} - -clean: - cmake --build $(BUILD_DIR) --target clean - -clean-all: - $(RM) $(BUILD_DIR) diff --git a/scripts/BuildProject.sh b/scripts/BuildProject.sh new file mode 100755 index 0000000..6055f71 --- /dev/null +++ b/scripts/BuildProject.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +BUILD_DIR="build" +EDITOR_DIR="editor" +NAME="ferx" + +case $1 in + release) + cmake -S .. -B ../"$BUILD_DIR" -G Ninja -DCMAKE_BUILD_TYPE=Release + cmake --build ../"$BUILD_DIR" -j8 + ;; + debug) + cmake -S .. -B ../"$BUILD_DIR" -G Ninja -DCMAKE_BUILD_TYPE=Debug + cmake --build ../"$BUILD_DIR" -j8 + ;; + run) + cd "../$BUILD_DIR/$EDITOR_DIR" && ./"$NAME" + ;; + clean) + cmake --build ../"$BUILD_DIR" --target clean + ;; + clean-all) + rm -r ../"$BUILD_DIR" + ;; + all) + bash $0 enter_dir + bash $0 debug + bash $0 run + ;; + *) + echo "Usage: $0 {release|debug|run|clean|clean-all|all}" + exit 1 + ;; +esac diff --git a/scripts/Makefile b/scripts/Makefile new file mode 100644 index 0000000..5bcf81e --- /dev/null +++ b/scripts/Makefile @@ -0,0 +1,24 @@ +BUILD_DIR = build +EDITOR_DIR = editor +NAME = ferx + +RM += -r + +all: debug run + +release: + cmake -S .. -B ../$(BUILD_DIR) -G Ninja -DCMAKE_BUILD_TYPE=Release + cmake --build ../$(BUILD_DIR) -j8 + +debug: + cmake -S .. -B ../$(BUILD_DIR) -G Ninja -DCMAKE_BUILD_TYPE=Debug + cmake --build ../$(BUILD_DIR) -j8 + +run: + cd ../$(BUILD_DIR)/${EDITOR_DIR} && ./${NAME} + +clean: + cmake --build ../$(BUILD_DIR) --target clean + +clean-all: + $(RM) ../$(BUILD_DIR)