mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-04-09 20:17:51 +02:00
* Convert to markdown
This commit is contained in:
parent
284c0431c5
commit
abde787799
67
README.md
67
README.md
@ -1,5 +1,4 @@
|
||||
Welcome to pas2js
|
||||
=================
|
||||
## Welcome to pas2js
|
||||
|
||||
Pas2js is an open source Pascal to JavaScript transpiler.
|
||||
It parses Object Pascal and emits JavaScript.
|
||||
@ -7,70 +6,74 @@ It parses Object Pascal and emits JavaScript.
|
||||
Official site:
|
||||
http://wiki.freepascal.org/pas2js
|
||||
|
||||
********************************************************************************
|
||||
|
||||
Directories
|
||||
===========
|
||||
## Directories
|
||||
|
||||
packages - source files needed to compile pas2js programs
|
||||
demo - examples
|
||||
bin - output folder for binaries, e.g. pas2js.exe
|
||||
compiler - source files to compile the compiler
|
||||
compiler - source files to compile the compiler. This is an external submodule link.
|
||||
units - output folder of compiler ppu/o files
|
||||
utils - utilities
|
||||
|
||||
********************************************************************************
|
||||
## Building
|
||||
|
||||
Building
|
||||
========
|
||||
|
||||
1. Install the Free Pascal compiler (fpc), 3.0.4 or better, 32 or 64bit.
|
||||
### Compiler
|
||||
You need to install the Free Pascal compiler (fpc), 3.2.0 or better, 32 or 64bit.
|
||||
Either from their website
|
||||
```text
|
||||
https://www.freepascal.org/download.html
|
||||
```
|
||||
Or via Lazarus
|
||||
```text
|
||||
http://wiki.freepascal.org/Getting_Lazarus
|
||||
Or on MacOS via homebrew
|
||||
Or on Linux via your package manager.
|
||||
```
|
||||
|
||||
2. building pas2js
|
||||
Or on MacOS via homebrew. On Linux this can be done via your package manager
|
||||
as well if it has the latest version.
|
||||
|
||||
2.1 Under Linux/macOS type
|
||||
### building pas2js
|
||||
|
||||
#### Under Linux/macOS
|
||||
type the following command:
|
||||
```sh
|
||||
make all
|
||||
```
|
||||
|
||||
This creates with a 64-bit fpc the executable "bin/x86_64-linux/pas2js"
|
||||
and a basic config file "bin/x86_64-linux/pas2js.cfg".
|
||||
This creates with a 64-bit fpc the executable `bin/x86_64-linux/pas2js`
|
||||
and a basic config file `bin/x86_64-linux/pas2js.cfg`.
|
||||
|
||||
|
||||
2.2 Under Windows type
|
||||
#### Under Windows
|
||||
|
||||
Make sure that you use the make.exe from fpc, not from Delphi by setting
|
||||
the "PATH":
|
||||
For example if you installed the 32-bit version of fpc in C:\YourPathOfFPC\3.0.4
|
||||
|
||||
Make sure that you use the `make.exe` from fpc, not the one from Delphi by setting the
|
||||
`PATH`: For example if you installed the 32-bit version of fpc in
|
||||
`C:\YourPathOfFPC\3.2.0`:
|
||||
```bat
|
||||
set PATH=C:\YourPathOfFPC\3.0.4\bin\i386-win32;%PATH%
|
||||
|
||||
If you installed the 64-bit version of fpc in C:\YourPathOfFPC\3.0.4 use
|
||||
|
||||
```
|
||||
If you installed the 64-bit version of fpc in `C:\YourPathOfFPC\3.2.0` use
|
||||
```bat
|
||||
set PATH=C:\YourPathOfFPC\3.0.4\bin\x86-64-win64;%PATH%
|
||||
|
||||
```
|
||||
Then compile
|
||||
make all
|
||||
|
||||
If you see "Error makefile ... Command syntax error" your "set PATH" was
|
||||
not correct.
|
||||
|
||||
When "make all" finished it created with a 32-bit fpc the executable
|
||||
"bin/i386-win32/pas2js.exe" and a basic config file "bin/i386-win32/pas2js.cfg".
|
||||
When `make all` has succesfully finished it created with a 32-bit fpc the executable
|
||||
`bin/i386-win32/pas2js.exe` and a basic config file
|
||||
`bin/i386-win32/pas2js.cfg`.
|
||||
|
||||
|
||||
********************************************************************************
|
||||
|
||||
Configuration
|
||||
=============
|
||||
## Configuration
|
||||
|
||||
pas2js requires unit search paths (-Fu) in order to find its rtl units and
|
||||
rtl.js. Building and installing should have created a default pas2js.cfg
|
||||
containing those parameters.
|
||||
|
||||
http://wiki.freepascal.org/pas2js.cfg
|
||||
[http://wiki.freepascal.org/pas2js.cfg]([http://wiki.freepascal.org/pas2js.cfg])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user