Skip to content

Commit 1036182

Browse files
committed
Generate Makefile.dep at every build.
Normally we used to update it from time to time. Too fragile... better to generate dependencies at every run and delete them on 'make clean'.
1 parent abb3385 commit 1036182

File tree

3 files changed

+6
-194
lines changed

3 files changed

+6
-194
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ deps/lua/src/liblua.a
2727
.make-*
2828
.prerequisites
2929
*.dSYM
30+
Makefile.dep

src/Makefile

+5-8
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,12 @@ all: $(REDIS_SERVER_NAME) $(REDIS_SENTINEL_NAME) $(REDIS_CLI_NAME) $(REDIS_BENCH
142142
@echo "Hint: It's a good idea to run 'make test' ;)"
143143
@echo ""
144144

145-
.PHONY: all
146-
147-
# Deps (use make dep to generate this)
148-
include Makefile.dep
145+
Makefile.dep:
146+
-$(REDIS_CC) -MM *.c > Makefile.dep 2> /dev/null || true
149147

150-
dep:
151-
$(REDIS_CC) -MM *.c > Makefile.dep
148+
-include Makefile.dep
152149

153-
.PHONY: dep
150+
.PHONY: all
154151

155152
persist-settings: distclean
156153
echo STD=$(STD) >> .make-settings
@@ -211,7 +208,7 @@ $(REDIS_CHECK_AOF_NAME): $(REDIS_CHECK_AOF_OBJ)
211208
$(REDIS_CC) -c $<
212209

213210
clean:
214-
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
211+
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
215212

216213
.PHONY: clean
217214

src/Makefile.dep

-186
This file was deleted.

0 commit comments

Comments
 (0)