pas2CTutorial.wiki
author almikes@aol.com
Wed, 03 Dec 2014 19:08:24 +0000
changeset 423 0b62abc50ac3
parent 330 74f23d3af091
child 543 0b430064fc8d
permissions -rw-r--r--
Fix some mistakes in tag info: gtCake, gtFlamethrower, gtLandGun
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
74f23d3af091 Updated with all the new stuff
vittorio.giovara@gmail.com
parents: 245
diff changeset
     4
Configure with `cmake -DNOPASCAL=1` and then run `make`.
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}`