From f9e360ce70d9edc88dca74058637e6b8719e442e Mon Sep 17 00:00:00 2001 From: apio Date: Thu, 25 Aug 2022 20:19:42 +0200 Subject: [PATCH] Update README.md --- README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7d40a80..625eb56 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ let @main in { More documentation is available at [Documentation](docs/Documentation.md). ## Building + First, install the required packages. (ninja is optional, you can use any build system you want) Debian/Ubuntu: @@ -92,7 +93,7 @@ In that case, symlink ninja-build to ninja (`ln -s /usr/bin/ninja /usr/bin/ninja First-time setup: ``` -./sapphire.sh generate +./sapphire.sh generate ``` To change build type/build system, just run `./sapphire.sh clean` followed by the generate command above. @@ -104,18 +105,22 @@ Building: Installing (probably will have to be run as administrator/root): ``` -./sapphire.sh install +./sapphire.sh install ``` This will install the compiler at `/bin/sapphirec`. ## Running The compiler is built at `build/sapphirec`. +For now, it can only generate object files/LLVM IR, so you'll have to link manually. + 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 +$ build/sapphirec main.sp -o main.o # compiles a file with output filename +$ build/sapphirec main.sp -o main.o --msystem darwin # compiles a file for macOS +$ build/sapphirec main.sp -o main.o && gcc main.o -o main && ./main # compiles, links and runs +$ build/sapphirec main.sp -o main.ll --emit-llvm # display the generated cross-platform LLVM intermediate representation ``` \ No newline at end of file