From 3aafbdf0c13f40636938685b1ed3641dca5ee26c Mon Sep 17 00:00:00 2001 From: schizoid Date: Fri, 6 Dec 2024 14:54:28 -0500 Subject: Updated make.sh script for both Gnu/Linux and BSD --- make.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) mode change 100644 => 100755 make.sh (limited to 'make.sh') diff --git a/make.sh b/make.sh old mode 100644 new mode 100755 index 0d133cd..a5ffa69 --- a/make.sh +++ b/make.sh @@ -1,4 +1,14 @@ -#!/usr/bin/zsh +#!/bin/sh -rm config.h -make install +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" -- cgit v1.2.3