From f4168d67195972ab168877e7fe2fe54df25a6260 Mon Sep 17 00:00:00 2001 From: Yvan Sraka Date: Mon, 24 Dec 2018 10:24:44 +0100 Subject: [PATCH] Update Makefile rules, now using `cargo install` routine - `./configure` run `rustup install` only if `cargo` is not in `PATH` - Remove `kombucha` executable from YeAST default installation, moving it to his own repository --- Cargo.toml | 2 +- Makefile | 5 +++-- README.md | 2 +- configure | 5 ++++- install.sh | 3 +-- kombucha | 8 -------- 6 files changed, 10 insertions(+), 15 deletions(-) delete mode 100755 kombucha diff --git a/Cargo.toml b/Cargo.toml index a5bca1d..7fff843 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "yeast" -version = "0.16.0" +version = "0.17.0" authors = ["Yvan Sraka "] [dependencies] diff --git a/Makefile b/Makefile index 53f7622..c04281f 100644 --- a/Makefile +++ b/Makefile @@ -4,8 +4,7 @@ target/release/yeast: cargo build --release install: target/release/yeast - cp target/release/yeast /usr/local/bin/ - cp kombucha /usr/local/bin/ + cargo install --path . clean: cargo clean @@ -35,3 +34,5 @@ test: # Use $* for catching all args cargo run tests/all_args.in foo bar | \ cmp tests/all_args.out + +.PHONY: all target/release/yeast install test diff --git a/README.md b/README.md index 2a0fd54..3ee764f 100644 --- a/README.md +++ b/README.md @@ -148,7 +148,7 @@ IENY ## Roadmap -- [x] Create a Makefile to handle `make`, `make test` & `sudo make install` intructions. +- [x] Create a Makefile to handle `make`, `make test` & `make install` intructions. - [x] Validate builds using Travis CI. - [x] Read input file line by line using a Buffer. - [x] Use [clap.rs](https://github.com/kbknapp/clap-rs) to enhance command line interactions. diff --git a/configure b/configure index 8073e2a..f7dc08e 100755 --- a/configure +++ b/configure @@ -1,2 +1,5 @@ #! /bin/sh -curl https://sh.rustup.rs -sSf | sh + +if ! [ -x "$(command -v cargo)" ]; then + curl https://sh.rustup.rs -sSf | sh +fi diff --git a/install.sh b/install.sh index af472a4..f5b3a54 100755 --- a/install.sh +++ b/install.sh @@ -2,7 +2,6 @@ git clone https://github.com/yvan-sraka/YeAST /tmp/yeast-sources pushd /tmp/yeast-sources ./configure -make -sudo make install +make install popd rm -rf /tmp/yeast-sources diff --git a/kombucha b/kombucha deleted file mode 100755 index e16504f..0000000 --- a/kombucha +++ /dev/null @@ -1,8 +0,0 @@ -#! /usr/bin/env yeast -#! make -sf $0 $1 - -init: - git clone https://github.com/yvan-sraka/Kombucha.git ~/.kombucha - -update: - cd ~/.kombucha ; git pull -r