aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaghuram Subramani <raghus2247@gmail.com>2024-12-30 11:32:32 -0500
committerRaghuram Subramani <raghus2247@gmail.com>2024-12-30 11:32:32 -0500
commit04f2be3720904518abbe643f70a87adbef98b6f4 (patch)
tree7fff87045f87bc58c22bf78d074c038156772bbf
parentb8a4b7e391328faf5c1e4cb8dbd9b5f55572834b (diff)
build: Create a custom target for clean
Since the clean target doesn't know about iso/ and cmos.iso (they were custom targets), we need a custom clean target that deletes those along with the typical output files.
-rw-r--r--CMakeLists.txt8
-rw-r--r--env.sh2
2 files changed, 9 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1621085..24cb5b4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -40,3 +40,11 @@ add_custom_target(run-gdb
DEPENDS iso
)
+
+add_custom_target(clean-custom
+ rm -rf
+ ${CMAKE_BINARY_DIR}/iso
+ ${CMAKE_BINARY_DIR}/cmos.iso
+
+ DEPENDS clean
+)
diff --git a/env.sh b/env.sh
index 172b913..0d6a587 100644
--- a/env.sh
+++ b/env.sh
@@ -28,7 +28,7 @@ alias b="mkdir -p $dir/build && cd $dir/build"
CMAKE_FLAGS="-G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=true"
alias cm="cmake $CMAKE_FLAGS"
alias n="ninja"
-alias nc="ninja clean"
+alias nc="ninja clean-custom"
alias nr="ninja run"
alias ni="ninja iso"
alias ng="ninja run-gdb"