typos
This commit is contained in:
parent
338cc3c794
commit
8d835713c8
1 changed files with 20 additions and 21 deletions
41
README.md
41
README.md
|
@ -17,9 +17,8 @@ constantly changing.
|
||||||
|
|
||||||
*ngen* aims to make generating build files for these small C/C++ projects as
|
*ngen* aims to make generating build files for these small C/C++ projects as
|
||||||
simple as possible by using a basic key-value configuration file using patterns
|
simple as possible by using a basic key-value configuration file using patterns
|
||||||
that any experienced programmer should be familiar with. In doing so, ngen
|
that any experienced programmer should be familiar with. In doing so, ngen fills
|
||||||
fills the gap between writing your own makefile and wrangling with
|
the gap between writing your own makefile and wrangling with CMakeLists.txt.
|
||||||
CMakeLists.txt.
|
|
||||||
|
|
||||||
ngen generates files for the small and modern [Ninja](https://ninja-build.org/)
|
ngen generates files for the small and modern [Ninja](https://ninja-build.org/)
|
||||||
build system. "Where other build systems are high-level languages Ninja aims to
|
build system. "Where other build systems are high-level languages Ninja aims to
|
||||||
|
@ -78,20 +77,20 @@ sources = [
|
||||||
**The `sources` key is a *list* of *strings*, each specifying a single source
|
**The `sources` key is a *list* of *strings*, each specifying a single source
|
||||||
file name.**
|
file name.**
|
||||||
|
|
||||||
Now run `ngen`. This will generate a `build.ninja` file in the current
|
Now run `ngen`. This will generate a `build.ninja` file in the current working
|
||||||
working directory. You won't ever have to touch file; thats what ngen is for. You
|
directory. You won't ever have to touch this file; that's what ngen is for. You
|
||||||
also won't ever have to run `ngen` yourself again (unless your `build.ninja`
|
also won't ever have to run `ngen` yourself again (unless your `build.ninja`
|
||||||
gets deleted); Ninja will take care of regenerating the build file if
|
gets deleted); Ninja will take care of regenerating the build file if
|
||||||
`ngen.toml` changes.
|
`ngen.toml` changes.
|
||||||
|
|
||||||
With your `build.ninja` generated, run `ninja` on the command line. Thats it!
|
With your `build.ninja` generated, run `ninja` on the command line. That's it!
|
||||||
Your project is now built, you will find it in `build/main/a.out`. Remember, you
|
Your project is now built, you will find the executable at `build/main/a.out`.
|
||||||
can also freely add and remove files from this list without running `ngen`
|
Remember, you can also freely add and remove files from the above list without
|
||||||
again: Ninja will regenerate the `build.ninja` for you.
|
running `ngen` again: Ninja will regenerate the `build.ninja` for you.
|
||||||
|
|
||||||
Now, while this is functional, it isn't very useful. It is very likely that you
|
Now, while this is functional, it isn't very useful. It is very likely that you
|
||||||
will want to specify a compiler (gcc/clang), pass some flags, link some
|
will want to specify a compiler (gcc/clang), pass some flags, link some
|
||||||
libraries into your final exectuable, and definitly name your program something
|
libraries into your final executable, and definitely name your program something
|
||||||
other than "a.out." ngen makes these things dead simple, too.
|
other than "a.out." ngen makes these things dead simple, too.
|
||||||
|
|
||||||
**The `outfile` key is a *string* that specifies the name of the file produced
|
**The `outfile` key is a *string* that specifies the name of the file produced
|
||||||
|
@ -126,24 +125,24 @@ of this for you. For example, add the following to your `ngen.toml`:
|
||||||
compiler_flags = ["-Wall", "-Wextra -O2"]
|
compiler_flags = ["-Wall", "-Wextra -O2"]
|
||||||
```
|
```
|
||||||
|
|
||||||
**The `linker` key is a *string* that specifies the program that will be used
|
**The `linker` key is a *string* that specifies the program that will be used to
|
||||||
to combine the .o files into the final `outfile`.**
|
combine the .o files into the final `outfile`.**
|
||||||
|
|
||||||
If the `linker` key is not found, it will be set to the value of `compiler`. For
|
If the `linker` key is not found, it will be set to the value of `compiler`. For
|
||||||
this example, we don't have to change anything here.
|
this example, we don't have to change anything here.
|
||||||
|
|
||||||
**The `linker_flags` key is a *list* of *strings* that contains the arguments
|
**The `linker_flags` key is a *list* of *strings* that contains the arguments to
|
||||||
to be passed to the `linker` during the linking of the `outfile`.**
|
be passed to the `linker` during the linking of the `outfile`.**
|
||||||
|
|
||||||
Library flags (`-lm`, `lyourlib`) should NOT be included here. This is for
|
Library flags (`-lm`, `-lyourlib`) should NOT be included here. This is for
|
||||||
linker options, not libraries. There is nothing we have to set here; the sytax
|
linker options, not libraries. The syntax is the same as `compiler_flags`. There
|
||||||
works the same as `compiler_flags`.
|
is nothing we have to set here.
|
||||||
|
|
||||||
**The `linker_libs` key is a *list* of *strings* that contains the link library
|
**The `linker_libs` key is a *list* of *strings* that contains the link library
|
||||||
arguments to be linked to the `outfile`.**
|
arguments to be linked to the `outfile`.**
|
||||||
|
|
||||||
THIS is where library flags (`-lm`, `lyourlib`) go. Lets say our example project
|
THIS is where library flags (`-lm`, `-lyourlib`) go. Lets say our example
|
||||||
needs the math library:
|
project needs the math library:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
linker_libs = ["-lm"]
|
linker_libs = ["-lm"]
|
||||||
|
@ -166,8 +165,8 @@ sources = [
|
||||||
|
|
||||||
This is a much more realistic looking project. Once again, any changes to any of
|
This is a much more realistic looking project. Once again, any changes to any of
|
||||||
these values will be automatically picked up by Ninja and accounted for in the
|
these values will be automatically picked up by Ninja and accounted for in the
|
||||||
build. Running `ninja -v` should show that the options you set were recognized,
|
build. Running `ninja -v` immediately after saving `ngen.toml` should show that
|
||||||
and your files were rebuilt accordingly.
|
the options you set were recognized, and your files were rebuilt accordingly.
|
||||||
|
|
||||||
TODO: explain
|
TODO: explain
|
||||||
- seperate targets
|
- seperate targets
|
||||||
|
|
Loading…
Reference in a new issue