pas2CTutorial.wiki
author Wuzzy
Tue, 30 Oct 2018 23:05:40 +0000
changeset 1617 cbb4264a2d3a
parent 543 0b430064fc8d
child 2012 f0d921e412b0
permissions -rw-r--r--
Taunts: clarify sndTraitor
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
214
2c30f10b37a9 how to run pas2C
vittorio.giovara@gmail.com
parents:
diff changeset
     1
#labels Phase-Implementation
330
74f23d3af091 Updated with all the new stuff
vittorio.giovara@gmail.com
parents: 245
diff changeset
     2
==Automatic==
74f23d3af091 Updated with all the new stuff
vittorio.giovara@gmail.com
parents: 245
diff changeset
     3
543
0b430064fc8d Update variable name.
vittorio.giovara@gmail.com
parents: 330
diff changeset
     4
Configure with `cmake -DBUILD_ENGINE_C=1` and then run `make`.
330
74f23d3af091 Updated with all the new stuff
vittorio.giovara@gmail.com
parents: 245
diff changeset
     5
74f23d3af091 Updated with all the new stuff
vittorio.giovara@gmail.com
parents: 245
diff changeset
     6
==Manual run==
74f23d3af091 Updated with all the new stuff
vittorio.giovara@gmail.com
parents: 245
diff changeset
     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
74f23d3af091 Updated with all the new stuff
vittorio.giovara@gmail.com
parents: 245
diff changeset
    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
2c30f10b37a9 how to run pas2C
vittorio.giovara@gmail.com
parents:
diff changeset
    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
74f23d3af091 Updated with all the new stuff
vittorio.giovara@gmail.com
parents: 245
diff changeset
    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...)
74f23d3af091 Updated with all the new stuff
vittorio.giovara@gmail.com
parents: 245
diff changeset
    18
74f23d3af091 Updated with all the new stuff
vittorio.giovara@gmail.com
parents: 245
diff changeset
    19
==Development==
74f23d3af091 Updated with all the new stuff
vittorio.giovara@gmail.com
parents: 245
diff changeset
    20
There are some special file that you need to know
74f23d3af091 Updated with all the new stuff
vittorio.giovara@gmail.com
parents: 245
diff changeset
    21
74f23d3af091 Updated with all the new stuff
vittorio.giovara@gmail.com
parents: 245
diff changeset
    22
  * project_files/hwc/rtl/fpcrtl.h - contains definitions of external functions defined inside custom pascal units (eg SDLh.pas);
74f23d3af091 Updated with all the new stuff
vittorio.giovara@gmail.com
parents: 245
diff changeset
    23
  * hedgewars/pas2cSystem.pas - contains definitions of external functions defined outside our own pascal units (eg png and gl units, bundled with freepascal);
74f23d3af091 Updated with all the new stuff
vittorio.giovara@gmail.com
parents: 245
diff changeset
    24
  * hedgewars/pas2cRedo.pas - contains definitions of internal fpc units (provided by the 'rtl') which get a fpcrtl_ prefix.
74f23d3af091 Updated with all the new stuff
vittorio.giovara@gmail.com
parents: 245
diff changeset
    25
74f23d3af091 Updated with all the new stuff
vittorio.giovara@gmail.com
parents: 245
diff changeset
    26
If you need to hide portions of code from pas2c just wrap it with `${IFNDEF PAS2C}...{$ENDIF}`