Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Barthelmann V.VBCC compiler system.2004.pdf
Скачиваний:
13
Добавлен:
23.08.2013
Размер:
390.02 Кб
Скачать

4

vbcc manual

assign >NIL: vbccwos: vbcc:targets/ppc-warpos assign >NIL: vincludewos: vbccwos:include assign >NIL: vlibwos: vbccwos:lib

assign >NIL: vincludewos: <path to your AmigaOS header files> ADD

assign >NIL: vbccmos: vbcc:targets/ppc-morphos assign >NIL: vincludemos: vbccmos:include assign >NIL: vlibmos: vbccmos:lib

assign >NIL: vincludemos: <path to your MorphOS header files> ADD

Also, the stack-size has to be increased from the default. 40KB is a sensible value, for very large projects higher values might be necessary.

There is a sample script file ‘init_vbcc’. Changing to the vbcc-directory and executing this script will set up a basic vbcc system. However, it is recommended to adapt the script and put it into your ‘s:user-startup’.

There are di erent configuration files provided in the ‘config’-subdirectory to choose different targets (i.e. the system you want to generate programs for) and hosts (i.e. the system you want the compiler an tools to run on). The general naming-scheme for these files ist

<target> <host>.

The systems available as targets are ‘m68k’ (AmigaOS on 68k with standard libraries), ‘ixemul’ (AmigaOS on 68k using ixemul library), ‘ppc’ (PPC boards using the PowerUp system), ‘warpos’ (PPC boards using the WarpOS system) and ‘morphos’ (PPC systems running MorphOS).

‘m68k’, ‘ppc’ and ‘warpos’ are available as host specifiers on AmigaOS.

You can choose one of these systems using the ‘+’-option of vc, e.g.

vc +m68k_ppc ...

will compile for AmigaOS/68k using the compiler running on PowerUp.

You may choose to create copies of some of these configuration files with simpler names. E.g. if you usually want the compiler to run on WarpOS you could copy ‘m68k_warpos’ to ‘m68k’, ‘warpos_warpos’ to ‘warpos’ and so on. Then you can just specify the target and your preferred host system will be chosen automatically.

Additionally, you may copy the configuration file for your preferred host/target-combination to ‘vc.config’. This configuration will be chosen by default if you do not specify anything. By default, the target-only-specifications use 68k-native tools, e.g. ‘+warpos’ will create code for WarpOS, but the compiler and tools will run on the 68k. The default ‘vc.config’ will create code for 68k using tools running on 68k.

1.4 Tutorial

Now you should be able to use vbcc. To compile and link the program ‘hello.c’, type vc hello.c

The file ‘hello.c’ will be compiled and linked to create the executable a.out in the current directory.

Chapter 1: General

5

vc hello.c -o hello

will do the same, but the created executable will be called ‘hello’.

vc -c t1.c t2.c

will compile ‘t1.c’ and ‘t2.c’ without linking, creating the object files ‘t1.o’ and ‘t2.o’.

vc t1.o t2.o -o tt

will link them together and create the executable ‘tt’.

If your program uses floating point, you may have to link with a math-library. The details are dependent on the target, but usually ‘-lm’ will be suitable (for AmigaOS on m68k choose one of ‘-lmieee’, ‘-lm881’ or ‘-lm040’).

vc calc.c -o calc -lmieee

There may also be an extra.lib which includes a few functions that are no standard C functions but some people seem to regard them as standard functions. If you use one of these add ‘-lextra’ to the commandline.

6

vbcc manual