1616.DEFAULT_GOAL := all
1717
1818# 0 = Silent Mode; 1 = Color & Details Mode
19- ifneq ($(filter -j% ,$(MAKEFLAGS ) ) ,)
19+ VERBOSE ?= 1
20+
21+ # Optional: if the user passes -s (--silent), force VERBOSE=0
22+ ifneq ($(findstring s,$(MAKEFLAGS ) ) ,)
2023 VERBOSE := 0
21- else
22- VERBOSE := 1
24+ else ifneq ($(filter -j%,$(MAKEFLAGS)),)
25+ VERBOSE := 0
2326endif
2427
2528ifeq ($(VERBOSE ) ,1)
4245 HIGHLIGHT :=
4346endif
4447
48+ # Platform-specific detection for commands
49+
50+ UNAME_S := $(shell uname -s 2>/dev/null || echo Unknown)
51+
52+ ifeq ($(findstring Windows,$(OS ) ) ,Windows)
53+ IS_WINDOWS := yes
54+ else ifeq ($(UNAME_S),Darwin)
55+ IS_MACOS := yes
56+ else ifeq ($(UNAME_S),Linux)
57+ IS_LINUX := yes
58+ endif
59+
4560# ──────────────────────────────────────────────────────────────────────────────
4661# Main configuration – customize these variables
4762# ──────────────────────────────────────────────────────────────────────────────
@@ -105,7 +120,7 @@ endif
105120# Platform detection & common settings
106121# ──────────────────────────────────────────────────────────────────────────────
107122
108- ifeq ($(OS ) ,Windows_NT )
123+ ifeq ($(IS_WINDOWS ) ,yes )
109124 OS_NAME := Windows
110125 ifeq ($(USE_CONSOLE),false)
111126 CONSOLEFLAGS := -mwindows
@@ -128,11 +143,10 @@ ifeq ($(OS),Windows_NT)
128143 HOST_ARCH := x86_64
129144 endif
130145else
131- UNAME_S := $(shell uname -s)
132- ifeq ($(UNAME_S),Linux)
146+ ifeq ($(IS_LINUX),yes)
133147 OS_NAME := Linux
134148 endif
135- ifeq ($(UNAME_S),Darwin )
149+ ifeq ($(IS_MACOS),yes )
136150 OS_NAME := macOS
137151 endif
138152 RM := rm -rf
@@ -258,7 +272,7 @@ $(DEP_DIR)/%.d: ;
258272
259273.PHONY : clean-banner
260274clean-banner :
261- @clear 2> /dev/null || cls
275+ @if [ -t 1 ] ; then clear ; fi
262276ifeq ($(VERBOSE ) ,1)
263277 @printf "$(INFO_COLOR)─── Build: $(HIGHLIGHT)$(APP_NAME)$(NO_COLOR)\n"
264278 @printf " $(BOLD)> OS:$(NO_COLOR) %s\n" "$(OS_NAME)"
0 commit comments