README 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. THE AMSTERDAM COMPILER KIT V6.0pre4
  2. ===================================
  3. © 1987-2005 Vrije Universiteit, Amsterdam 2010-08-08
  4. © 2013-2014 Manoel Trapier, Paris
  5. INTRODUCTION
  6. ============
  7. The Amsterdam Compiler Kit is a complete compiler toolchain consisting of
  8. front end compilers for a number of different languages, code generators,
  9. support libraries, and all the tools necessary to go from source code to
  10. executable on any of the platforms it supports.
  11. This is an early prerelease of the apocryphal version 6.0 release. Not a
  12. lot is supported, the build mechanism needs work, and a lot of things are
  13. probably broken. However, what's there should be sufficient to get things
  14. done and to evaluate how the full 6.0 release should work.
  15. This is a fork from the original repository found on sourceforge. This
  16. fork exist for three reason, the first is I strongly prefere git than
  17. mercurial (this is a personal preference) and second I want to make it
  18. work on Mac OS X but the OSX clang/gcc does not really like the K&R
  19. syntax, so I take into the process of ANSIfy it. The third reason is why
  20. I want to use the ACK, it support old CPU, like the 6502 or i8080, i8086
  21. and it is open source unlike a lot of compiler we can found nowadays for
  22. such targets, and it support more than C that is a wonderfull bonus!
  23. I have plan to add targets like the NES, add support for the 65c816 and
  24. add the SNES target, add the WonderSwan as a target and so on. I see in
  25. this compiler kit a wonderfull project for all sort of old computer that
  26. are still used nowadays and used CPU that are no longuer targeted by
  27. modern compilers.
  28. I plan to push my changes on the original version, at least for the new
  29. targets and cpu.
  30. SUPPORT
  31. =======
  32. Languages:
  33. ANSI C, Pascal, Modula 2. K&R is supported via the ANSI C compiler.
  34. Platforms:
  35. pc86 produces bootable floppy disk images for 8086 PCs
  36. linux386 produces ELF executables for PC Linux systems
  37. cpm produces i80 CP/M .COM files
  38. INSTALLATION
  39. ============
  40. The version 6.0 build mechanism has been completely rewritten and is based
  41. around the Prime Mover build tool (see http://primemover.sf.net for more
  42. information). Installation ought to be fairly straightforward.
  43. Requirements:
  44. - an ANSI C compiler. Currently, I'm afraid, it's hard-coded to use gcc.
  45. To change, try changing the variable definitions in first/c.pm. This also
  46. needs to be available as 'cc' from the shell.
  47. - about 20MB free in /tmp (or some other temporary directory).
  48. - about 6MB in the target directory.
  49. Instructions:
  50. - edit config.pm. There's a small section at the top containing some editable
  51. variables. Probably the only one you may want to edit is PREFIX, which
  52. changes where the ACK installs to.
  53. - Run:
  54. ./pm configure
  55. ...from the command line. This will write out a configuration file.
  56. - Run:
  57. ./pm
  58. ...from the command line. This will actually do the build. This takes
  59. about two minutes on my 1.6GHz Athlon Linux machine and about 30 on my
  60. 166MHz Pentium OpenBSD machine.
  61. - Run:
  62. ./pm install
  63. ...from the command line (possibly with sudo). This will install the built
  64. ACK into whatever directory you nominated in PREFIX.
  65. The ACK should now be ready to use.
  66. USAGE
  67. =====
  68. Currently I haven't sorted out all the documentation --- it's supplied in the
  69. distribution, but not all of it gets installed yet --- so here is a quickstart
  70. guide.
  71. The main command to use is 'ack'. This invokes the compiler and the linker.
  72. Some useful options include:
  73. -m<platform> build for the specified platform
  74. -o <file> specifies the output file
  75. -c produce a .o file
  76. -c.s produce a .s assembly file
  77. -O enable optimisation
  78. -ansi compile ANSI C (when using the C compiler)
  79. <file> build file
  80. ack figures out which language to use from the file extension:
  81. .c C (ANSI or K&R)
  82. .b Basic
  83. .mod Modula-2
  84. .ocm Occam 1
  85. .p Pascal
  86. .o object files
  87. .s assembly files
  88. For further information, see the man page (which actually does get
  89. installed, but is rather out of date).
  90. There are some (known working) example programs in the 'examples' directory.
  91. A sample command line is:
  92. ack -mlinux386 -O examples/paranoia.c
  93. GOTCHAS
  94. =======
  95. There are some things you should be aware of.
  96. - Look at plat/<PLATFORMNAME>/README for information about the two supported
  97. platforms.
  98. - The library support is fairly limited; for C, it's at roughly the ANSI C
  99. level, and for the other languages it's similar.
  100. - When compiling languages other than C, the ACK will usually look at the
  101. first character of the file. If it's a #, then the file will be run through
  102. the C preprocessor anyway.
  103. - BSD systems may need to up the number of file descriptors (e.g.
  104. 'ulimit -n 200') before the ACK will compile.
  105. - The ACK uses its own .o format. You won't be able to mix the ACK's object
  106. files and another compiler's.
  107. DISCLAIMER
  108. ==========
  109. The ACK is mature, well-tested software, but the environment in which it was
  110. developed for and tested under is rather different from that available on
  111. today's machines. There will probably be little in the way of logical bugs,
  112. but there may be many compilation and API bugs.
  113. If you wish to use the ACK, *please* join the mailing list. We are interested
  114. in any reports of success and particularly, failure. If it does fail for you,
  115. we would love to know why, in as much detail as possible. Bug fixes are even
  116. more welcome.
  117. The ACK is licensed under a BSD-like license. Please see the 'Copyright' file
  118. for the full text.
  119. You will find this "ANSI Fork" on github:
  120. http://github.com/Godzil/ack
  121. You can find the ACK mailing list and the original project's web site:
  122. http://tack.sourceforge.net/
  123. Please enjoy.
  124. Manoel Trapier (aka godzil) for the ANSI-fication port
  125. David Given (dtrg on Sourceforge)
  126. dg@cowlark.com
  127. 2010-08-08