Merge pull request #455 from kbknapp/makefiles

Adds a Makefile for building modules
This commit is contained in:
Matthias Beyer 2016-06-04 15:32:42 +02:00
commit f400c77784
2 changed files with 30 additions and 12 deletions

18
Makefile Normal file
View file

@ -0,0 +1,18 @@
toml = $@/Cargo.toml
bin = $@/target/debug/$@
default: all
.PHONY: clean
all: imag-counter imag-link imag-notes imag-store imag-tag imag-view
imag-%: prep
cargo build --manifest-path $(toml)
cp $(bin) out/
prep:
mkdir -p out/
clean:
rm -rf out/

View file

@ -89,26 +89,26 @@ provided (as the libraries are work-in-progress).
### Building
To build a single module:
One can build all the modules simply by running `make` which defaults to building all the modules
and placing them in the `out/` directory of the project root.
```
$> cd <imag-proj-dir>/imag-<module>
$> cargo build
```
It may be tiresome to build all the modules by hand, but one can do something
like this:
```
$> for dir in \
>$(find ./ -maxdepth 1 -path "./imag-*" -name "imag-*" -type d)
>do
>pushd $dir; cargo build; popd
>done
$> make
...
$> ls out/
imag-counter imag-link imag-notes imag-store imag-tag imag-view
```
Building all the modules may take some time, so alternatively one can build only a specific module
by runing `$> make $module` where `$module` is one of the `imag-*` names, such as `imag-counter`,
`imag-link`, etc.
### Running
To run imag, simply call `./bin/imag`. This script has a function to search for
modules, which utilizes an environment variable called `IMAG_IS_THE_SHIT`.
To run imag with all components:
```
$> IMAG_IS_THE_SHIT=$(pwd) ./bin/imag
```