Quickstart
This minimal guide will get you started using confy as quickly as humanly possible.
Create an empty folder
We will start with an empty folder just for this guide.
mkdir quickstart
cd quickstart
Create a folder named src
mkdir ./src
Add the source code
Add your source code file into the src
folder.
- C
- C++
- Nim
./src/hello.c
#include <stdio.h>
int main(void) { printf("Hello World"); return 0; }
./src/hello.cpp
#include <iostream>
int main(void) { std::cout << "Hello World!" << std::endl; return 0; }
./src/hello.nim
when isMainModule:
echo "Hello World!"
Create the Builder App
Create an new file called build.nim
inside the src
folder.
- C
- C++
- Nim
./src/build.nim
import confy
let hello = Program.new( @["hello.c"], "hello" )
hello.build()
./src/build.nim
import confy
let hello = Program.new( @["hello.cpp"], "hello" )
hello.build()
./src/build.nim
import confy
let hello = Program.new( @["hello.nim"], "hello" )
hello.build()
Build and Run the Builder App
note
nim c -r ./src/build.nim
That's it. This last step will build your code as expected.
The resulting binary will be output to the ./bin
folder.
What's Next
That's the end of the road.
If your project is simple enough you won't need anything else.
In the real world this is rarely the case.
The Getting Started guide will go into more details about confy and explain how to configure it further.