阿姆斯特丹编译器工具包
Amsterdam Compiler Kit

原始链接: https://github.com/davidgiven/ack

## 阿姆斯特丹编译器工具包 (ACK) 概要 阿姆斯特丹编译器工具包 (ACK) 是一套全面的编译器工具链,最初于 1987-2005 年开发,能够将源代码翻译成可在广泛平台上执行的文件。它支持多种语言,包括 ANSI C、Pascal、Modula 2 和 Basic。 ACK 目前支持 Linux(各种架构)、MS-DOS、OSX、CPM,甚至树莓派等平台。安装需要一个 ANSI C 编译器(如 GCC)、flex、yacc、GNU make、带有 lua-posix 的 Lua,以及 Python 3.4+。构建通过 `make` 完成,安装通过 `sudo make install` 完成。 主要的编译命令是 `ack`,带有选项来指定目标平台 (`-m`)、输出文件 (`-o`) 和优化级别 (`-O`)。ACK 根据文件扩展名确定源代码语言。 虽然 ACK 已经成熟且经过充分测试,但它可能会遇到与现代系统兼容性问题。鼓励用户加入邮件列表 ([http://tack.sourceforge.net/](http://tack.sourceforge.net/)) 以报告成功案例、失败案例并贡献错误修复。它采用 BSD 类似的许可协议。

阿姆斯特丹编译器工具包(ACK),最初名为自由大学编译器工具包,是一个针对较旧平台使用C89、Pascal、Modula 2和Basic等语言的工具链。它包括前端、代码生成器、支持库和工具——并且历史上曾是Minix 1 & 2的默认工具链。 然而,该项目似乎已基本停止活跃开发,最后一次提交可追溯到2022年。它不是一个自包含的系统;ACK严重依赖现有的工具,如GCC、Lua、Make和Python,使其主要用于交叉编译。鉴于缺乏近期更新,用户正在质疑其当前功能的完整性。“阿姆斯特丹”这个名称源于它与阿姆斯特丹自由大学的关联。
相关文章

原文
                      THE AMSTERDAM COMPILER KIT V6.2+
                      ================================

                  © 1987-2005 Vrije Universiteit, Amsterdam
                                2025-04-17


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.



SUPPORT
=======

Languages:

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

Platforms:

cpm           produces i80 CP/M .COM files
em22          produces EM22 bytecode files
linux386      produces ELF executables for PC Linux systems
linux68k      produces ELF executables for m68020 Linux systems
linuxmips     produces ELF executables for little-endian MIPS32r2 Linux systems
linuxppc      produces ELF executables for PowerPC Linux systems
minix68k      produces Minix executables for m68000 Minix systems
msdos386      produces i386 MS-DOS 32-bit DPMI .EXE files
msdos86       produces i86 MS-DOS .COM files
osx386        produces i386 OSX MachO executables
osxppc        produces PowerPC OSX MachO executables
pc86          produces bootable floppy disk images for 8086 PCs
pdpv7         produces PDP/11 V7 Unix binaries
rpi           produces Raspberry Pi GPU binaries



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

The version 5.0 build mechanism has been completely rewritten (twice).
Installation ought to be fairly straightforward. It will build on Unixishes
including Linux, OSX, and Windows using MSYS2 and mingw32.

Requirements:

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

- flex and yacc.

- GNU make.

- Lua (any version) with the lua-posix library installed.

- Python 3.4 or above.

- about 1GB 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, and PLATS, which changes which
  architectures are built. Look in `plat/*` to see what plats there are.

- Run:

    make

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

  The make system is fully parallelisable by default, but does take a while
  to start up.

- 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.

- 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)
[email protected]
2025-04-17
联系我们 contact @ memedata.com