From e8f61dd03bffba9b69ca31bf55d327ccc3966b4a Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 27 Oct 2016 11:13:54 +0200 Subject: Rewrite how to build imag --- README.md | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 5c281fb8..dd0108bd 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ files. Here goes how to try `imag` out. -`imag` is a _suite_ of tools and you can build them individually. +`imag` is a _suite/collection_ of tools and you can build them individually. All subdirectories prefixed with "`libimag"` are libraries for the respective binaries. All subdirectories prefixed with `"imag-"` are binaries and compiling them will @@ -44,24 +44,29 @@ give you a commandline application. ### Building -By now, there are several targets in the Makefile, fulfilling following roles: - -* `all` is the default and builds every crate in debug mode. - To build a single module, call `make `, for example `make imag-store`. -* `release`, as the name implies, builds every module in release mode. - E.G.: `make imag-store-release` to build "imag-store" in release mode. -* `install` will install all commandline modules to the default installation - root (see `man cargo-install`). - To install a single module, run `make -install`, - E.G.: `make imag-store-install` -* `bin`/`lib` are separate targets for either building all binaries or - libraries. -* `lib-test` runs `cargo test` for all libraries. - For testing a single library, E.G.: `make test-libimagstore`. -* `clean` will run `cargo clean` in every crate. - For cleaning a single crate, use `make imag-store-clean` for example. -* to build _only_ the `imag` binary, use the target `imag-bin` - (`imag-bin-release` for release build, `imag-bin-clean` for `cargo clean`ing). +We use `make` to automate the build process (as `cargo` is not (yet?) able to +build several applications at once). +Make sure to _not_ include some `-j 8` arguments, as cargo parallelizes the +build process on its own. If you parallelize it with make, you end up with a +really high load on your system. + +There are several targets for each of the sub-crates in the Makefile: + +| Target | Multi | Purpose | Example | +| :--- | ----- | :--- | :--- | +| all | | Build everything, debug mode | `make all` | +| bin | | Build all binaries, debug mode | `make bin` | +| lib | | Build all libraries, debug mode | `make lib` | +| lib-test | | Test all libraries | `make lib-test` | +| imag-bin | | Build only the `imag` binary, debug mode | `make imag-bin` | +| check | * | Run `cargo check` | `make check` | +| clean | * | Remove build artifacts | `make clean` | +| install | * | Build everything, release mode, install | `make install` | +| release | * | Build everything, release mode | `make release` | +| update | * | Run `cargo update` | `make update` | + +The `Multi` targets are callable for each sub-crate. For example you can call +`make imag-bookmark-check` to run `cargo check` on the `imag-bookmark` subcrate. ### Running -- cgit v1.2.3