Algol-68RS Build Notes for Linux and macOS
------------------------------------------

Linux
-----
Installation dependencies as documented in original 1.15 i386.deb Linux package and packages that provide them: 

fakeroot: fakeroot
make: make
ld, ar, ranlib: binutils
gcc: gcc
makeinfo, texindex: texinfo
tex, texindex: texlive texlive-extra-utils
latex: texlive-latex-base texlive-latex-extra
install-info: install-info
dpkg-buildpackage: dpkg-dev debhelper
libc6-dev: linux-libc-dev
info: info
ldconfig, cp, mv, rm, find, sh, tar: <installed by default>

Install these original dependencies:

$ sudo apt install fakeroot make binutils gcc texinfo texlive texlive-extra-utils texlive-latex-base texlive-latex-extra install-info dpkg-dev debhelper linux-libc-dev info
-----

macOS
-----
The GitHub files contain already-processed documentation files, so it is not necessary to install the TeX packages.
The build requires a C compiler. It has been tested with Xcode 12 (clang 12.0.5) with command-line tools installed.
It should also work with homebrew installed gcc and libc6-dev
-----


To build, run

$ export A68_NAMESEED=nameseed
$ make dist-clean
$ make

This will make a first-stage algol68toc from already-translated .c files.
To build a self-hosted compiler, use the first-stage compiler to translate the .a68 source files to new .c files

$ make Translate

Build a second-stage compiler from the .c files made from the first-stage compiler
$ make dist-clean
$ make

The resulting algol68toc is a compiler built with sources it made for itself.
For absolute assurance of self-hosting, you can translate and re-build again and verify output files are identical.

To read generated documentation a dvi reader is needed, such as xdvi, installed with texlive

Install the resulting complier, examples, documentation, utilities and libraries.

$ sudo make install

This install the following(*):

/usr/share/algol68toc/Afirst.o
                      a68config.m
		      standard.m
		      Algol68.mk
/usr/share/doc/algol68toc/rscompiler.dvi.gz
                          ctrans.dvi.gz
			  compl.taylour
			  star.txt
			  pame/*
			  lf.a68
			  test.lf
			  algol68.ssh
			  sheets.entry
			  examples/*
/usr/share/info/ctrans.info.gz
/usr/share/man/man1/a68toc.1.gz
                    ca.1.gz
		    resetseed.1.gz
/usr/share/applications/a68toc.desktop
/usr/include/algol68/*
/usr/lib/liba68.a
         liba68s.a
         liba68gc.a
/usr/bin/a68toc
         resetseed
	 ca

(*) on macOS /usr/local/ is used in place of /usr

Compile a test program with

$ cd examples
$ ca Abundant_odd_numbers.a68
$ ./Abundant_odd_numbers

Building a Debian package on Linux

compatability needs to be set to minimum of 10 in debian/compat
architecture needs to be set to amd64 in debian/control

$ dpkg-buildpackage -F


NOTE
----
Glyn Webster has kindly contributed:
 - An excellent example program that enumerates truth tables for boolean logic expression (examples/logic)
 - An example of building Algol68-RS libraries and using separate compilation (examples/tests), which includes
 - A usable approximation to C's sprintf in Algol-68


