Adds a Makefile for building modules
One can now type: ``` $> make ``` Which builds all the modules and places them in a `out/` directory of the project root for easy finding. Alternatively one can type: ``` $> make $module ``` Where `$module` is one of the `imag-$module` names, such as `counter`, `link`, etc. To clean up the `out/` directory it's `$> make clean`
This commit is contained in:
parent
b98ccbbc01
commit
6a30e67411
2 changed files with 50 additions and 12 deletions
38
Makefile
Normal file
38
Makefile
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
toml = imag-$@/Cargo.toml
|
||||||
|
bin = imag-$@/target/debug/imag-$@
|
||||||
|
|
||||||
|
default: all
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
|
|
||||||
|
all: counter link notes store tag view
|
||||||
|
|
||||||
|
counter: prep
|
||||||
|
cargo build --manifest-path $(toml)
|
||||||
|
cp $(bin) out/
|
||||||
|
|
||||||
|
link: prep
|
||||||
|
cargo build --manifest-path $(toml)
|
||||||
|
cp $(bin) out/
|
||||||
|
|
||||||
|
notes: prep
|
||||||
|
cargo build --manifest-path $(toml)
|
||||||
|
cp $(bin) out/
|
||||||
|
|
||||||
|
store: prep
|
||||||
|
cargo build --manifest-path $(toml)
|
||||||
|
cp $(bin) out/
|
||||||
|
|
||||||
|
tag: prep
|
||||||
|
cargo build --manifest-path $(toml)
|
||||||
|
cp $(bin) out/
|
||||||
|
|
||||||
|
view: prep
|
||||||
|
cargo build --manifest-path $(toml)
|
||||||
|
cp $(bin) out/
|
||||||
|
|
||||||
|
prep:
|
||||||
|
mkdir -p out/
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf out/
|
24
README.md
24
README.md
|
@ -89,26 +89,26 @@ provided (as the libraries are work-in-progress).
|
||||||
|
|
||||||
### Building
|
### 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>
|
$> make
|
||||||
$> cargo build
|
...
|
||||||
```
|
$> ls out/
|
||||||
It may be tiresome to build all the modules by hand, but one can do something
|
imag-counter imag-link imag-notes imag-store imag-tag imag-view
|
||||||
like this:
|
|
||||||
```
|
|
||||||
$> for dir in \
|
|
||||||
>$(find ./ -maxdepth 1 -path "./imag-*" -name "imag-*" -type d)
|
|
||||||
>do
|
|
||||||
>pushd $dir; cargo build; popd
|
|
||||||
>done
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
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-$module` names, such as `counter`,
|
||||||
|
`link`, etc.
|
||||||
|
|
||||||
### Running
|
### Running
|
||||||
|
|
||||||
To run imag, simply call `./bin/imag`. This script has a function to search for
|
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`.
|
modules, which utilizes an environment variable called `IMAG_IS_THE_SHIT`.
|
||||||
To run imag with all components:
|
To run imag with all components:
|
||||||
|
|
||||||
```
|
```
|
||||||
$> IMAG_IS_THE_SHIT=$(pwd) ./bin/imag
|
$> IMAG_IS_THE_SHIT=$(pwd) ./bin/imag
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in a new issue