summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschizoid <schizoidparty@aol.com>2024-12-06 15:09:51 -0500
committerschizoid <schizoidparty@aol.com>2024-12-06 15:09:51 -0500
commitf9466b817ff135384a76cbc9f05c3062547d5d51 (patch)
treeb7d1b21e8a47a5a02fdd50a16d6bfb0e45125abe
parent225ccc295e49bd479c9ae50bb51e2e530f0bd7f7 (diff)
Updated make.sh
-rw-r--r--make.sh17
1 files changed, 14 insertions, 3 deletions
diff --git a/make.sh b/make.sh
index 0d133cd..9b72bcf 100644
--- a/make.sh
+++ b/make.sh
@@ -1,4 +1,15 @@
-#!/usr/bin/zsh
+#!/bin/sh
+
+if command -v nproc >/dev/null 2>&1; then
+ cores=$(nproc)
+elif command -v sysctl >/dev/null 2>&1; then
+ cores=$(sysctl -n hw.ncpu)
+else
+ echo "Error: Unable to determine the number of CPU cores."
+ exit 1
+fi
+
+make clean;
+yes | rm config.h;
+make -j"$cores" && echo "Now run "doas make install" to install DWM" || echo "Error"
-rm config.h
-make install