author | Wuzzy |
Tue, 14 Aug 2018 08:35:40 +0100 | |
changeset 1505 | 0fabf4dad331 |
parent 543 | 0b430064fc8d |
child 2012 | f0d921e412b0 |
permissions | -rw-r--r-- |
214 | 1 |
#labels Phase-Implementation |
330 | 2 |
==Automatic== |
3 |
||
543 | 4 |
Configure with `cmake -DBUILD_ENGINE_C=1` and then run `make`. |
330 | 5 |
|
6 |
==Manual run== |
|
7 |
||
217
78f6f4e9f358
Edited wiki page pas2CTutorial through web user interface.
vittorio.giovara@gmail.com
parents:
214
diff
changeset
|
8 |
Run from the `tools` folder |
78f6f4e9f358
Edited wiki page pas2CTutorial through web user interface.
vittorio.giovara@gmail.com
parents:
214
diff
changeset
|
9 |
{{{ |
330 | 10 |
ghc -e pas2C \"hwengine\"" pas2c.hs |
217
78f6f4e9f358
Edited wiki page pas2CTutorial through web user interface.
vittorio.giovara@gmail.com
parents:
214
diff
changeset
|
11 |
}}} |
214 | 12 |
|
217
78f6f4e9f358
Edited wiki page pas2CTutorial through web user interface.
vittorio.giovara@gmail.com
parents:
214
diff
changeset
|
13 |
You can replace "hwengine" with any other module. |
78f6f4e9f358
Edited wiki page pas2CTutorial through web user interface.
vittorio.giovara@gmail.com
parents:
214
diff
changeset
|
14 |
|
78f6f4e9f358
Edited wiki page pas2CTutorial through web user interface.
vittorio.giovara@gmail.com
parents:
214
diff
changeset
|
15 |
Every pas file will be converted to a .c/.h version in the `hedgewars` folder. In case no output is produced something has gone wrong. |
78f6f4e9f358
Edited wiki page pas2CTutorial through web user interface.
vittorio.giovara@gmail.com
parents:
214
diff
changeset
|
16 |
|
330 | 17 |
Use `clang` to compile, `gcc` compatibility is not yet achieved. We are curious to hear about `icc` and `msvc` (not that we expect anything...) |
18 |
||
19 |
==Development== |
|
20 |
There are some special file that you need to know |
|
21 |
||
22 |
* project_files/hwc/rtl/fpcrtl.h - contains definitions of external functions defined inside custom pascal units (eg SDLh.pas); |
|
23 |
* hedgewars/pas2cSystem.pas - contains definitions of external functions defined outside our own pascal units (eg png and gl units, bundled with freepascal); |
|
24 |
* hedgewars/pas2cRedo.pas - contains definitions of internal fpc units (provided by the 'rtl') which get a fpcrtl_ prefix. |
|
25 |
||
26 |
If you need to hide portions of code from pas2c just wrap it with `${IFNDEF PAS2C}...{$ENDIF}` |