[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Add a Makefile


Most of the commands are simply wrappers around the cargo equivalent.
However, it does include commands to install and uninstall a release
build of the program.
---
 Makefile | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 Makefile

diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..65e1879
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,29 @@
+OS = $$( uname -s )
+
+all: build
+
+release:
+	cargo build --release
+
+build:
+	cargo build
+
+test:
+	cargo test
+
+run:
+	cargo run
+
+install: release
+	$$( case $(OS) in \
+		( Linux ) cat dist/etc/dwvshrc dist/etc/linuxrc > /etc/dwvshrc ;; \
+		( * ) cat dist/etc/dwvshrc > /etc/dwvshrc ;; \
+	esac )
+	cp -f target/release/dwvsh /usr/bin;
+
+uninstall:
+	rm -f /usr/bin/dwvsh 
+	rm -f /etc/dwvshrc
+
+clean:
+	cargo clean
-- 
cheers!~
Rory




Archive administrator: postmaster AT dwarvish DOT org