aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2020-05-02 02:28:12 -0400
committerJesse Luehrs <doy@tozt.net>2020-05-02 02:28:12 -0400
commitebcebc96c803c1485729099103e1d99aed3f6b53 (patch)
tree7a7578ee756eb7f541ba4892b87bbb95df4bb069 /Makefile
parent86f1e98e89cd183327607ad6e0371869e1a18f33 (diff)
downloadrbw-ebcebc96c803c1485729099103e1d99aed3f6b53.tar.gz
rbw-ebcebc96c803c1485729099103e1d99aed3f6b53.zip
add makefile and packaging information
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile64
1 files changed, 64 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..c18ee30
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,64 @@
+NAME = $(shell cargo metadata --no-deps --format-version 1 | jq '.packages[0].name')
+VERSION = $(shell cargo metadata --no-deps --format-version 1 | jq '.packages[0].version')
+
+DEB_PACKAGE = $(NAME)_$(VERSION)_amd64.deb
+
+all:
+ @cargo build
+.PHONY: all
+
+release:
+ @cargo build --release
+.PHONY: release
+
+test:
+ @RUST_BACKTRACE=1 cargo test
+.PHONY: test
+
+check:
+ @cargo check --all-targets
+.PHONY: check
+
+doc:
+ @cargo doc --workspace
+.PHONY: doc
+
+clean:
+ @rm -rf *.log pkg
+.PHONY: clean
+
+cleanall: clean
+ @cargo clean
+.PHONY: cleanall
+
+package: pkg/$(DEB_PACKAGE)
+.PHONY: package
+
+pkg:
+ @mkdir pkg
+
+pkg/$(DEB_PACKAGE): | pkg
+ @cargo deb && mv target/debian/$(DEB_PACKAGE) pkg
+
+pkg/$(DEB_PACKAGE).minisig: pkg/$(DEB_PACKAGE)
+ @minisign -Sm pkg/$(DEB_PACKAGE)
+
+release-dir-deb:
+ @ssh tozt.net mkdir -p releases/teleterm/deb
+.PHONY: release-dir-deb
+
+publish: publish-crates-io publish-git-tags publish-deb
+.PHONY: publish
+
+publish-crates-io: test
+ @cargo publish
+.PHONY: publish-crates-io
+
+publish-git-tags: test
+ @git tag $(VERSION)
+ @git push --tags
+.PHONY: publish-git-tags
+
+publish-deb: test pkg/$(DEB_PACKAGE) pkg/$(DEB_PACKAGE).minisig release-dir-deb
+ @scp pkg/$(DEB_PACKAGE) pkg/$(DEB_PACKAGE).minisig tozt.net:releases/rbw/deb
+.PHONY: publish-deb