Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 axiom (20170501-14) unstable; urgency=medium
 .
   * support gcl27
Author: Camm Maguire <camm@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout https://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: (upstream|backport|vendor|other), (<patch-url>|commit:<commit-id>)
Bug: <upstream-bugtracker-url>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: (no|not-needed|<patch-forwarded-url>)
Applied-Upstream: <version>, (<commit-url>|commit:<commid-id>)
Reviewed-By: <name and email of someone who approved/reviewed the patch>
Last-Update: 2025-02-12

--- axiom-20170501.orig/Makefile.pamphlet
+++ axiom-20170501/Makefile.pamphlet
@@ -87,7 +87,7 @@ Note that make cannot handle recursively
 directory so we have to expand the serial forms inline. Cheesy.
 
 \begin{chunk}{parallel}
-all: rootdirs axiom.sty tanglec libspad input_files book_files src_files
+all: rootdirs axiom.sty $(BOOKS)/tanglec libspad input_files book_files src_files
 #	@ echo 1 making a ${SYS} system, PART=${PART} SUBPART=${SUBPART}
 #	@ echo 2 Environment '${ENV}'
 #	@ ${BOOKS}/tanglec Makefile.pamphlet "Makefile.${SYS}" >Makefile.${SYS}
@@ -99,8 +99,8 @@ all: rootdirs axiom.sty tanglec libspad
 #	@ ${ENV} $(MAKE) -f Makefile.${SYS} 
 #	@ echo 3 finished system build on `date` | tee >lastBuildDate
 
-Makefile.${SYS}: Makefile.pamphlet
-	@ ${BOOKS}/tanglec $< "Makefile.${SYS}" >$@
+Makefile.${SYS}: Makefile.pamphlet ${BOOKS}/tanglec
+	${BOOKS}/tanglec $< "Makefile.${SYS}" >$@
 
 ${MNT}/${SYS}/doc/src/root.Makefile.pdf: Makefile.pdf
 	@cp $< $@
@@ -113,16 +113,15 @@ ${MNT}/${SYS}/doc/changepage.sty: ${BOOK
 
 Makefile.pdf: Makefile.pamphlet
 	@ ${EXTRACT} $<
-	
-src_files: Makefile.${SYS} ${MNT}/${SYS}/doc/src/root.Makefile.pdf \
-	   ${MNT}/${SYS}/doc/dvipdfm.def ${MNT}/${SYS}/doc/changepage.sty
+
+src_files: Makefile.${SYS} ${MNT}/${SYS}/doc/src/root.Makefile.pdf ${MNT}/${SYS}/doc/dvipdfm.def ${MNT}/${SYS}/doc/changepage.sty $(BOOKS)/tanglec 
 	@ echo 1 making a ${SYS} system, PART=${PART} SUBPART=${SUBPART}
 	@ echo 2 Environment '${ENV}'
-	@ ${ENV} $(MAKE) -f $< 
+	@ ${ENV} $(MAKE) -f $<
 
-libspad: rootdirs tanglec
+libspad: rootdirs $(BOOKS)/tanglec
 	@ echo 11a making libspad
-	@ ( cd ${OBJ}/${SYS}/lib ; \
+	( cd ${OBJ}/${SYS}/lib ; \
 	    ${BOOKS}/tanglec ${BOOKS}/bookvol8.pamphlet Makefile >Makefile ; \
             ${ENV} ${MAKE} libspad.a )
 
@@ -180,7 +179,7 @@ input:
 	     rm -f *.toc ; \
 	     rm -f *.aux ) ; fi
 
-input_files: $(patsubst ${SRC}/input/%.input.pamphlet, \
+input_files: $(BOOKS)/tanglec $(patsubst ${SRC}/input/%.input.pamphlet, \
 	       ${MNT}/${SYS}/doc/src/input/%.input.dvi, \
 	       $(shell ls -1 ${SRC}/input/*.input.pamphlet))
 
@@ -200,7 +199,7 @@ $(SPD)/books/Makefile.pdf: $(SPD)/books/
 ${MNT}/${SYS}/doc/src/books.Makefile.pdf: $(SPD)/books/Makefile.pdf
 	@cp $< $@
 
-book_files: ${MNT}/${SYS}/doc/src/books.Makefile.pdf
+book_files: $(BOOKS)/tanglec ${MNT}/${SYS}/doc/src/books.Makefile.pdf
 	@(cd books;$(ENV) $(MAKE))
 
 \end{chunk}
@@ -214,10 +213,10 @@ book_files: ${MNT}/${SYS}/doc/src/books.
 \getchunk{literate commands}
 \getchunk{install}
 
-document: 
+document: ${BOOKS}/tanglec
 	@ echo 4 making a ${SYS} system, PART=${PART} SUBPART=${SUBPART}
 	@ echo 5 Environment ${ENV}
-	@ ${BOOKS}/tanglec Makefile.pamphlet "Makefile.${SYS}" >Makefile.${SYS}
+	${BOOKS}/tanglec Makefile.pamphlet "Makefile.${SYS}" >Makefile.${SYS}
 	@ ${ENV} $(MAKE) -f Makefile.${SYS} document
 	@echo 6 finished system build on `date` | tee >lastBuildDate
 
@@ -483,7 +482,7 @@ TMP:=${OBJ}/tmp
 ZIPS:=${SPD}/zips
 BOOKS:=${SPD}/books
 SRCDIRS:="interpdir sharedir algebradir etcdir docdir \
-          graphdir hyperdir browserdir inputdir"
+          graphdir smandir hyperdir browserdir inputdir"
 
 SYS:=$(notdir $(AXIOM))
 DAASE:=${SRC}/share
@@ -623,9 +622,10 @@ book:
 \subsection{tanglec.c}
 \begin{chunk}{tanglec.c}
 
-tanglec: books/tanglec.c
+$(BOOKS)/tanglec: books/tanglec.c
 	@echo t01 making tanglec from books/tanglec.c
-	@( cd books ; gcc -o tanglec tanglec.c )
+	gcc -o $@ $< ; sleep 15
+#	@( cd books ; gcc -o tanglec tanglec.c )
 
 \end{chunk}
 
@@ -688,9 +688,9 @@ to choose. The default is 2.4.1 but if t
 then the Makefile is rewritten to extract the later version.
 It looks for a chunk name that matches the version number.
 \begin{chunk}{LSPMakefile}
-${LSP}/Makefile: ${LSP}/Makefile.pamphlet
+${LSP}/Makefile: ${BOOKS}/tanglec ${LSP}/Makefile.pamphlet
 	@echo 20 making ${LSP}/Makefile from ${LSP}/Makefile.pamphlet
-	@( cd lsp ; \
+	( cd lsp ; \
 	 ${EXTRACT} Makefile.pamphlet ; \
 	 if [ "${GCLVERSION}" != "gcl-2.4.1" ] ; then \
 	 ${BOOKS}/tanglec Makefile.pamphlet ${GCLVERSION} >Makefile ; \
--- axiom-20170501.orig/src/Makefile.pamphlet
+++ axiom-20170501/src/Makefile.pamphlet
@@ -49,7 +49,7 @@ processes including axiom, clef, nagman,
 \begin{chunk}{smandir}
 smandir: ${SPD}/books/bookvol6.pamphlet
 	@echo 5 making ${SRC}/sman
-	@( cd sman ; \
+	@( mkdir sman; cd sman ; \
 	   ${BOOKS}/tanglec ${BOOKS}/bookvol6.pamphlet >Makefile ; \
            ${ENV} ${MAKE} )
 
--- axiom-20170501.orig/src/etc/Makefile.pamphlet
+++ axiom-20170501/src/etc/Makefile.pamphlet
@@ -17,7 +17,9 @@ all of the algreba/*.nrlib/code.o files
 the databases. If any if any of these are changed, the databases must
 be re-built.
 \begin{chunk}{dbcomplete}
-${MNT}/${SYS}/algebra/*.daase: ${INT}/algebra/*.nrlib/code.o
+${MNT}/${SYS}/algebra/*.daase: rebuild
+
+rebuild: ${INT}/algebra/*.nrlib/code.o
 	@ echo se01 rebuilding databases...
 	@ cp ${SRC}/doc/gloss.text ${INT}/algebra
 	@ cp ${SRC}/doc/gloss.text ${INT}/algebra
