From 832ab3daf636e78208d3f0e1cf479ce2fed233ef Mon Sep 17 00:00:00 2001 From: apio Date: Wed, 22 Jun 2022 19:30:21 +0200 Subject: [PATCH] Finished basic README.md --- README.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/README.md b/README.md index 1a75db8..b850a72 100644 --- a/README.md +++ b/README.md @@ -70,4 +70,47 @@ String fmt = 'const io from @%ccore/io%c;%cString fmt = %c%s%c;%clet @main in {% 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 ``` \ No newline at end of file