From 42a91a8dd0b01e8777cf5d22debf51bb44bb63bc Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Wed, 25 Feb 2026 19:50:34 -0500 Subject: [PATCH] GNUmakefile.mjo: store converted sage listings under $(BUILDDIR) --- GNUmakefile.mjo | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/GNUmakefile.mjo b/GNUmakefile.mjo index c13e7d3..c284273 100644 --- a/GNUmakefile.mjo +++ b/GNUmakefile.mjo @@ -19,7 +19,7 @@ PN ?= $(patsubst %.git,%,$(notdir $(realpath .))) # MJOTEX = mjotex.sty # Compile a list of raw source code listings (*.listing) and their -# associated output files (*.py) that will be tested by check-sage. +# associated output files (*.sage.py) that will be tested by check-sage. # # SAGE_LISTING_SRCS = $(wildcard sage_listings/*.listing) @@ -73,7 +73,9 @@ MJOTEXPATHS = $(shell kpsewhich $(MJOTEX)) SRCS += $(MJOTEXPATHS) endif ifdef SAGE_LISTING_SRCS -SAGE_LISTING_DSTS = $(patsubst %.listing,%.py,$(SAGE_LISTING_SRCS)) +SAGE_LISTING_DSTS = $(patsubst %.listing,\ + $(BUILDDIR)/%.sage.py,\ + $(SAGE_LISTING_SRCS)) SRCS += $(SAGE_LISTING_DSTS) endif @@ -175,8 +177,11 @@ $(BUILDDIR)/$(PN).log: $(SRCS) # How do we convert a raw listing into something testable by sage? We # append/prepend triple quotes to make the whole thing into a doctest, # strip all comment lines (only outside of a sage: prompt), and then -# we replace any blank lines by "". -sage_listings/%.py: sage_listings/%.listing +# we replace any blank lines by "". The "mkdir -p" is there +# so that we can organize our *.listing files into subdirectories +# without messing up the build. +$(BUILDDIR)/%.sage.py: %.listing + mkdir -p $$(dirname "$@") echo '"""' > $@ cat $< >> $@ echo '"""' >> $@ -- 2.51.0