From f9c185e5e802d2d338783fc4ec2a435fccac5d21 Mon Sep 17 00:00:00 2001 From: Zoltan Somogyi Date: Fri, 20 Oct 2023 20:11:45 +1100 Subject: [PATCH] Start actively using --generate-dependencies-ints. configure.ac: Require the installed compiler to support both the option, and the Mmake rules that invoke it. compiler/Mmakefile: library/Mmakefile: mdbcomp/Mmakefile: mfilterjavac/Mmakefile: ssdb/Mmakefile: Get the mmake depend to depend on prog.depend_ints, not prog.depend, Give the prog.depend_ints targets themselves the same prerequisites as the existing prog.depend targets. In mfilterjavac/Mmakefile, fix what looks like an old problem by making the depend target a prerequisite of the check and ints targets. --- compiler/Mmakefile | 7 +++---- configure.ac | 2 +- library/Mmakefile | 2 +- mdbcomp/Mmakefile | 12 +++++++----- mfilterjavac/Mmakefile | 12 +++++++----- ssdb/Mmakefile | 7 +++++-- 6 files changed, 24 insertions(+), 18 deletions(-) diff --git a/compiler/Mmakefile b/compiler/Mmakefile index 08aec3ca1..d67c9f64f 100644 --- a/compiler/Mmakefile +++ b/compiler/Mmakefile @@ -84,12 +84,11 @@ endif # Specify the name of the top-level module to build. MC_PROG = mercury_compile -# mercury_compile - .PHONY: depend -depend: $(MC_PROG).depend +depend: $(MC_PROG).depend_ints -$(MC_PROG).depend: Mercury.modules COMP_FLAGS +$(MC_PROG).depend: Mercury.modules COMP_FLAGS +$(MC_PROG).depend_ints: Mercury.modules COMP_FLAGS # This directory contains source files for which the module # name doesn't match the file name, so smart recompilation diff --git a/configure.ac b/configure.ac index 9bb58898a..af31e073d 100644 --- a/configure.ac +++ b/configure.ac @@ -604,7 +604,7 @@ EOF $BOOTSTRAP_MC \ --verbose \ $link_static_opt conftest \ - --warn-obsolete-transform-2023-07-03 \ + --gen-dep-ints-2023-10-15 \ --allow-ho-insts-as-modes \ --no-ssdb \ &AS_MESSAGE_LOG_FD 2>&1 && diff --git a/library/Mmakefile b/library/Mmakefile index 4c43634df..e2ebe87f7 100644 --- a/library/Mmakefile +++ b/library/Mmakefile @@ -188,7 +188,7 @@ mercury: lib_std #-----------------------------------------------------------------------------# .PHONY: depend -depend: LIB_FLAGS getopt.m copy_java_runtime_files $(STD_LIB_NAME).depend +depend: LIB_FLAGS getopt.m copy_java_runtime_files $(STD_LIB_NAME).depend_ints .PHONY: check check: $(STD_LIB_NAME).check diff --git a/mdbcomp/Mmakefile b/mdbcomp/Mmakefile index d93ddaf20..22c48e9cb 100644 --- a/mdbcomp/Mmakefile +++ b/mdbcomp/Mmakefile @@ -39,6 +39,7 @@ MERCURY_MAIN_LIB_MODULES=$(MDBCOMP_LIB_NAME) MERCURY_MAIN_MODULES=$(MERCURY_MAIN_LIB_MODULES) DEPENDS = $(patsubst %,%.depend,$(MERCURY_MAIN_MODULES)) +DEPEND_INTS = $(patsubst %,%.depend_ints,$(MERCURY_MAIN_MODULES)) INTS_TARGETS = $(patsubst %,%.ints,$(MERCURY_MAIN_MODULES)) INT3S_TARGETS = $(patsubst %,%.int3s,$(MERCURY_MAIN_MODULES)) LIBS = $(patsubst %,lib%,$(MERCURY_MAIN_LIB_MODULES)) @@ -136,15 +137,16 @@ library: $(LIBS) all-ints: $(MDBCOMP_LIB_NAME).int3s $(MDBCOMP_LIB_NAME).ints .PHONY: depend -depend: MDBCOMP_FLAGS $(DEPENDS) -$(DEPENDS): Mercury.modules +depend: MDBCOMP_FLAGS $(DEPEND_INTS) +$(DEPENDS): Mercury.modules +$(DEPEND_INTS): Mercury.modules # $(BROWSER_LIB_NAME).dep $(BROWSER_LIB_NAME).depend: # $(MCD) $(ALL_GRADEFLAGS) $(ALL_MCDFLAGS) $* -# This directory contains source files for which the module -# name doesn't match the file name, so smart recompilation -# won't work without the Mercury.modules file. +# This directory contains source files for which the module name +# does not match the file name, so smart recompilation won't work +# without the Mercury.modules file. Mercury.modules: MDBCOMP_FLAGS $(MC) $(ALL_GRADEFLAGS) $(ALL_MCFLAGS) -f *.m diff --git a/mfilterjavac/Mmakefile b/mfilterjavac/Mmakefile index 70713418e..50cf7d155 100644 --- a/mfilterjavac/Mmakefile +++ b/mfilterjavac/Mmakefile @@ -31,7 +31,8 @@ ALL_MODULES = mfilterjavac MAIN_TARGET=all MERCURY_MAIN_MODULES=$(ALL_MODULES) -DEPEND=$(patsubst %,%.depend,$(ALL_MODULES)) +DEPENDS=$(patsubst %,%.depends,$(ALL_MODULES)) +DEPEND_INTS=$(patsubst %,%.depend_ints,$(ALL_MODULES)) PDBS=$(patsubst %,%.pdb,$(ALL_MODULES)) VPATH = $(LIBRARY_DIR) $(SSDB_DIR) @@ -61,9 +62,10 @@ endif nothing: .PHONY: depend -depend: $(DEPEND) +depend: $(DEPEND_INTS) -$(DEPEND): MFILTERJAVAC_FLAGS +$(DEPENDS): MFILTERJAVAC_FLAGS +$(DEPEND_INTS): MFILTERJAVAC_FLAGS .PHONY: all all: $(ALL_MODULES) $(TAGS_FILE_EXISTS) @@ -84,10 +86,10 @@ $(cs_subdir)mfilterjavac.c: $(UTIL_DIR)/mkinit$(EXT_FOR_EXE) #-----------------------------------------------------------------------------# .PHONY: check -check: DEPEND=$(patsubst %,%.check,$(ALL_MODULES)) +check: depend $(patsubst %,%.check,$(ALL_MODULES)) .PHONY: ints -ints: DEPEND=$(patsubst %,%.ints,$(ALL_MODULES)) +ints: depend $(patsubst %,%.ints,$(ALL_MODULES)) #-----------------------------------------------------------------------------# diff --git a/ssdb/Mmakefile b/ssdb/Mmakefile index 34374cc8a..a21c94ef9 100644 --- a/ssdb/Mmakefile +++ b/ssdb/Mmakefile @@ -49,6 +49,7 @@ MERCURY_MAIN_MODULES=$(MERCURY_MAIN_LIB_MODULES) VPATH = $(LIBRARY_DIR) $(MDBCOMP_DIR) $(BROWSER_DIR) DEPENDS = $(patsubst %,%.depend,$(MERCURY_MAIN_MODULES)) +DEPEND_INTS = $(patsubst %,%.depend_ints,$(MERCURY_MAIN_MODULES)) INTS_TARGETS = $(patsubst %,%.ints,$(MERCURY_MAIN_MODULES)) INT3S_TARGETS = $(patsubst %,%.int3s,$(MERCURY_MAIN_MODULES)) LIBS = $(patsubst %,lib%,$(MERCURY_MAIN_LIB_MODULES)) @@ -148,8 +149,10 @@ all: library $(TAGS_FILE_EXISTS) browse_test declarative_test library: $(LIBS) .PHONY: depend -depend: $(DEPENDS) -$(DEPENDS): SSDB_FLAGS Mercury.modules +depend: $(DEPEND_INTS) + +$(DEPENDS): SSDB_FLAGS Mercury.modules +$(DEPEND_INTS): SSDB_FLAGS Mercury.modules # This directory contains source files for which the module # name doesn't match the file name, so smart recompilation