summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Sully <john@csquare.ca>2020-01-01 10:33:02 -0500
committerJohn Sully <john@csquare.ca>2020-01-01 10:33:02 -0500
commite5565a793e139f29970d46e3c681316f87fa16e8 (patch)
treee4f91e45e7b94652dce442e1eb15c582ee7a32d9
parent6e4f70b8170e14ba8a2ada2fde4a75e073effee3 (diff)
downloadredis-e5565a793e139f29970d46e3c681316f87fa16e8.tar.gz
Add support for incremental build with header files
-rw-r--r--.gitignore1
-rw-r--r--src/Makefile6
2 files changed, 6 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 717bf3c7c..8489dbacf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
.*.swp
*.o
+*.d
*.log
dump.rdb
redis-benchmark
diff --git a/src/Makefile b/src/Makefile
index 86a763e31..00b623a4b 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -283,14 +283,18 @@ $(REDIS_BENCHMARK_NAME): $(REDIS_BENCHMARK_OBJ)
dict-benchmark: dict.c zmalloc.c sds.c siphash.c
$(REDIS_CC) $(FINAL_CFLAGS) $^ -D DICT_BENCHMARK_MAIN -o $@ $(FINAL_LIBS)
+DEP = $(REDIS_SERVER_OBJ:%.o=%.d) $(REDIS_CLI_OBJ:%.o=%.d) $(REDIS_BENCHMARK_OBJ:%.o=%.d)
+-include $(DEP)
+
# Because the jemalloc.h header is generated as a part of the jemalloc build,
# building it should complete before building any other object. Instead of
# depending on a single artifact, build all dependencies first.
%.o: %.c .make-prerequisites
- $(REDIS_CC) -c $<
+ $(REDIS_CC) -MMD -o $@ -c $<
clean:
rm -rf $(REDIS_SERVER_NAME) $(REDIS_SENTINEL_NAME) $(REDIS_CLI_NAME) $(REDIS_BENCHMARK_NAME) $(REDIS_CHECK_RDB_NAME) $(REDIS_CHECK_AOF_NAME) *.o *.gcda *.gcno *.gcov redis.info lcov-html Makefile.dep dict-benchmark
+ rm -f $(DEP)
.PHONY: clean