2016-07-31 16:02:32 +00:00
|
|
|
# this Makefile is mostly for the packaging convenience.
|
|
|
|
# casual users should use `cargo` to retrieve the appropriate version of Chrono.
|
|
|
|
|
2015-02-04 17:37:54 +00:00
|
|
|
.PHONY: all
|
|
|
|
all:
|
|
|
|
@echo 'Try `cargo build` instead.'
|
|
|
|
|
|
|
|
.PHONY: authors
|
|
|
|
authors:
|
|
|
|
echo 'Chrono is mainly written by Kang Seonghoon <public+rust@mearie.org>,' > AUTHORS.txt
|
|
|
|
echo 'and also the following people (in ascending order):' >> AUTHORS.txt
|
|
|
|
echo >> AUTHORS.txt
|
|
|
|
git log --format='%aN <%aE>' | grep -v 'Kang Seonghoon' | sort -u >> AUTHORS.txt
|
|
|
|
|
2015-02-18 17:21:52 +00:00
|
|
|
.PHONY: readme
|
|
|
|
readme: README.md
|
|
|
|
|
|
|
|
README.md: src/lib.rs
|
|
|
|
# really, really sorry for this mess.
|
2016-01-23 05:33:20 +00:00
|
|
|
awk '/^\/\/! # Chrono /{print "[Chrono][doc]",$$4}' $< > $@
|
|
|
|
awk '/^\/\/! # Chrono /{print "[Chrono][doc]",$$4}' $< | sed 's/./=/g' >> $@
|
2015-02-18 17:21:52 +00:00
|
|
|
echo >> $@
|
|
|
|
echo '[![Chrono on Travis CI][travis-image]][travis]' >> $@
|
2016-08-16 18:05:09 +00:00
|
|
|
echo '[![Chrono on Appveyor][appveyor-image]][appveyor]' >> $@
|
|
|
|
echo '[![Chrono on crates.io][cratesio-image]][cratesio]' >> $@
|
2015-02-18 17:21:52 +00:00
|
|
|
echo >> $@
|
2016-08-16 18:05:09 +00:00
|
|
|
echo '[travis-image]: https://travis-ci.org/lifthrasiir/rust-chrono.svg?branch=master' >> $@
|
2016-08-16 18:18:12 +00:00
|
|
|
echo '[travis]: https://travis-ci.org/lifthrasiir/rust-chrono' >> $@
|
2016-08-16 18:05:09 +00:00
|
|
|
echo '[appveyor-image]: https://ci.appveyor.com/api/projects/status/o83jn08389si56fy/branch/master?svg=true' >> $@
|
|
|
|
echo '[appveyor]: https://ci.appveyor.com/project/lifthrasiir/rust-chrono/branch/master' >> $@
|
|
|
|
echo '[cratesio-image]: https://img.shields.io/crates/v/chrono.svg' >> $@
|
|
|
|
echo '[cratesio]: https://crates.io/crates/chrono' >> $@
|
2016-07-25 18:45:53 +00:00
|
|
|
awk '/^\/\/! # Chrono /,/^\/\/! ## /' $< | cut -b 5- | grep -v '^#' | \
|
|
|
|
sed 's/](\.\//](https:\/\/lifthrasiir.github.io\/rust-chrono\/chrono\//g' >> $@
|
2016-08-16 18:05:09 +00:00
|
|
|
echo '***[Complete Documentation][doc]***' >> $@
|
2015-02-18 17:21:52 +00:00
|
|
|
echo >> $@
|
|
|
|
echo '[doc]: https://lifthrasiir.github.io/rust-chrono/' >> $@
|
|
|
|
echo >> $@
|
2016-07-25 18:45:53 +00:00
|
|
|
awk '/^\/\/! ## /,!/^\/\/!/' $< | cut -b 5- | grep -v '^# ' | \
|
|
|
|
sed 's/](\.\//](https:\/\/lifthrasiir.github.io\/rust-chrono\/chrono\//g' >> $@
|
2015-02-18 17:21:52 +00:00
|
|
|
|
2016-07-31 16:02:32 +00:00
|
|
|
.PHONY: test
|
|
|
|
test:
|
|
|
|
cargo test --features 'serde rustc-serialize'
|
|
|
|
|
|
|
|
.PHONY: doc
|
|
|
|
doc: authors readme
|
|
|
|
cargo doc --features 'serde rustc-serialize'
|
|
|
|
|
|
|
|
.PHONY: doc-publish
|
|
|
|
doc-publish: doc
|
|
|
|
( \
|
|
|
|
PKGID="$$(cargo pkgid)"; \
|
|
|
|
PKGNAMEVER="$${PKGID#*#}"; \
|
|
|
|
PKGNAME="$${PKGNAMEVER%:*}"; \
|
|
|
|
REMOTE="$$(git config --get remote.origin.url)"; \
|
|
|
|
cd target/doc && \
|
|
|
|
rm -rf .git && \
|
|
|
|
git init && \
|
|
|
|
git checkout --orphan gh-pages && \
|
2016-08-02 16:18:33 +00:00
|
|
|
echo '<!doctype html><html><head><meta http-equiv="refresh" content="0;URL='$$PKGNAME'/index.html"></head><body></body></html>' > index.html && \
|
2016-07-31 16:02:32 +00:00
|
|
|
git add . && \
|
|
|
|
git commit -m 'updated docs.' && \
|
|
|
|
git push "$$REMOTE" gh-pages -f; \
|
|
|
|
)
|
|
|
|
|