build: Add shell file support
This commit is contained in:
parent
ab49f1e533
commit
5fa8dda890
24
Makefile
24
Makefile
@ -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)
|
34
scripts/BuildProject.sh
Executable file
34
scripts/BuildProject.sh
Executable file
@ -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
|
24
scripts/Makefile
Normal file
24
scripts/Makefile
Normal file
@ -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)
|
Loading…
Reference in New Issue
Block a user