From 62d05a883257005be93cf9a872ac24b10f2e0b88 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Wed, 18 Feb 2026 10:01:16 -0800 Subject: [PATCH] Enable ccache in Makefile. --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index a9d9b79c5..eeff20d24 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,13 @@ CXX := g++ AR := ar LD := $(CXX) +# Auto-enable ccache if available +CCACHE := $(shell command -v ccache 2>/dev/null) +ifneq ($(CCACHE),) + CC := $(CCACHE) $(CC) + CXX := $(CCACHE) $(CXX) +endif + MSG_PREFIX ?= ABCSRC ?= . VPATH = $(ABCSRC) @@ -219,6 +226,7 @@ clean: $(VERBOSE)rm -rvf $(OBJ) $(VERBOSE)rm -rvf $(GARBAGE) $(VERBOSE)rm -rvf $(OBJ:.o=.d) + @if [ -n "$(CCACHE)" ]; then echo "$(MSG_PREFIX)ccache available: $(CCACHE)"; fi tags: etags `find . -type f -regex '.*\.\(c\|h\)'`