ANSIfied Amsterdam Compiler Kit

George Koehler c602379db9 Some fixes for aelflod and aslod. 11 年之前
bin 0131ca4d46 Delete 689 undead files. 11 年之前
distr 0131ca4d46 Delete 689 undead files. 11 年之前
doc 0131ca4d46 Delete 689 undead files. 11 年之前
emtest 0131ca4d46 Delete 689 undead files. 11 年之前
etc 0131ca4d46 Delete 689 undead files. 11 年之前
examples 293f34fa9b Flush stdout before prompting the user for input. 13 年之前
fast c3855160fb use stdarg when compiling with ANSI C compiler 29 年之前
fcc b9a67e72ca use stdarg when compiling with ANSI C compiler 29 年之前
first 36a59de862 Change from yacc to byacc (yacc build code that generate warnings...) 9 年之前
h 06665f4624 Change sbrk definitions. 9 年之前
include 0131ca4d46 Delete 689 undead files. 11 年之前
lang 0f10f91839 Surprisly clang started to tell me where variable may used uninitialized, correcting it! 9 年之前
lib 0131ca4d46 Delete 689 undead files. 11 年之前
mach 0ba3023570 Add a missing header include. 9 年之前
man 0131ca4d46 Delete 689 undead files. 11 年之前
modules 9da790283e Remove/change bad prototypes 9 年之前
plat cc534493fd Copy pc86 platform to nes platform, and make change accordingly. 9 年之前
util c602379db9 Some fixes for aelflod and aslod. 9 年之前
.distr 54ce3f451b Configured distr system for the 6.0pre3 release. 17 年之前
.gitignore 2a5ab5b856 Update .gitignore 9 年之前
.hgtags eb0b730607 convert CVS tags 13 年之前
Action 57084134e5 Modified to no longer build LLgen, as it is now distributed seperately. 18 年之前
CHANGES 5147166810 Updated for 6.0pre4. 13 年之前
Copyright d3715f3ca4 Add missing Copyright file 9 年之前
LICENSE 659f26136a exchange LICENSE and Copyright file 9 年之前
NEW e8b47b4745 Added some new readmes at the top level. 19 年之前
README c5bfc89269 Update README. 9 年之前
README.md d78a72a6e2 Add markdown and license file 9 年之前
TODO e8b47b4745 Added some new readmes at the top level. 19 年之前
TakeAction d722986e66 Added the appropriate #! magic at the beginning of shell scripts. (Some modern shells don't like scripts to be without it.) 18 年之前
config.pm e537bcc321 Fixed typo. 13 年之前
makeheader.sh 46f101f4dd Update makeheader.sh 9 年之前
pm 8da0d38b6d Applied a patch to support OpenBSD. 17 年之前
pmfile 5f00cd2e53 Make a brk/sbrk emulation. 9 年之前

README

THE AMSTERDAM COMPILER KIT V6.0pre4
===================================

© 1987-2005 Vrije Universiteit, Amsterdam 2010-08-08
© 2013 Manoel Trapier, Paris

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.0 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.0 release should work.

This is a fork from the original repository found on sourceforge. This
fork exist for three reason, the first is I strongly prefere git than
mercurial (this is a personal preference) and second I want to make it
work on Mac OS X but the OSX clang/gcc does not really like the K&R
syntax, so I take into the process of ANSIfy it. The third reason is why
I want to use the ACK, it support old CPU, like the 6502 or i8080, i8086
and it is open source unlike a lot of compiler we can found nowadays for
such targets, and it support more than C that is a wonderfull bonus!

I have plan to add targets like the NES, add support for the 65c816 and
add the SNES target, add the WonderSwan as a target and so on. I see in
this compiler kit a wonderfull project for all sort of old computer that
are still used nowadays and used CPU that are no longuer targeted by
modern compilers.

I plan to push my changes on the original version, at least for the new
targets and cpu.

SUPPORT
=======

Languages:

ANSI C, Pascal, Modula 2. 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
cpm produces i80 CP/M .COM files


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

The version 6.0 build mechanism has been completely rewritten and is based
around the Prime Mover build tool (see http://primemover.sf.net for more
information). Installation ought to be fairly straightforward.

Requirements:

- an ANSI C compiler. Currently, I'm afraid, it's hard-coded to use gcc.
To change, try changing the variable definitions in first/c.pm. This also
needs to be available as 'cc' from the shell.

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

- about 6MB in the target directory.

Instructions:

- edit config.pm. There's a small section at the top containing some editable
variables. Probably the only one you may want to edit is PREFIX, which
changes where the ACK installs to.

- Run:

./pm configure

...from the command line. This will write out a configuration file.

- Run:

./pm

...from the command line. This will actually do the build. This takes
about two minutes on my 1.6GHz Athlon Linux machine and about 30 on my
166MHz Pentium OpenBSD machine.

- Run:

./pm install

...from the command line (possibly with sudo). This will install the built
ACK into whatever directory you nominated in PREFIX.

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 build for the specified platform
-o specifies the output file
-c produce a .o file
-c.s produce a .s assembly file
-O enable optimisation
-ansi compile ANSI C (when using the C compiler)
build file

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

.c C (ANSI or K&R)
.b Basic
.mod Modula-2
.ocm Occam 1
.p Pascal
.o object files
.s 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//README for information about the two 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.


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 will find this "ANSI Fork" on github:

http://github.com/Godzil/ack

You can find the ACK mailing list and the original project's web site:

http://tack.sourceforge.net/

Please enjoy.

David Given (dtrg on Sourceforge)
dg@cowlark.com
2010-08-08