ezc
is supposed to be really easy to use, as YAML
is a very user friendly, easy to use configuration format.
Here's an example of an ezc.yml
file in your project:
cc: gcc
src:
- src/main.c
output: someapp
std: c99
flags:
- -Wall
- -Wextra
extra_libs:
- m
Here's a walkthrough of what it does:
cc
defines the compiler to use. It usually will begcc
, org++
, depending if you use C or C++.src
defines the source files to compile.output
labels the output file. In this example, it'ssomeapp
.std
is optional, and is used to define the version of the standard library you want to use. For example, on C, you could usec99
, which is the C99 standard.flags
defines optional flags to compile with. It could include things like-Wall
,-m64
, and other things.extra_libs
defines extra libraries to link with.m
is the mathematical library for C/C++, which is used in many cases.
You also could do the following:
cc: g++
src:
- src/*.cpp
output: otherapp
flags:
- -Wall
- -Wextra
- -m64
Here's what that config uses:
cc
isg++
. This means it's a C++ based project.- In the
src
files, we dosrc/*.cpp
, which gets all files in thesrc
directory that end with.cpp
. - We set the output file to be
otherapp
, to differ from the previous example. - We don't define the standard, as it's optional, and is set by the compiler by default.
- We use the same flags as before, but we addded
-m64
, to make the compiler compile a 64-Bit application. - We don't actually need to define extra libraries. They aren't used in some apps.