You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|```module.sym```| Oberon symbols required to ```IMPORT``` this module in another compilation.|
12
+
|```module.c```| C source code for compilation by gcc, clang or msc. |
13
+
|```module.h```| C header files required by C compiler when importing this module. |
14
+
15
+
Note that the filename of the .sym, .c and .h files is the name of the module from the ```MODULE``` statement at the start of the source file. It is not the name of the .mod file.
16
+
17
+
If the compilation is successful, the Oberon compiler will automatically invoke the C compiler. The compiler option ```-V``` will cause the compiler to display the C compiler command used.
18
+
19
+
### Successful compilation report
20
+
21
+
For a successful compilation, the compiler displays a single line comprising
22
+
23
+
* The name of the file being compiled
24
+
* The name of the module from the ```MODULE``` statment
25
+
* Compiler configuration (only if the ```-V``` verbose option is selected)
26
+
* A possible symbol update status message
27
+
* The number of characters compiled
28
+
29
+
If a symbols file already exists, the compiler will check whether the new compilation changes the symbols, and if so whether the change is just an extension, or a more serious compatability threatening modification. If there is a change the compiler displays either ```Extended symbol file``` or ```New symbol file```.
30
+
31
+
For example:
32
+
33
+
```
34
+
$ voc test.mod
35
+
test.mod Compiling test. New symbol file. 364 chars.
36
+
```
37
+
38
+
### Symbol file changes
39
+
40
+
By default the compiler will refuse to compile a module if its symbols are different from those in the .sym file present from a previous compilation. To allow the compiler to change the symbols, one of the following options must be used.
41
+
42
+
| Compiler option | Use |
43
+
| :-------------: | --------------------------- |
44
+
|```-e```| Allow extension of symbols. Do not allow changes to existing symbols. |
45
+
|```-s```| Allow changes to and extensions of symbols. |
46
+
|```-F```| Force generation of new symbol file.*|
47
+
48
+
\* A new symbol file may be forced to guarantee that a symbol file is generated for a module that has the same name as an installed library module.
49
+
50
+
### Main module
51
+
52
+
The main module should be the last module compiled as it imports all other modules.
53
+
54
+
The program logic should be started from the main module's initialisation code.
55
+
56
+
The following options designate the main module:
57
+
58
+
| Compiler option | Use |
59
+
| :-------------: | --------------------------- |
60
+
|```-m```| Generate loadable binary using dynamic library loading (on systems that support it). |
61
+
|```-M```| Generate loadable binary with all library references statically linked. |
62
+
63
+
For a main module, no .sym or .h files are generated, and the C compiler is called with additional parameters to generate the execututable binary, linking the object files needed for imported modules.
64
+
65
+
### Separate compilation
66
+
67
+
Each module may be compiled by a separate command line, although the imports of a module must be compiled before the module is compiled. All three generated files (.sym, .c and .h) must be retained at least until all modules dependent on this module have been compiled.
68
+
69
+
Multiple modules may be compiled on a single compiler command line.
70
+
71
+
Options on the command line that preceed all module file names will be used as global settings: each module will be compiled with these settings except as overriden on a per file basis.
72
+
73
+
Options on the command line that follow a module file name are specific to that module.
74
+
75
+
For example:
76
+
77
+
```
78
+
voc -s alpha.mod beta.mod main.mod -m
79
+
```
80
+
81
+
Will apply the ```-s``` option to all modules (allow changes to and extension of symbols), and will apply the ```-m``` option (main program) only to ```main.mod```.
0 commit comments