# 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)
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
# 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 "<BLANKLINE>".
-sage_listings/%.py: sage_listings/%.listing
+# we replace any blank lines by "<BLANKLINE>". 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 '"""' >> $@