-
Notifications
You must be signed in to change notification settings - Fork 3
2 Installation
Building and installation is done via CMake from source.
- Linux
- Windows (in progress)
- BSD (planned)
- MacOS
Note: Using CSpydr on Windows via the WSL is possible, but will have some issues with system calls such as
mmap
, causing many programs to segfault. The most reliable way to use CSpydr on any platform is to use it inside a linux virtual machine.
Supported C Compilers:
-
gcc
-
clang
-
msvc
(in progress)
Supported Assemblers and Linkers:
- GNU
as
andld
CSpydr can be obtained by simply cloning this repository or dowloading the .zip
file on GitHub
$ git clone https://github.com/spydr06/cspydr.git --recursive
CSpydr depends on the following libraries. They need to be installed on your computer for CSpydr to successfully build. Be sure to also install the corresponding -dev
or -devel
of library packages for header files if needed.
Libraries:
-
glibc
(GNU C standard library, should be bundled with every major distribution) -
llvm
withllvm-c
bindings (optional)
Programs:
cmake
-
gcc
orclang
-
as
(GNU assembler (part of thebinutils
package)) -
ld
(GNU linker (part of thebinutils
package)) -
llvm-config
(optional)
Building CSpydr is done via CMake using the following commands (after cloning this repository):
$ cd ./cspydr
$ cmake .
$ make
If you don't want llvm in your build, you can disable it with:
$ cmake . -DNO_LLVM=1 $ make(to reenable, set
NO_LLVM=0
.)Builds without llvm will not rely on
llvm
andllvm-config
Global installation is necessary, because of the compiler needing the standard library to be present at /usr/share/cspydr/std
.
To install CSpydr with all of its components (cspc - The CSpydr Compiler and the CSpydr Standard Library), enter this command (needs root privileges):
# make install
Alternatively, you can specify the path of the std library with the -p
or --std-path
flags:
$ cspc <your build command> -p ./src/std
To compile a CSpydr program use the following command:
$ cspc build <your file>
To directly run a program use this command:
$ cspc run <your file>
To launch a special debug shell, start your program using the debug
action:
(not finished yet!)
$ cspc debug <your file>
Get help using this command:
$ cspc --help
Next: 3 - Hello World
2.1 - Compatibility
2.2 - Obtaining CSpydr
2.3 - Dependencies
2.4 - Building
2.5 - Installation
2.6 - Usage
4.1 - Types and Values
4.2 - Type Modifiers
4.3 - Truthiness
4.4 - Naming Conventions
5.1 - Lexical Conventions
5.2 - Variables, Members and Arguments
5.3 - Statements
5.3.1 - Blocks
5.3.2 - Loops
5.3.3 - Control Flow
5.3.4 - Expression Statements
5.3.5 - Variable Declarations
5.4 - Expressions
5.4.1 - Literals
5.4.2 - Operator Precedence
5.4.3 - Binary Operators
5.4.4 - Unary Operators
5.4.5 - Postfix Operators