clap/claptests/Makefile

31 lines
734 B
Makefile
Raw Normal View History

2015-03-25 21:02:21 +00:00
THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)
2015-03-26 18:20:55 +00:00
URL:=
BRANCH:=
2015-03-25 21:02:21 +00:00
build:
cargo update
cargo build --release
test:
cd "$(THIS_DIR)"
cp Cargo.toml cargo.bak
2015-03-26 18:20:55 +00:00
@read -p "Fork URL: " URL; \
sed "/^git/c\git = \"$$URL\"" cargo.bak > Cargo.toml
@read -p "Branch [master]: " BRANCH; \
$(if $(strip $(BRANCH)), \
sed -i "/^branch/c\branch = \"master\"" Cargo.toml, \
sed -i "/^branch/c\branch = \"$$BRANCH\"" Cargo.toml)
2015-03-25 21:02:21 +00:00
(make clean) || (make clean && false)
2015-03-26 18:20:55 +00:00
cd "$(THIS_DIR)"
2015-03-25 21:02:21 +00:00
(make build) || (make clean && false)
2015-03-26 18:20:55 +00:00
cd "$(THIS_DIR)"
(./run_tests.py) || (make clean && false)
2015-03-25 21:02:21 +00:00
mv cargo.bak Cargo.toml
make clean
clean:
cd "$(THIS_DIR)"
2015-03-26 00:50:25 +00:00
cargo clean