From 8bdd2d5ddd4dbd8f731eed1b7fc4c156e30bf453 Mon Sep 17 00:00:00 2001 From: Yossi Gottlieb Date: Wed, 11 May 2022 12:06:33 +0300 Subject: [PATCH] Fix Makefile.dep generation with ICC. (#10708) Before this commit, all source files including those that are not going to be compiled were used. Some of these files are platform specific and won't even pre-process on another platform. With GCC/Clang, that's not an issue and they'll simply ignore them, but ICC aborts in this case. This commit only attempts to generate Makefile.dep from the actual set of C source files that will be compiled. --- src/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 2a0d74d827..278b6afb18 100644 --- a/src/Makefile +++ b/src/Makefile @@ -323,6 +323,7 @@ REDIS_BENCHMARK_NAME=redis-benchmark$(PROG_SUFFIX) REDIS_BENCHMARK_OBJ=ae.o anet.o redis-benchmark.o adlist.o dict.o zmalloc.o redisassert.o release.o crcspeed.o crc64.o siphash.o crc16.o monotonic.o cli_common.o mt19937-64.o REDIS_CHECK_RDB_NAME=redis-check-rdb$(PROG_SUFFIX) REDIS_CHECK_AOF_NAME=redis-check-aof$(PROG_SUFFIX) +ALL_SOURCES=$(sort $(patsubst %.o,%.c,$(REDIS_SERVER_OBJ) $(REDIS_CLI_OBJ) $(REDIS_BENCHMARK_OBJ))) all: $(REDIS_SERVER_NAME) $(REDIS_SENTINEL_NAME) $(REDIS_CLI_NAME) $(REDIS_BENCHMARK_NAME) $(REDIS_CHECK_RDB_NAME) $(REDIS_CHECK_AOF_NAME) @echo "" @@ -330,7 +331,7 @@ all: $(REDIS_SERVER_NAME) $(REDIS_SENTINEL_NAME) $(REDIS_CLI_NAME) $(REDIS_BENCH @echo "" Makefile.dep: - -$(REDIS_CC) -MM *.c > Makefile.dep 2> /dev/null || true + -$(REDIS_CC) -MM $(ALL_SOURCES) > Makefile.dep 2> /dev/null || true ifeq (0, $(words $(findstring $(MAKECMDGOALS), $(NODEPS)))) -include Makefile.dep