2015-04-19 05:50:50 +00:00
|
|
|
.PHONY: default build test doc extensions clean
|
|
|
|
|
2015-05-24 18:06:08 +00:00
|
|
|
ifndef PY
|
2015-06-28 19:46:24 +00:00
|
|
|
PY := $(word 2, $(subst ., ,$(shell python --version 2>&1)))
|
2015-05-24 18:06:08 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(PY),2)
|
|
|
|
FEATURES=--features python27-sys --no-default-features
|
|
|
|
endif
|
|
|
|
ifeq ($(PY),3)
|
|
|
|
FEATURES=--features python3-sys --no-default-features
|
|
|
|
endif
|
|
|
|
|
2015-04-19 05:50:50 +00:00
|
|
|
default: test extensions
|
|
|
|
|
|
|
|
build:
|
2015-05-24 18:06:08 +00:00
|
|
|
cargo build $(FEATURES)
|
2015-04-19 05:50:50 +00:00
|
|
|
|
|
|
|
test: build
|
2015-05-24 18:06:08 +00:00
|
|
|
cargo test $(FEATURES)
|
2015-04-19 05:50:50 +00:00
|
|
|
|
|
|
|
doc: build
|
2015-05-24 18:06:08 +00:00
|
|
|
cargo doc --no-deps $(FEATURES)
|
2015-04-19 05:50:50 +00:00
|
|
|
|
|
|
|
extensions: build
|
2015-05-24 18:06:08 +00:00
|
|
|
make -C extensions/ PY=$(PY)
|
2015-04-19 05:50:50 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -r target
|
|
|
|
make -C extensions/ clean
|
|
|
|
|
|
|
|
gh-pages:
|
2015-05-17 19:35:04 +00:00
|
|
|
git clone --branch gh-pages git@github.com:dgrunwald/rust-cpython.git gh-pages
|
2015-04-19 05:50:50 +00:00
|
|
|
|
|
|
|
.PHONY: gh-pages-doc
|
|
|
|
gh-pages-doc: doc | gh-pages
|
|
|
|
cd gh-pages && git pull
|
|
|
|
rm -r gh-pages/doc
|
|
|
|
cp -r target/doc gh-pages/
|
|
|
|
rm gh-pages/doc/.lock
|
|
|
|
cd gh-pages && git add .
|
|
|
|
cd gh-pages && git commit -m "Update documentation"
|
|
|
|
|
|
|
|
publish: default gh-pages-doc
|
|
|
|
cargo publish
|
|
|
|
cd gh-pages && git push
|
|
|
|
|