aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-12-22 14:23:04 -0500
committerBruce Hill <bruce@bruce-hill.com>2025-12-22 14:23:04 -0500
commit01cbec2d67399b7e8d18d409d1b1eccf00aba733 (patch)
treea9966013969a19b3307ae0aa0d86157b7cb0d6f2 /Makefile
parent123e84696354be18bfd881b939d642b0a94f756f (diff)
Fix makefile progress indicator
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 2 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 7f247b49..965ccbe3 100644
--- a/Makefile
+++ b/Makefile
@@ -18,24 +18,14 @@ else
include config.mk
# Modified progress counter based on: https://stackoverflow.com/a/35320895
-# Only run counter if we're actually building (not for phony targets or no-ops)
ifndef NO_PROGRESS
ifndef ECHO
-# Only count if building actual files, not just checking
-ifneq ($(filter build all,$(MAKECMDGOALS)),)
-T := $(shell $(MAKE) ECHO="COUNTTHIS" $(filter-out check-c-compiler check-libs,$(MAKECMDGOALS)) --no-print-directory \
- -nq 2>/dev/null | grep -c "COUNTTHIS")
-ifeq ($(T),0)
-ECHO = echo
-else
+T := $(shell $(MAKE) ECHO="COUNTTHIS" $(MAKECMDGOALS) --no-print-directory \
+ -n | grep -c "COUNTTHIS")
N := x
C = $(words $N)$(eval N := x $N)
ECHO = echo -e "[`expr $C '*' 100 / $T`%]"
endif
-else
-ECHO = echo
-endif
-endif
endif
ifndef ECHO
ECHO = echo