Skip to content

Commit 8bdd2d5

Browse files
authored
Fix Makefile.dep generation with ICC. (redis#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.
1 parent bfbb15f commit 8bdd2d5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -323,14 +323,15 @@ REDIS_BENCHMARK_NAME=redis-benchmark$(PROG_SUFFIX)
323323
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
324324
REDIS_CHECK_RDB_NAME=redis-check-rdb$(PROG_SUFFIX)
325325
REDIS_CHECK_AOF_NAME=redis-check-aof$(PROG_SUFFIX)
326+
ALL_SOURCES=$(sort $(patsubst %.o,%.c,$(REDIS_SERVER_OBJ) $(REDIS_CLI_OBJ) $(REDIS_BENCHMARK_OBJ)))
326327

327328
all: $(REDIS_SERVER_NAME) $(REDIS_SENTINEL_NAME) $(REDIS_CLI_NAME) $(REDIS_BENCHMARK_NAME) $(REDIS_CHECK_RDB_NAME) $(REDIS_CHECK_AOF_NAME)
328329
@echo ""
329330
@echo "Hint: It's a good idea to run 'make test' ;)"
330331
@echo ""
331332

332333
Makefile.dep:
333-
-$(REDIS_CC) -MM *.c > Makefile.dep 2> /dev/null || true
334+
-$(REDIS_CC) -MM $(ALL_SOURCES) > Makefile.dep 2> /dev/null || true
334335

335336
ifeq (0, $(words $(findstring $(MAKECMDGOALS), $(NODEPS))))
336337
-include Makefile.dep

0 commit comments

Comments
 (0)