From 336d40293a5638b833b05ca8451f150672b09d80 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 21 Jan 2024 12:27:06 -0800 Subject: [PATCH 1/4] Makefile: Run 'make reconfigure' less often --- Makefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 550039a1df6..a4452951cd2 100644 --- a/Makefile +++ b/Makefile @@ -50,7 +50,16 @@ SPKG_COLLECT_FILES = build/pkgs/*/type build/pkgs/*/package-version.txt build/pk # If configure was run before, rerun it with the old arguments. # Otherwise, run configure with argument $PREREQ_OPTIONS. build/make/Makefile: configure $(SPKG_COLLECT_FILES) $(CONFIG_FILES:%=%.in) - $(MAKE) reconfigure + @if [ -x config.status ]; then \ + case '$?' in \ + *configure*) \ + $(MAKE) reconfigure;; \ + *) \ + ./config.status;; \ + esac; \ + else \ + $(MAKE) reconfigure; \ + fi reconfigure: rm -f config.log From 12a938522160863e991418462048537abac579bb Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 21 Jan 2024 12:29:02 -0800 Subject: [PATCH 2/4] Makefile: Update a comment --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a4452951cd2..c3fbc733162 100644 --- a/Makefile +++ b/Makefile @@ -47,8 +47,10 @@ CONFIG_FILES = build/make/Makefile src/bin/sage-env-config build/bin/sage-build- # SPKG_COLLECT_FILES contains all files that influence the SAGE_SPKG_COLLECT macro SPKG_COLLECT_FILES = build/pkgs/*/type build/pkgs/*/package-version.txt build/pkgs/*/dependencies build/pkgs/*/requirements.txt build/pkgs/*/checksums.ini build/pkgs/*/spkg-install -# If configure was run before, rerun it with the old arguments. -# Otherwise, run configure with argument $PREREQ_OPTIONS. +# If configure was not run before, complain. +# If configure is newer than the files it generated (we test build/make/Makefile), +# we regenerate config.status by running the "config.status --recheck". +# Either way we regenerate the generated files by calling "config.status". build/make/Makefile: configure $(SPKG_COLLECT_FILES) $(CONFIG_FILES:%=%.in) @if [ -x config.status ]; then \ case '$?' in \ From 8526c3eeca0753c8f5a1b49646de688ab0b33587 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 7 Mar 2024 19:13:21 -0800 Subject: [PATCH 3/4] Makefile: Fix definition of SPKG_COLLECT_FILES --- Makefile | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index c3fbc733162..b5286a7439e 100644 --- a/Makefile +++ b/Makefile @@ -44,23 +44,24 @@ SAGE_ROOT_LOGS = logs # except for build/make/Makefile-auto, which is unused by the build system CONFIG_FILES = build/make/Makefile src/bin/sage-env-config build/bin/sage-build-env-config pkgs/sage-conf/_sage_conf/_conf.py -# SPKG_COLLECT_FILES contains all files that influence the SAGE_SPKG_COLLECT macro -SPKG_COLLECT_FILES = build/pkgs/*/type build/pkgs/*/package-version.txt build/pkgs/*/dependencies build/pkgs/*/requirements.txt build/pkgs/*/checksums.ini build/pkgs/*/spkg-install +# SPKG_COLLECT_FILES contains the files that influence the *runtime* of the +# portions of the 'configure' script generated by the SAGE_SPKG_COLLECT macro +SPKG_COLLECT_FILES = build/pkgs/*/package-version.txt build/pkgs/*/dependencies* # If configure was not run before, complain. # If configure is newer than the files it generated (we test build/make/Makefile), # we regenerate config.status by running the "config.status --recheck". # Either way we regenerate the generated files by calling "config.status". build/make/Makefile: configure $(SPKG_COLLECT_FILES) $(CONFIG_FILES:%=%.in) - @if [ -x config.status ]; then \ - case '$?' in \ - *configure*) \ - $(MAKE) reconfigure;; \ - *) \ - ./config.status;; \ - esac; \ - else \ - $(MAKE) reconfigure; \ + @if [ -x config.status ]; then \ + case '$?' in \ + *configure*|*package-version*|*dependencies*) \ + $(MAKE) reconfigure;; \ + *) \ + ./config.status;; \ + esac; \ + else \ + $(MAKE) reconfigure; \ fi reconfigure: @@ -335,7 +336,14 @@ ptestoptionallong-nodoc: ############################################################################### -configure: bootstrap src/doc/bootstrap configure.ac src/bin/sage-version.sh m4/*.m4 build/pkgs/*/spkg-configure.m4 build/pkgs/*/type build/pkgs/*/install-requires.txt build/pkgs/*/package-version.txt build/pkgs/*/distros/*.txt +# The 'configure' script is just one of the files generated by 'bootstrap'. +# CONFIGURE_DEPENDENCIES is the list of files that influence the generation of 'configure'. +CONFIGURE_DEPENDENCIES=configure.ac src/bin/sage-version.sh m4/*.m4 build/pkgs/*/spkg-configure.m4 \ + build/pkgs/*/type build/pkgs/*/SPKG.rst build/pkgs/*/checksums.ini build/pkgs/*/requirements.txt build/pkgs/*/install-requires.txt build/pkgs/*/package-version.txt build/pkgs/*/spkg-install build/pkgs/*/spkg-install.in +# SPKG_INFO_DEPENDENCIES is the list of files that influence the run of 'sage-spkg-info' and hence +# the generation of the files generated in 'src/doc' by 'src/doc/bootstrap'. +SPKG_INFO_DEPENDENCIES=build/pkgs/*/type build/pkgs/*/SPKG.rst build/pkgs/*/requirements.txt build/pkgs/*/install-requires.txt build/pkgs/*/package-version.txt build/pkgs/*/distros/*.txt +configure: bootstrap src/doc/bootstrap $(CONFIGURE_DEPENDENCIES) $(SPKG_INFO_DEPENDENCIES) ./bootstrap -d install: all From 663c2223b355e508301ce1727d0f611bda092b6e Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Thu, 7 Mar 2024 21:41:25 -0800 Subject: [PATCH 4/4] Makefile: Reformat variable settings --- Makefile | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index b5286a7439e..56e11c69f50 100644 --- a/Makefile +++ b/Makefile @@ -338,11 +338,22 @@ ptestoptionallong-nodoc: # The 'configure' script is just one of the files generated by 'bootstrap'. # CONFIGURE_DEPENDENCIES is the list of files that influence the generation of 'configure'. -CONFIGURE_DEPENDENCIES=configure.ac src/bin/sage-version.sh m4/*.m4 build/pkgs/*/spkg-configure.m4 \ - build/pkgs/*/type build/pkgs/*/SPKG.rst build/pkgs/*/checksums.ini build/pkgs/*/requirements.txt build/pkgs/*/install-requires.txt build/pkgs/*/package-version.txt build/pkgs/*/spkg-install build/pkgs/*/spkg-install.in +CONFIGURE_DEPENDENCIES = \ + configure.ac src/bin/sage-version.sh m4/*.m4 \ + build/pkgs/*/spkg-configure.m4 \ + build/pkgs/*/type build/pkgs/*/SPKG.rst \ + build/pkgs/*/checksums.ini build/pkgs/*/requirements.txt \ + build/pkgs/*/install-requires.txt build/pkgs/*/package-version.txt \ + build/pkgs/*/spkg-install build/pkgs/*/spkg-install.in + # SPKG_INFO_DEPENDENCIES is the list of files that influence the run of 'sage-spkg-info' and hence # the generation of the files generated in 'src/doc' by 'src/doc/bootstrap'. -SPKG_INFO_DEPENDENCIES=build/pkgs/*/type build/pkgs/*/SPKG.rst build/pkgs/*/requirements.txt build/pkgs/*/install-requires.txt build/pkgs/*/package-version.txt build/pkgs/*/distros/*.txt +SPKG_INFO_DEPENDENCIES = \ + build/pkgs/*/type build/pkgs/*/SPKG.rst \ + build/pkgs/*/requirements.txt \ + build/pkgs/*/install-requires.txt build/pkgs/*/package-version.txt \ + build/pkgs/*/distros/*.txt + configure: bootstrap src/doc/bootstrap $(CONFIGURE_DEPENDENCIES) $(SPKG_INFO_DEPENDENCIES) ./bootstrap -d