author | RedGrinner@gmail.com |
Tue, 02 Dec 2014 03:34:56 +0000 | |
changeset 398 | 1f9f7fb00be3 |
parent 330 | 74f23d3af091 |
child 543 | 0b430064fc8d |
permissions | -rw-r--r-- |
214 | 1 |
#labels Phase-Implementation |
330 | 2 |
==Automatic== |
3 |
||
4 |
Configure with `cmake -DNOPASCAL=1` and then run `make`. |
|
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}` |