diff --git a/README.md b/README.md index 719c984..ec0ba11 100644 --- a/README.md +++ b/README.md @@ -39,9 +39,10 @@ results in a binary size of 118220 bytes. Huge. The same thing compiled with lib ``` m68k-atari-mint-gcc -nostdlib $LIBCMINI/crt0.o hello.c -o hello.tos -s -L$LIBCMINI -lcmini -lgcc ``` -(note that - since we compile with -nostdlib - you have to add the gcc runtime support library libgcc.a to your command line for the processors that need it) +(note that - since we compile with -nostdlib - you have to add the gcc runtime support library libgcc.a to your command line for the processors that need it. +Sometimes you will have to specify ` -lgcc -lcmini -lgcc` to avoid 'undefined reference' error messages.) -creates a binary with 11794 byts. About a tenth of the size. +creates a binary with 11794 bytes. About a tenth of the size. Remember that gcc does not automatically look up multi-lib versions of libraries in directories specified by -L. If you want to do the same as @@ -81,6 +82,64 @@ avoid library calls for most integer operations. With -mfastcall libcmini itself is 3% smaller binary, and the tests/bench test executes 20% faster. +## Compilation + +The library can be compiled in standard ('a.out') or `elf' format. In the first case the m68k-atari-mint toolchain is used; in the latter case the m68k-atari-mintelf toolchain. Make sure the proper toolchain is in your PATH before compiling. + +The basic command for compilation is `make`. But various compilation options can be given. +Instead of 'Y', also 'yes' can be used: + + * `VERBOSE=Y` - Print all commands that are used to compile the library. This option can also be given as an environment variable. All other options must be given as arguments to the `make` command. + * `COMPILE_ELF=Y` - Compile for 'elf' format instead of 'a.out'. + * `ONLY_68K=Y` - Compile only for the 68000, not the other architectures. + * `COMPILE_ELF=Y` - Compile for the 'elf' format instead of 'a.out'. + * `STDIO_WITH_LONG_LONG=Y` - Add code for `long long` to the `printf` family of functions. At the moment this fails. + * `STDIO_MAP_NEWLINE=Y` - Add code to convert NL to CR NL on output to text files, and CR NL to NL on input. This was standard practice on TOS but not on Mint. + +The following options are on by default. They can be switched off with `OPTION=no` or `OPTION=N`. +However, when `ONLY_68K=Y` is given, they are switched off and cannot be switched on again. + + * `BUILD_CF=N` - Don't compile for the Coldfire (m5475) architecture. + * `BUILD_SOFT_FLOAT=N` - Not sure what this means. Probably don't build for software floating point. + * `BUILD_SHORT=N` - Don't include libraries for short ints (16 bit?) + * `BUILD_FAST=N` - Don't use `-mfastcall` function calls. The default for this option is whether the compiler supports `-mfastcall`. + +Example `make` command: + +``` +VERBOSE=yes make ONLY_68K=yes STDIO_MAP_NEWLINE=Y +``` + +## Installation + +The basic installation command is `make install`. The default install +location is `/usr`, i.e. `/usr/include` and `/usr/lib`. `make install` +should basically get the same options as used for the compilation if +some architectures were omitted, otherwise it will regenerate the +missing ones. + +The installation destination can be specified with either the `PREFIX*` options or the `DESTDIR` option: + * `PREFIX=