The build system as I found it had several interrelated flaws: (1) it
kept generated files such as aclocal.m4 and configure in the repo,
causing many spurious diffs when they were rebuilt, (2) it did a lot of
grubby copying of source files into the root directory, (3) it was
generally overcomplicated, playing strange games with GNU tools that
are already difficult to understand.
Most of the problems were readily solved by the modern practice of
having a autogen.sh script to bootstrap the build from a state of no
Makefile and no configure. The whole buildaux directory is gone
except for Makefile.am and ylwrap; those now live in the top-level
directory. Makefile.am is now much simpler, as is configure.ac.
To make running the compiler in place for regression-testing continue
working, I had to split the ICKDATADIR variable; it's now ICKSYSDIR
for INTERCAL system libraries and ICKCSKELDIR for the skeleton and
yuk-related files. Both will still point at /usr/local/share by
default.
I've probably broken the DESTDIR/build-directory logic; that will need
to be fixed. Relatedly, more could probably be done to stop the
build from crapping all over the distribution toplevel directory. Also,
the directory variables need to be re-thought and probably renamed.
But this is a good start.