8349665: Make clean removes module-deps.gmk

Reviewed-by: erikj
This commit is contained in:
Magnus Ihse Bursie
2025-05-27 22:41:39 +00:00
parent 2e8b195a96
commit f25f4a3eb2
3 changed files with 18 additions and 7 deletions

View File

@@ -37,10 +37,6 @@ include MakeFileStart.gmk
include $(TOPDIR)/make/InitSupport.gmk
include LogUtils.gmk
# Force early generation of module-deps.gmk
GENERATE_MODULE_DEPS_FILE := true
include Modules.gmk
# Inclusion of this pseudo-target will cause make to execute this file
# serially, regardless of -j.
.NOTPARALLEL:
@@ -144,6 +140,14 @@ main: $(INIT_TARGETS)
( cd $(TOPDIR) && \
$(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \
$(SEQUENTIAL_TARGETS) )
# We might have cleaned away essential files, recreate them.
( cd $(TOPDIR) && \
$(MAKE) $(MAKE_ARGS) -j 1 -f make/GenerateFindTests.gmk \
$(USER_MAKE_VARS) )
( cd $(TOPDIR) && \
$(MAKE) $(MAKE_ARGS) -j 1 -f make/Main.gmk $(USER_MAKE_VARS) \
UPDATE_MODULE_DEPS=true NO_RECIPES=true \
create-main-targets-include )
endif
ifneq ($(PARALLEL_TARGETS), )
$(call PrepareFailureLogs)

View File

@@ -42,6 +42,12 @@ include MakeFileStart.gmk
include $(TOPDIR)/make/MainSupport.gmk
include FindTests.gmk
ifeq ($(UPDATE_MODULE_DEPS), true)
# Update module-deps.gmk if requested. This is read in Modules.gmk.
GENERATE_MODULE_DEPS_FILE := true
endif
include Modules.gmk
# Are we requested to ignore dependencies?

View File

@@ -268,11 +268,12 @@ define DefineMainTargets
$$(main_targets_file):
@( cd $$(TOPDIR) && \
$$(MAKE) $$(MAKE_LOG_FLAGS) -r -R -f $$(TOPDIR)/make/GenerateFindTests.gmk \
$$(MAKE) $$(MAKE_LOG_FLAGS) -s -r -R -f $$(TOPDIR)/make/GenerateFindTests.gmk \
-I $$(TOPDIR)/make/common SPEC=$$(SPEC_FILE) TOPDIR_ALT=$$(TOPDIR))
@( cd $$(TOPDIR) && \
$$(MAKE) $$(MAKE_LOG_FLAGS) -r -R -f $$(TOPDIR)/make/Main.gmk \
-I $$(TOPDIR)/make/common SPEC=$$(SPEC_FILE) TOPDIR_ALT=$$(TOPDIR) NO_RECIPES=true \
$$(MAKE) $$(MAKE_LOG_FLAGS) -s -r -R -f $$(TOPDIR)/make/Main.gmk \
-I $$(TOPDIR)/make/common SPEC=$$(SPEC_FILE) TOPDIR_ALT=$$(TOPDIR) \
UPDATE_MODULE_DEPS=true NO_RECIPES=true \
$$(MAKE_LOG_VARS) \
create-main-targets-include )