Finished basic README.md

This commit is contained in:
apio 2022-06-22 19:30:21 +02:00
parent 48a76da07e
commit 832ab3daf6

View File

@ -71,3 +71,46 @@ let @main in {
io.outf(fmt,39,39,10,39,fmt,39,10,10,9,10,10);
}
```
## Documentation
More documentation is available at [Documentation](docs/Documentation.md).
## Building
First, install the required packages. (ninja is required only for the quick build, you can use other build systems (like GNU Make) for the manual build)
Debian/Ubuntu:
`# apt install cmake ninja-build llvm-dev`
CentOS/Fedora/RHEL: `# dnf install cmake ninja-build llvm-devel`
Arch: `# pacman -S cmake ninja llvm-libs`
Then, you can either use the quick-build script or do a manual build.
Quick build: `./build.sh`
Manual build first-time setup:
```
mkdir build
cd build
cmake ..
```
Then, every time you want to build:
```
cd build
cmake --build .
```
## Running
The compiler is built at `build/sapphirec`.
A few example commands:
```
$ build/sapphirec --version # prints the compiler version
$ build/sapphirec --help # shows usage
$ build/sapphirec main.sp # compiles a file
$ build/sapphirec main.sp -o main # compiles a file with output filename
$ build/sapphirec main.sp -o main --msystem darwin # compiles a file for macOS
```