The Amsterdam Compiler Kit
Go to file
2022-06-24 17:00:57 +00:00
.github/workflows Attempt to make work on OSX, and update the build matrix. 2022-06-20 00:18:16 +02:00
bin Distributions are a pain --- let's not bother any more. Instead, we just tag 2016-09-02 23:00:38 +02:00
doc doc/em/app.codes.nr: fix "139: no real data" error under GNU tbl 2021-05-04 16:21:33 +00:00
emtest Distributions are a pain --- let's not bother any more. Instead, we just tag 2016-09-02 23:00:38 +02:00
etc After finding the em_table documentation, move it somewhere where other people 2018-06-13 20:58:44 +09:00
examples Make the Pascal example look the same as the other hilo examples. 2020-02-05 23:05:10 +01:00
fast bugfixes to make pascal compiler work. 2019-06-16 01:00:26 +08:00
fcc Distributions are a pain --- let's not bother any more. Instead, we just tag 2016-09-02 23:00:38 +02:00
first Fix a tiny ackbuilder bug where you can't set properties to false. 2019-06-10 16:12:36 +02:00
h Eliminate the TMP_DIR compile-time constant in favour of using $TMPDIR and 2022-05-29 00:44:28 +02:00
include/_tail_mon Distributions are a pain --- let's not bother any more. Instead, we just tag 2016-09-02 23:00:38 +02:00
lang libcc.ansi: add support for O_TEXT, O_BINARY file status flags 2021-03-27 19:12:35 +00:00
lib Disable the built-in preprocessor in cemcom.ansi; the external preprocessor is 2018-09-02 12:39:00 +02:00
mach Attempt to make work on OSX, and update the build matrix. 2022-06-20 00:18:16 +02:00
man Add .seek pseudo-op and fix .base pseudo-op in uni_ass(6) manual 2021-03-20 17:03:12 +00:00
modules Cut down some clang warnings 2019-10-30 18:36:38 -04:00
plat plat/msdos86: make getpid() use European MS-DOS's getpid syscall 2022-06-24 17:00:57 +00:00
tests/plat Add test case for #203 2019-11-15 15:33:15 -05:00
util Attempt to make work on OSX, and update the build matrix. 2022-06-20 00:18:16 +02:00
.appveyor.yml Don't run the tests in Appveyor. 2019-02-09 13:59:37 +01:00
.clang-format Warning-fixed and ansified the Modula-2 library. 2018-06-25 22:22:37 +02:00
.distr Updated distr files. 2013-06-21 23:38:21 +01:00
.drone.yml Disable the msys32 build because it doesn't work (due to brk issues). 2018-09-01 11:43:52 +02:00
.hgignore Ignore .vscode directory. 2019-06-11 21:33:23 +02:00
.travis.yml We don't need depth 10 in the travis checkout. 2019-02-10 12:35:18 +01:00
Action Modified to no longer build LLgen, as it is now distributed seperately. 2006-07-18 17:34:30 +00:00
build.lua Adding MS-DOS .com program support (msdos86). Still incomplete. 2021-03-27 13:15:56 +00:00
CHANGES Updated. 2016-09-03 19:07:12 +02:00
Copyright new copyright notice in repository 2005-05-26 06:47:43 +00:00
Makefile Allow override of configuration variables without editing Makefile. 2022-01-26 23:00:04 -06:00
NEW Added some new readmes at the top level. 2005-06-24 23:20:41 +00:00
README README: mention msdos86 target platform 2021-04-01 14:42:02 +00:00
TODO Added some new readmes at the top level. 2005-06-24 23:20:41 +00:00

                     THE AMSTERDAM COMPILER KIT V6.1pre1
                     ===================================

                  © 1987-2005 Vrije Universiteit, Amsterdam
                                2018-02-23


INTRODUCTION
============

The Amsterdam Compiler Kit is a complete compiler toolchain consisting of
front end compilers for a number of different languages, code generators,
support libraries, and all the tools necessary to go from source code to
executable on any of the platforms it supports.

This is an early prerelease of the apocryphal version 6.1 release. Not a
lot is supported, the build mechanism needs work, and a lot of things are
probably broken. However, what's there should be sufficient to get things
done and to evaluate how the full 6.1 release should work. 



SUPPORT
=======

Languages:

ANSI C, B, Pascal, Modula 2, Basic. K&R is supported via the ANSI C compiler.

Platforms:

pc86          produces bootable floppy disk images for 8086 PCs
linux386      produces ELF executables for PC Linux systems
linux68k      produces ELF executables for m68020 Linux systems
linuxppc      produces ELF executables for PowerPC Linux systems
linuxmips     produces ELF executables for little-endian MIPS32r2 Linux systems
cpm           produces i80 CP/M .COM files
rpi           produces Raspberry Pi GPU binaries
pdpv7         produces PDP/11 V7 Unix binaries
msdos86       produces i86 MS-DOS .COM files



INSTALLATION
============

The version 5.0 build mechanism has been completely rewritten. Installation
ought to be fairly straightforward.

Requirements:

- an ANSI C compiler. This defaults to gcc. You can change this by setting
  the CC make variable.

- flex and yacc.

- GNU make.

- (optionally) ninja; if you've got this, this will be autodetected and give
  you faster builds.

- (optionally) the qemu suite: if you have this installed, the build system
  will detect it automatically and run the test suites for the supported
  architectures. Get both the qemu-system-* platform emulators and the qemu-*
  userland emulators (only works on Linux).

- about 115MB free in /tmp (or some other temporary directory).

- about 15MB in the target directory.

Instructions:

- edit the Makefile. There's a small section at the top where you can change
  the configuration. Probably the only one you may want to edit is PREFIX,
  which changes where the ACK installs to.

- Run:

    make

  ...from the command line. This will do the build.

  The make system is fully parallelisable. If you have a multicore system,
  install ninja and it'll use all your cores. If you don't have ninja, you
  can still use make for parallel builds with:

    make -r -j8   # or however many cores you have

  ...but frankly, I recommend ninja.

- Run:

    sudo make install

  ...from the command line. This will install the ACK in your PREFIX
  directory (by default, /usr/local).

The ACK should now be ready to use.



USAGE
=====

Currently I haven't sorted out all the documentation --- it's supplied in the
distribution, but not all of it gets installed yet --- so here is a quickstart
guide.

The main command to use is 'ack'. This invokes the compiler and the linker.
Some useful options include:

  -m<platform>     build for the specified platform
  -o <file>        specifies the output file
  -c               produce a .o file
  -c.s             produce a .s assembly file
  -O               enable optimisation (optimisation levels go up to 6)
  -ansi            compile ANSI C (when using the C compiler)
  -v               be more verbose (repeatable)
  <file>           build file

ack figures out which language to use from the file extension:

  .c               C (ANSI or K&R)
  .b               the PDP-11 dialect of B
  .bas             Basic
  .mod             Modula-2
  .ocm             Occam 1
  .p               Pascal
  .o               object files
  .s               assembly files
  .e               ACK intermediate code assembly files

For further information, see the man page (which actually does get
installed, but is rather out of date).

There are some (known working) example programs in the 'examples' directory.
A sample command line is:

ack -mlinux386 -O examples/paranoia.c



GOTCHAS
=======

There are some things you should be aware of.

- Look at plat/<PLATFORMNAME>/README for information about the supported
  platforms.
  
- The library support is fairly limited; for C, it's at roughly the ANSI C
  level, and for the other languages it's similar.
  
- When compiling languages other than C, the ACK will usually look at the
  first character of the file. If it's a #, then the file will be run through
  the C preprocessor anyway.

- BSD systems may need to up the number of file descriptors (e.g.
  'ulimit -n 200') before the ACK will compile.
  
- The ACK uses its own .o format. You won't be able to mix the ACK's object
  files and another compiler's.

- When compiling together multiple B source files, you need to do some extra
  work to initialise them properly otherwise your program will crash on
  startup; see the ack(1) and abmodules(1) man pages.

- The distribution contains *everything*, including the weird, ancient,
  archaic stuff that doesn't work any more and never will, such as the int EM
  interpreter and the assembler-linkers. Only some of it builds. Look for
  build.lua files.



DISCLAIMER
==========

The ACK is mature, well-tested software, but the environment in which it was
developed for and tested under is rather different from that available on
today's machines. There will probably be little in the way of logical bugs,
but there may be many compilation and API bugs.

If you wish to use the ACK, *please* join the mailing list. We are interested
in any reports of success and particularly, failure. If it does fail for you,
we would love to know why, in as much detail as possible. Bug fixes are even
more welcome.

The ACK is licensed under a BSD-like license. Please see the 'Copyright' file
for the full text.

You can find the mailing list on the project's web site:

	http://tack.sourceforge.net/
	
Please enjoy.

David Given (davidgiven on Github)
dg@cowlark.com
2018-09-18