Skip to content

Loading…

Add ccache support to Makefile #1571

Closed
wants to merge 1 commit into from

2 participants

@mattsta

[Continuing the march of Tiny Non-Feature-Impacting Improvements.]

ccache helps when switching between many
branches. It just caches the previously
built object and puts it in place on an
unchanged re-compile.

You can even do the clever thing of having
a post-checkout hook to automatically re-build
your current directory (the build should happen
in less than a second if you've previously
build the branch you're switching to).

@mattsta mattsta Add ccache support to Makefile
ccache helps when switching between many
branches.  It just caches the previously
built object and puts it in place on an
unchanged re-compile.

You can even do the clever thing of having
a post-checkout hook to automatically re-build
your current directory (the build should happen
in less than a second if you've previously
build the branch you're switching to).
79455ce
@antirez
Owner

Sounds great and useful at least for development... testing it.

@mattsta

[not needed due to redis compiling fast enough with make -j]

@mattsta mattsta closed this
@mattsta mattsta deleted the mattsta:enable-ccache branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 28, 2014
  1. @mattsta

    Add ccache support to Makefile

    mattsta committed
    ccache helps when switching between many
    branches.  It just caches the previously
    built object and puts it in place on an
    unchanged re-compile.
    
    You can even do the clever thing of having
    a post-checkout hook to automatically re-build
    your current directory (the build should happen
    in less than a second if you've previously
    build the branch you're switching to).
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/Makefile
View
5 src/Makefile
@@ -88,6 +88,11 @@ ifeq ($(MALLOC),jemalloc)
FINAL_LIBS+= ../deps/jemalloc/lib/libjemalloc.a -ldl
endif
+CCACHE_EXISTS := $(shell which ccache)
+ifdef CCACHE_EXISTS
+ CC := ccache $(CC)
+endif
+
REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS)
REDIS_LD=$(QUIET_LINK)$(CC) $(FINAL_LDFLAGS)
REDIS_INSTALL=$(QUIET_INSTALL)$(INSTALL)
Something went wrong with that request. Please try again.