Skip to content

Commit f25f4a3

Browse files
committed
8349665: Make clean removes module-deps.gmk
Reviewed-by: erikj
1 parent 2e8b195 commit f25f4a3

3 files changed

Lines changed: 18 additions & 7 deletions

File tree

make/Init.gmk

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ include MakeFileStart.gmk
3737
include $(TOPDIR)/make/InitSupport.gmk
3838
include LogUtils.gmk
3939

40-
# Force early generation of module-deps.gmk
41-
GENERATE_MODULE_DEPS_FILE := true
42-
include Modules.gmk
43-
4440
# Inclusion of this pseudo-target will cause make to execute this file
4541
# serially, regardless of -j.
4642
.NOTPARALLEL:
@@ -144,6 +140,14 @@ main: $(INIT_TARGETS)
144140
( cd $(TOPDIR) && \
145141
$(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \
146142
$(SEQUENTIAL_TARGETS) )
143+
# We might have cleaned away essential files, recreate them.
144+
( cd $(TOPDIR) && \
145+
$(MAKE) $(MAKE_ARGS) -j 1 -f make/GenerateFindTests.gmk \
146+
$(USER_MAKE_VARS) )
147+
( cd $(TOPDIR) && \
148+
$(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \
149+
UPDATE_MODULE_DEPS=true NO_RECIPES=true \
150+
create-main-targets-include )
147151
endif
148152
ifneq ($(PARALLEL_TARGETS), )
149153
$(call PrepareFailureLogs)

make/Main.gmk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ include MakeFileStart.gmk
4242
include $(TOPDIR)/make/MainSupport.gmk
4343

4444
include FindTests.gmk
45+
46+
ifeq ($(UPDATE_MODULE_DEPS), true)
47+
# Update module-deps.gmk if requested. This is read in Modules.gmk.
48+
GENERATE_MODULE_DEPS_FILE := true
49+
endif
50+
4551
include Modules.gmk
4652

4753
# Are we requested to ignore dependencies?

make/PreInitSupport.gmk

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,12 @@ define DefineMainTargets
268268

269269
$$(main_targets_file):
270270
@( cd $$(TOPDIR) && \
271-
$$(MAKE) $$(MAKE_LOG_FLAGS) -r -R -f $$(TOPDIR)/make/GenerateFindTests.gmk \
271+
$$(MAKE) $$(MAKE_LOG_FLAGS) -s -r -R -f $$(TOPDIR)/make/GenerateFindTests.gmk \
272272
-I $$(TOPDIR)/make/common SPEC=$$(SPEC_FILE) TOPDIR_ALT=$$(TOPDIR))
273273
@( cd $$(TOPDIR) && \
274-
$$(MAKE) $$(MAKE_LOG_FLAGS) -r -R -f $$(TOPDIR)/make/Main.gmk \
275-
-I $$(TOPDIR)/make/common SPEC=$$(SPEC_FILE) TOPDIR_ALT=$$(TOPDIR) NO_RECIPES=true \
274+
$$(MAKE) $$(MAKE_LOG_FLAGS) -s -r -R -f $$(TOPDIR)/make/Main.gmk \
275+
-I $$(TOPDIR)/make/common SPEC=$$(SPEC_FILE) TOPDIR_ALT=$$(TOPDIR) \
276+
UPDATE_MODULE_DEPS=true NO_RECIPES=true \
276277
$$(MAKE_LOG_VARS) \
277278
create-main-targets-include )
278279

0 commit comments

Comments
 (0)