Enable ccache in Makefile.

This commit is contained in:
Alan Mishchenko 2026-02-18 10:01:16 -08:00
parent 3cdb1c4c3b
commit 62d05a8832
1 changed files with 8 additions and 0 deletions

View File

@ -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\)'`